From 225aa1499e37faf9d38257caabbadc68d78b427e Mon Sep 17 00:00:00 2001 From: Lucas Faria Mendes Date: Mon, 30 Mar 2026 12:29:41 -0300 Subject: decompiler.com --- .../ProspeccaoDialog.cs | 334 +++++++++++++++++++++ 1 file changed, 334 insertions(+) create mode 100644 Decompiler/Gestor.Application.Componentes/ProspeccaoDialog.cs (limited to 'Decompiler/Gestor.Application.Componentes/ProspeccaoDialog.cs') diff --git a/Decompiler/Gestor.Application.Componentes/ProspeccaoDialog.cs b/Decompiler/Gestor.Application.Componentes/ProspeccaoDialog.cs new file mode 100644 index 0000000..e74440f --- /dev/null +++ b/Decompiler/Gestor.Application.Componentes/ProspeccaoDialog.cs @@ -0,0 +1,334 @@ +using System; +using System.CodeDom.Compiler; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.Diagnostics; +using System.Linq; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Input; +using System.Windows.Markup; +using Gestor.Application.ViewModels.Generic; +using Gestor.Application.Views.Generic; +using Gestor.Common.Validation; +using Gestor.Model.Common; +using Gestor.Model.Domain.Common; +using Gestor.Model.Domain.Generic; +using Gestor.Model.Domain.Seguros; +using MaterialDesignThemes.Wpf; +using Xceed.Wpf.AvalonDock.Controls; + +namespace Gestor.Application.Componentes; + +public class ProspeccaoDialog : BaseUserControl, IComponentConnector, IStyleConnector +{ + public DialogProspeccaoViewModel ViewModel; + + internal TextBox DocumentoBox; + + internal DatePicker NascimentoBox; + + internal TextBox Prefixo1Box; + + internal TextBox Telefone1Box; + + internal TextBox Prefixo2Box; + + internal TextBox Telefone2Box; + + internal TextBox EmailBox; + + internal MenuItem SalvarButton; + + private bool _contentLoaded; + + public ProspeccaoDialog(Prospeccao prospeccao) + { + ViewModel = new DialogProspeccaoViewModel(prospeccao); + ((FrameworkElement)this).DataContext = ViewModel; + InitializeComponent(); + } + + private void DocumentoBox_OnLostFocus(object sender, RoutedEventArgs e) + { + //IL_0001: Unknown result type (might be due to invalid IL or missing references) + //IL_0006: Unknown result type (might be due to invalid IL or missing references) + TextBox val = (TextBox)sender; + val.Text = ValidationHelper.FormatDocument(val.Text); + } + + private void AutoCompleteBox_Populating(object sender, PopulatingEventArgs e) + { + if (e.Parameter.Trim().Length < 3) + { + return; + } + e.Cancel = true; + ViewModel.BuscarCliente(ValidationHelper.RemoveDiacritics(e.Parameter.Trim()), null, (TipoFiltroCliente)2).ContinueWith(delegate(Task> 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 async void AutoCompleteBox_LostFocus(object sender, RoutedEventArgs e) + { + AutoCompleteBox val = (AutoCompleteBox)sender; + if (val.SelectedItem == null) + { + return; + } + Cliente val2 = await ViewModel.BuscarInfoCliente((Cliente)val.SelectedItem); + DocumentoBox.Text = val2.Documento; + NascimentoBox.SelectedDate = val2.Nascimento; + ObservableCollection telefones = val2.Telefones; + ClienteTelefone val3 = ((telefones != null && telefones.Count > 0) ? val2.Telefones[0] : null); + if (val3 != null && ((TelefoneBase)val3).Prefixo != null) + { + Prefixo1Box.Text = ((val3 != null) ? ((TelefoneBase)val3).Prefixo : null); + } + if (val3 != null && ((TelefoneBase)val3).Numero != null) + { + Telefone1Box.Text = ((val3 != null) ? ((TelefoneBase)val3).Numero : null); + } + ObservableCollection telefones2 = val2.Telefones; + ClienteTelefone val4 = ((telefones2 != null && telefones2.Count > 1) ? val2.Telefones[1] : null); + if (val4 != null && ((TelefoneBase)val4).Prefixo != null) + { + Prefixo2Box.Text = ((val4 != null) ? ((TelefoneBase)val4).Prefixo : null); + } + if (val4 != null && ((TelefoneBase)val4).Numero != null) + { + Telefone2Box.Text = ((val4 != null) ? ((TelefoneBase)val4).Numero : null); + } + ObservableCollection emails = val2.Emails; + object obj; + if (emails == null) + { + obj = null; + } + else + { + ClienteEmail? obj2 = emails.FirstOrDefault(); + obj = ((obj2 != null) ? ((EmailBase)obj2).Email : null); + } + if (obj != null) + { + TextBox emailBox = EmailBox; + ObservableCollection emails2 = val2.Emails; + object text; + if (emails2 == null) + { + text = null; + } + else + { + ClienteEmail? obj3 = emails2.FirstOrDefault(); + text = ((obj3 != null) ? ((EmailBase)obj3).Email : null); + } + emailBox.Text = (string)text; + } + } + + private void DeleteArquivo_OnDeleteClick(object sender, RoutedEventArgs e) + { + //IL_002e: Unknown result type (might be due to invalid IL or missing references) + //IL_0034: Expected O, but got Unknown + Chip val = (Chip)((sender is Chip) ? sender : null); + if (val != null) + { + ListBox val2 = Extentions.FindVisualAncestor((DependencyObject)(object)val); + ArquivoDigital val3 = (ArquivoDigital)((ItemsControl)val2).Items[((CollectionView)((ItemsControl)val2).Items).IndexOf(((FrameworkElement)val).DataContext)]; + if (val3 != null) + { + ViewModel.Delete(val3); + } + } + } + + private void AnexarArquivos_OnClick(object sender, RoutedEventArgs e) + { + ViewModel.Anexar(); + } + + private void SalvarButton_OnClick(object sender, RoutedEventArgs e) + { + ViewModel.SelectedProspeccao.Anexos = ViewModel.ArquivosAnexados?.ToList(); + DialogHost.CloseDialogCommand.Execute((object)ViewModel.SelectedProspeccao, (IInputElement)(object)SalvarButton); + } + + [DebuggerNonUserCode] + [GeneratedCode("PresentationBuildTasks", "4.0.0.0")] + public void InitializeComponent() + { + if (!_contentLoaded) + { + _contentLoaded = true; + Uri uri = new Uri("/Gestor.Application;component/componentes/prospeccaodialog.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_0042: Unknown result type (might be due to invalid IL or missing references) + //IL_004e: Unknown result type (might be due to invalid IL or missing references) + //IL_0058: Expected O, but got Unknown + //IL_0059: Unknown result type (might be due to invalid IL or missing references) + //IL_0065: Unknown result type (might be due to invalid IL or missing references) + //IL_006f: Expected O, but got Unknown + //IL_0072: Unknown result type (might be due to invalid IL or missing references) + //IL_007c: Expected O, but got Unknown + //IL_008a: Unknown result type (might be due to invalid IL or missing references) + //IL_0094: Expected O, but got Unknown + //IL_00a1: Unknown result type (might be due to invalid IL or missing references) + //IL_00ab: Expected O, but got Unknown + //IL_00ae: Unknown result type (might be due to invalid IL or missing references) + //IL_00b8: Expected O, but got Unknown + //IL_00c5: Unknown result type (might be due to invalid IL or missing references) + //IL_00cf: Expected O, but got Unknown + //IL_00dc: Unknown result type (might be due to invalid IL or missing references) + //IL_00e6: 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_0100: Unknown result type (might be due to invalid IL or missing references) + //IL_010a: 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_013d: Unknown result type (might be due to invalid IL or missing references) + //IL_0147: Expected O, but got Unknown + //IL_0155: Unknown result type (might be due to invalid IL or missing references) + //IL_015f: Expected O, but got Unknown + //IL_0162: Unknown result type (might be due to invalid IL or missing references) + //IL_016c: Expected O, but got Unknown + //IL_017a: Unknown result type (might be due to invalid IL or missing references) + //IL_0184: Expected O, but got Unknown + //IL_0187: Unknown result type (might be due to invalid IL or missing references) + //IL_0191: Expected O, but got Unknown + //IL_019f: Unknown result type (might be due to invalid IL or missing references) + //IL_01a9: Expected O, but got Unknown + //IL_01b7: Unknown result type (might be due to invalid IL or missing references) + //IL_01c1: Expected O, but got Unknown + //IL_01c4: Unknown result type (might be due to invalid IL or missing references) + //IL_01ce: Expected O, but got Unknown + //IL_01d0: Unknown result type (might be due to invalid IL or missing references) + //IL_01dc: Unknown result type (might be due to invalid IL or missing references) + //IL_01e6: Expected O, but got Unknown + //IL_01e7: Unknown result type (might be due to invalid IL or missing references) + //IL_01f3: Unknown result type (might be due to invalid IL or missing references) + //IL_01fd: Expected O, but got Unknown + //IL_01fe: Unknown result type (might be due to invalid IL or missing references) + //IL_020a: Unknown result type (might be due to invalid IL or missing references) + //IL_0214: Expected O, but got Unknown + //IL_0216: Unknown result type (might be due to invalid IL or missing references) + //IL_0222: Unknown result type (might be due to invalid IL or missing references) + //IL_022c: Expected O, but got Unknown + //IL_022d: Unknown result type (might be due to invalid IL or missing references) + //IL_0239: Unknown result type (might be due to invalid IL or missing references) + //IL_0243: Expected O, but got Unknown + //IL_0244: Unknown result type (might be due to invalid IL or missing references) + //IL_0250: Unknown result type (might be due to invalid IL or missing references) + //IL_025a: Expected O, but got Unknown + //IL_025c: Unknown result type (might be due to invalid IL or missing references) + //IL_0268: Unknown result type (might be due to invalid IL or missing references) + //IL_0272: Expected O, but got Unknown + //IL_0275: Unknown result type (might be due to invalid IL or missing references) + //IL_027f: Expected O, but got Unknown + //IL_028c: Unknown result type (might be due to invalid IL or missing references) + //IL_0296: Expected O, but got Unknown + switch (connectionId) + { + case 1: + ((AutoCompleteBox)target).Populating += new PopulatingEventHandler(AutoCompleteBox_Populating); + ((UIElement)(AutoCompleteBox)target).LostFocus += new RoutedEventHandler(AutoCompleteBox_LostFocus); + break; + case 2: + DocumentoBox = (TextBox)target; + ((UIElement)DocumentoBox).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros); + ((UIElement)DocumentoBox).LostFocus += new RoutedEventHandler(DocumentoBox_OnLostFocus); + break; + case 3: + NascimentoBox = (DatePicker)target; + ((UIElement)NascimentoBox).LostKeyboardFocus += new KeyboardFocusChangedEventHandler(base.DatePicker_OnLostKeyboardFocus); + ((Control)NascimentoBox).MouseDoubleClick += new MouseButtonEventHandler(base.DataAtual_OnDoubleClick); + ((UIElement)NascimentoBox).PreviewKeyDown += new KeyEventHandler(base.DatePicker_PreviewKeyDown); + break; + case 4: + Prefixo1Box = (TextBox)target; + ((UIElement)Prefixo1Box).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros); + break; + case 5: + Telefone1Box = (TextBox)target; + ((UIElement)Telefone1Box).LostFocus += new RoutedEventHandler(FormatarTelefone); + ((UIElement)Telefone1Box).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros); + break; + case 6: + Prefixo2Box = (TextBox)target; + ((UIElement)Prefixo2Box).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros); + break; + case 7: + Telefone2Box = (TextBox)target; + ((UIElement)Telefone2Box).LostFocus += new RoutedEventHandler(FormatarTelefone); + ((UIElement)Telefone2Box).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros); + break; + case 8: + EmailBox = (TextBox)target; + break; + case 9: + ((UIElement)(DatePicker)target).LostKeyboardFocus += new KeyboardFocusChangedEventHandler(base.DatePicker_OnLostKeyboardFocus); + ((Control)(DatePicker)target).MouseDoubleClick += new MouseButtonEventHandler(base.DataAtual_OnDoubleClick); + ((UIElement)(DatePicker)target).PreviewKeyDown += new KeyEventHandler(base.DatePicker_PreviewKeyDown); + break; + case 10: + ((UIElement)(DatePicker)target).LostKeyboardFocus += new KeyboardFocusChangedEventHandler(base.DatePicker_OnLostKeyboardFocus); + ((Control)(DatePicker)target).MouseDoubleClick += new MouseButtonEventHandler(base.DataAtual_OnDoubleClick); + ((UIElement)(DatePicker)target).PreviewKeyDown += new KeyEventHandler(base.DatePicker_PreviewKeyDown); + break; + case 12: + ((MenuItem)target).Click += new RoutedEventHandler(AnexarArquivos_OnClick); + break; + case 13: + SalvarButton = (MenuItem)target; + SalvarButton.Click += new RoutedEventHandler(SalvarButton_OnClick); + break; + default: + _contentLoaded = true; + break; + } + } + + [DebuggerNonUserCode] + [GeneratedCode("PresentationBuildTasks", "4.0.0.0")] + [EditorBrowsable(EditorBrowsableState.Never)] + void IStyleConnector.Connect(int connectionId, object target) + { + //IL_0006: Unknown result type (might be due to invalid IL or missing references) + //IL_0012: Unknown result type (might be due to invalid IL or missing references) + //IL_001c: Expected O, but got Unknown + if (connectionId == 11) + { + ((Chip)target).DeleteClick += new RoutedEventHandler(DeleteArquivo_OnDeleteClick); + } + } +} -- cgit v1.2.3