diff options
Diffstat (limited to 'Decompiler/Gestor.Application.Views.Ferramentas/StatusProspeccaoView.cs')
| -rw-r--r-- | Decompiler/Gestor.Application.Views.Ferramentas/StatusProspeccaoView.cs | 225 |
1 files changed, 225 insertions, 0 deletions
diff --git a/Decompiler/Gestor.Application.Views.Ferramentas/StatusProspeccaoView.cs b/Decompiler/Gestor.Application.Views.Ferramentas/StatusProspeccaoView.cs new file mode 100644 index 0000000..03d9d7c --- /dev/null +++ b/Decompiler/Gestor.Application.Views.Ferramentas/StatusProspeccaoView.cs @@ -0,0 +1,225 @@ +using System; +using System.CodeDom.Compiler; +using System.Collections.Generic; +using System.ComponentModel; +using System.Diagnostics; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Controls.Primitives; +using System.Windows.Markup; +using Gestor.Application.Helpers; +using Gestor.Application.ViewModels.Ferramentas; +using Gestor.Application.Views.Generic; +using Gestor.Common.Validation; +using Gestor.Model.Common; +using Gestor.Model.Domain.Ferramentas; +using Gestor.Model.Domain.Generic; + +namespace Gestor.Application.Views.Ferramentas; + +public class StatusProspeccaoView : BaseUserControl, IComponentConnector +{ + public StatusProspeccaoViewModel ViewModel; + + internal DataGrid StatusProspeccaoGrid; + + internal MenuItem MaisOpcoesButton; + + internal TextBox NomeBox; + + internal ToggleButton AtivoBox; + + internal TextBox ObsBox; + + private bool _contentLoaded; + + public StatusProspeccaoView() + { + ((FrameworkElement)this).Tag = "CADASTRO DE STATUS DE PROSPECÇÃO"; + ViewModel = new StatusProspeccaoViewModel(); + ((FrameworkElement)this).DataContext = ViewModel; + InitializeComponent(); + } + + private void AutoCompleteBoxStatusProspeccao_Populating(object sender, PopulatingEventArgs e) + { + e.Cancel = true; + ViewModel.Filtrar(ValidationHelper.RemoveDiacritics(e.Parameter.Trim())).ContinueWith(delegate(Task<List<StatusDeProspeccao>> searchResult) + { + //IL_000f: Unknown result type (might be due to invalid IL or missing references) + //IL_0014: Unknown result type (might be due to invalid IL or missing references) + if (searchResult.Result != null) + { + AutoCompleteBox val = (AutoCompleteBox)sender; + val.ItemsSource = searchResult.Result; + val.PopulateComplete(); + } + }, TaskScheduler.FromCurrentSynchronizationContext()); + } + + private void AutoCompleteBox_OnTextChanged(object sender, RoutedEventArgs e) + { + //IL_0001: Unknown result type (might be due to invalid IL or missing references) + if (string.IsNullOrWhiteSpace(((AutoCompleteBox)sender).Text)) + { + ViewModel.FiltrarStatusProspeccao(""); + } + } + + private void Incluir_OnClick(object sender, RoutedEventArgs e) + { + ViewModel.Incluir(); + ValidarTela(); + } + + private void Alterar_OnClick(object sender, RoutedEventArgs e) + { + //IL_0016: Unknown result type (might be due to invalid IL or missing references) + //IL_0020: Expected O, but got Unknown + ViewModel.CancelStatusProspeccao = (StatusDeProspeccao)((DomainBase)ViewModel.SelectedStatusProspeccao).Clone(); + ViewModel.Alterar(alterar: true); + ValidarTela(); + ((DomainBase)ViewModel.SelectedStatusProspeccao).Initialize(); + } + + private async void Salvar_OnClick(object sender, RoutedEventArgs e) + { + ViewModel.Loading(isLoading: true); + List<KeyValuePair<string, string>> list = await ViewModel.Salvar(); + ((DependencyObject)(object)this).ValidateFields(list); + bool num = list == null || list.Count == 0; + ViewModel.Loading(isLoading: false); + if (!num) + { + await ViewModel.ShowMessage(list, ViewModel.ErroCamposInvalidos, "OK"); + } + } + + private void Cancelar_OnClick(object sender, RoutedEventArgs e) + { + ViewModel.CancelarAlteracao(); + } + + private void Excluir_OnClick(object sender, RoutedEventArgs e) + { + ViewModel.Excluir(); + } + + private void AbrirLog_OnClick(object sender, RoutedEventArgs e) + { + ViewModel.AbrirLog((TipoTela)57, ((DomainBase)ViewModel.SelectedStatusProspeccao).Id); + } + + private void ValidarTela() + { + if (ViewModel.SelectedStatusProspeccao != null) + { + List<KeyValuePair<string, string>> errorMessages = ViewModel.SelectedStatusProspeccao.Validate(); + ((DependencyObject)(object)this).ValidateFields(errorMessages, focusField: false); + } + } + + [DebuggerNonUserCode] + [GeneratedCode("PresentationBuildTasks", "4.0.0.0")] + public void InitializeComponent() + { + if (!_contentLoaded) + { + _contentLoaded = true; + Uri uri = new Uri("/Gestor.Application;component/views/ferramentas/statusprospeccaoview.xaml", UriKind.Relative); + Application.LoadComponent((object)this, uri); + } + } + + [DebuggerNonUserCode] + [GeneratedCode("PresentationBuildTasks", "4.0.0.0")] + internal Delegate _CreateDelegate(Type delegateType, string handler) + { + return Delegate.CreateDelegate(delegateType, this, handler); + } + + [DebuggerNonUserCode] + [GeneratedCode("PresentationBuildTasks", "4.0.0.0")] + [EditorBrowsable(EditorBrowsableState.Never)] + void IComponentConnector.Connect(int connectionId, object target) + { + //IL_003e: Unknown result type (might be due to invalid IL or missing references) + //IL_004a: Unknown result type (might be due to invalid IL or missing references) + //IL_0054: Expected O, but got Unknown + //IL_0055: Unknown result type (might be due to invalid IL or missing references) + //IL_0061: Unknown result type (might be due to invalid IL or missing references) + //IL_006b: Expected O, but got Unknown + //IL_006e: Unknown result type (might be due to invalid IL or missing references) + //IL_0078: Expected O, but got Unknown + //IL_007a: Unknown result type (might be due to invalid IL or missing references) + //IL_0086: Unknown result type (might be due to invalid IL or missing references) + //IL_0090: Expected O, but got Unknown + //IL_0092: Unknown result type (might be due to invalid IL or missing references) + //IL_009e: Unknown result type (might be due to invalid IL or missing references) + //IL_00a8: Expected O, but got Unknown + //IL_00aa: Unknown result type (might be due to invalid IL or missing references) + //IL_00b6: Unknown result type (might be due to invalid IL or missing references) + //IL_00c0: Expected O, but got Unknown + //IL_00c2: Unknown result type (might be due to invalid IL or missing references) + //IL_00ce: Unknown result type (might be due to invalid IL or missing references) + //IL_00d8: Expected O, but got Unknown + //IL_00da: Unknown result type (might be due to invalid IL or missing references) + //IL_00e6: Unknown result type (might be due to invalid IL or missing references) + //IL_00f0: Expected O, but got Unknown + //IL_00f3: Unknown result type (might be due to invalid IL or missing references) + //IL_00fd: Expected O, but got Unknown + //IL_00ff: Unknown result type (might be due to invalid IL or missing references) + //IL_010b: Unknown result type (might be due to invalid IL or missing references) + //IL_0115: Expected O, but got Unknown + //IL_0118: Unknown result type (might be due to invalid IL or missing references) + //IL_0122: Expected O, but got Unknown + //IL_0125: Unknown result type (might be due to invalid IL or missing references) + //IL_012f: Expected O, but got Unknown + //IL_0132: Unknown result type (might be due to invalid IL or missing references) + //IL_013c: Expected O, but got Unknown + switch (connectionId) + { + case 1: + ((AutoCompleteBox)target).Populating += new PopulatingEventHandler(AutoCompleteBoxStatusProspeccao_Populating); + ((AutoCompleteBox)target).TextChanged += new RoutedEventHandler(AutoCompleteBox_OnTextChanged); + break; + case 2: + StatusProspeccaoGrid = (DataGrid)target; + break; + case 3: + ((MenuItem)target).Click += new RoutedEventHandler(Incluir_OnClick); + break; + case 4: + ((MenuItem)target).Click += new RoutedEventHandler(Alterar_OnClick); + break; + case 5: + ((MenuItem)target).Click += new RoutedEventHandler(Salvar_OnClick); + break; + case 6: + ((MenuItem)target).Click += new RoutedEventHandler(Cancelar_OnClick); + break; + case 7: + ((MenuItem)target).Click += new RoutedEventHandler(Excluir_OnClick); + break; + case 8: + MaisOpcoesButton = (MenuItem)target; + break; + case 9: + ((MenuItem)target).Click += new RoutedEventHandler(AbrirLog_OnClick); + break; + case 10: + NomeBox = (TextBox)target; + break; + case 11: + AtivoBox = (ToggleButton)target; + break; + case 12: + ObsBox = (TextBox)target; + break; + default: + _contentLoaded = true; + break; + } + } +} |