summaryrefslogtreecommitdiff
path: root/Decompiler/Gestor.Application.Views.Ferramentas
diff options
context:
space:
mode:
authorLucas Faria Mendes <lucas.fariamo08@gmail.com>2026-03-30 15:29:41 +0000
committerLucas Faria Mendes <lucas.fariamo08@gmail.com>2026-03-30 15:29:41 +0000
commit225aa1499e37faf9d38257caabbadc68d78b427e (patch)
tree102bb7a40c58595348ae9d3c7076201759fe0720 /Decompiler/Gestor.Application.Views.Ferramentas
parent1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1 (diff)
downloadgestor-225aa1499e37faf9d38257caabbadc68d78b427e.tar.gz
gestor-225aa1499e37faf9d38257caabbadc68d78b427e.zip
decompiler.com
Diffstat (limited to 'Decompiler/Gestor.Application.Views.Ferramentas')
-rw-r--r--Decompiler/Gestor.Application.Views.Ferramentas/CadastroEmailView.cs407
-rw-r--r--Decompiler/Gestor.Application.Views.Ferramentas/CadastroParceiroView.cs442
-rw-r--r--Decompiler/Gestor.Application.Views.Ferramentas/DownloadWindow.cs217
-rw-r--r--Decompiler/Gestor.Application.Views.Ferramentas/EmpresaView.cs469
-rw-r--r--Decompiler/Gestor.Application.Views.Ferramentas/EstipulanteView.cs448
-rw-r--r--Decompiler/Gestor.Application.Views.Ferramentas/EtiquetaView.cs164
-rw-r--r--Decompiler/Gestor.Application.Views.Ferramentas/IncluirRamoView.cs137
-rw-r--r--Decompiler/Gestor.Application.Views.Ferramentas/IncluirSeguradoraView.cs137
-rw-r--r--Decompiler/Gestor.Application.Views.Ferramentas/MalaDiretaView.cs308
-rw-r--r--Decompiler/Gestor.Application.Views.Ferramentas/ManutencaoPagamentosView.cs266
-rw-r--r--Decompiler/Gestor.Application.Views.Ferramentas/NotaFiscalView.cs352
-rw-r--r--Decompiler/Gestor.Application.Views.Ferramentas/ProdutoView.cs256
-rw-r--r--Decompiler/Gestor.Application.Views.Ferramentas/ProtocoloDocumentosView.cs196
-rw-r--r--Decompiler/Gestor.Application.Views.Ferramentas/QualificacaoView.cs210
-rw-r--r--Decompiler/Gestor.Application.Views.Ferramentas/RamoView.cs351
-rw-r--r--Decompiler/Gestor.Application.Views.Ferramentas/ReciboView.cs334
-rw-r--r--Decompiler/Gestor.Application.Views.Ferramentas/SeguradoraView.cs665
-rw-r--r--Decompiler/Gestor.Application.Views.Ferramentas/SocioView.cs277
-rw-r--r--Decompiler/Gestor.Application.Views.Ferramentas/StatusProspeccaoView.cs225
-rw-r--r--Decompiler/Gestor.Application.Views.Ferramentas/StatusView.cs274
-rw-r--r--Decompiler/Gestor.Application.Views.Ferramentas/TipoTarefaView.cs225
-rw-r--r--Decompiler/Gestor.Application.Views.Ferramentas/TipoVendedorView.cs267
-rw-r--r--Decompiler/Gestor.Application.Views.Ferramentas/UsuarioView.cs570
-rw-r--r--Decompiler/Gestor.Application.Views.Ferramentas/VendedorView.cs896
24 files changed, 8093 insertions, 0 deletions
diff --git a/Decompiler/Gestor.Application.Views.Ferramentas/CadastroEmailView.cs b/Decompiler/Gestor.Application.Views.Ferramentas/CadastroEmailView.cs
new file mode 100644
index 0000000..bf93bab
--- /dev/null
+++ b/Decompiler/Gestor.Application.Views.Ferramentas/CadastroEmailView.cs
@@ -0,0 +1,407 @@
+using System;
+using System.CodeDom.Compiler;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Diagnostics;
+using System.IO;
+using System.Linq;
+using System.Text.RegularExpressions;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Controls.Primitives;
+using System.Windows.Input;
+using System.Windows.Markup;
+using System.Windows.Threading;
+using Gestor.Application.Componentes;
+using Gestor.Application.Helpers;
+using Gestor.Application.ViewModels.Ferramentas;
+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 CadastroEmailView : UserControl, IComponentConnector
+{
+ internal DataGrid CredenciaisGrid;
+
+ internal MenuItem SalvarApoliceButton;
+
+ internal MenuItem CancelarApoliceButton;
+
+ internal MenuItem MaisOpcoesButton;
+
+ internal TextBox DescricaoBox;
+
+ internal TextBox HeaderBox;
+
+ internal ComboBox TipoBox;
+
+ internal TextBox PortaBox;
+
+ internal TextBox DominioBox;
+
+ internal TextBox EmailBox;
+
+ internal CustomPasswordBox SenhaBox;
+
+ internal TextBox LoginBox;
+
+ internal TextBlock CabecalhoTitulo;
+
+ internal WebEditor Cabecalho;
+
+ internal TextBlock AssinaturaTitulo;
+
+ internal WebEditor Assinatura;
+
+ private bool _contentLoaded;
+
+ public CadastroEmailViewModel ViewModel { get; set; }
+
+ public CadastroEmailView()
+ {
+ ((FrameworkElement)this).Tag = "CADASTRO DE E-MAIL";
+ ViewModel = new CadastroEmailViewModel();
+ ((FrameworkElement)this).DataContext = ViewModel;
+ InitializeComponent();
+ Dispatcher dispatcher = ((DispatcherObject)this).Dispatcher;
+ if (dispatcher != null)
+ {
+ dispatcher.BeginInvoke((DispatcherPriority)7, (Delegate)new Action(ContentLoad));
+ }
+ }
+
+ private async void ContentLoad()
+ {
+ ViewModel.Loading(isLoading: true);
+ await ViewModel.SelecionaCredenciais();
+ ViewModel.Loading(isLoading: false);
+ }
+
+ private void Incluir_OnClick(object sender, RoutedEventArgs e)
+ {
+ ((UIElement)Assinatura).Visibility = (Visibility)0;
+ ((UIElement)AssinaturaTitulo).Visibility = (Visibility)0;
+ ViewModel.Incluir();
+ ValidarTela();
+ }
+
+ private async void Cancelar_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.Loading(isLoading: true);
+ await ViewModel.CancelarAlteracao();
+ Assinatura.Initialize();
+ ((UIElement)Assinatura).Visibility = (Visibility)2;
+ ((UIElement)AssinaturaTitulo).Visibility = (Visibility)2;
+ Cabecalho.Initialize();
+ ((UIElement)Cabecalho).Visibility = (Visibility)2;
+ ((UIElement)CabecalhoTitulo).Visibility = (Visibility)2;
+ ViewModel.Loading(isLoading: false);
+ ScrollToItem();
+ }
+
+ private void ScrollToItem()
+ {
+ if (((Selector)CredenciaisGrid).SelectedItem != null)
+ {
+ ((UIElement)CredenciaisGrid).UpdateLayout();
+ CredenciaisGrid.ScrollIntoView(((Selector)CredenciaisGrid).SelectedItem);
+ }
+ }
+
+ private async void Salvar_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.Loading(isLoading: true);
+ ViewModel.SelectedCredencial.Assinatura = ReplaceLocalImages(Assinatura.GetHtml());
+ ViewModel.SelectedCredencial.Cabecalho = ReplaceLocalImages(Cabecalho.GetHtml());
+ 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)
+ {
+ ((UIElement)Assinatura).Visibility = (Visibility)2;
+ ((UIElement)AssinaturaTitulo).Visibility = (Visibility)2;
+ ((UIElement)Cabecalho).Visibility = (Visibility)2;
+ ((UIElement)CabecalhoTitulo).Visibility = (Visibility)2;
+ ScrollToItem();
+ }
+ else
+ {
+ await ViewModel.ShowMessage(list, ViewModel.ErroCamposInvalidos, "OK");
+ }
+ }
+
+ public string ReplaceLocalImages(string mailBody)
+ {
+ string[] array = (from Match m in Regex.Matches(mailBody, "<img(.*?)src=\"file:(///).*?>", RegexOptions.IgnoreCase)
+ select m.Groups[0].Value).ToArray();
+ for (int i = 0; i < array.Length; i++)
+ {
+ string value = Regex.Match(array[i], "(?<=src=\")(.*?)(?=\")", RegexOptions.IgnoreCase).Value;
+ string text = Regex.Match(value, "file:(///).*\\.(.*)", RegexOptions.IgnoreCase).Groups[2].Value;
+ if (text == "jpg")
+ {
+ text = "jpeg";
+ }
+ if (Uri.IsWellFormedUriString(value, UriKind.Absolute))
+ {
+ Uri uri = new Uri(value);
+ if (File.Exists(uri.LocalPath))
+ {
+ mailBody = mailBody.Replace(value, "data:image/" + text + ";base64," + Convert.ToBase64String(File.ReadAllBytes(uri.LocalPath)));
+ }
+ }
+ }
+ return mailBody;
+ }
+
+ private void Alterar_OnClick(object sender, RoutedEventArgs e)
+ {
+ ((UIElement)Assinatura).Visibility = (Visibility)0;
+ ((UIElement)AssinaturaTitulo).Visibility = (Visibility)0;
+ ((UIElement)Cabecalho).Visibility = (Visibility)0;
+ ((UIElement)CabecalhoTitulo).Visibility = (Visibility)0;
+ ViewModel.Alterar(alterar: true);
+ ValidarTela();
+ ((DomainBase)ViewModel.SelectedCredencial).Initialize();
+ }
+
+ private async void Excluir_OnClick(object sender, RoutedEventArgs e)
+ {
+ await ViewModel.Excluir();
+ ScrollToItem();
+ }
+
+ private void AutoCompleteBox_Populating(object sender, PopulatingEventArgs e)
+ {
+ e.Cancel = true;
+ ViewModel.Filtrar(ValidationHelper.RemoveDiacritics(e.Parameter.Trim())).ContinueWith(delegate(Task<List<Credencial>> 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.FiltrarCredenciais("");
+ }
+ }
+
+ private void AbrirLog_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.AbrirLog((TipoTela)17, ((DomainBase)ViewModel.SelectedCredencial).Id);
+ }
+
+ private async void ButtonBase_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.Loading(isLoading: true);
+ bool num = await ViewModel.EnviarTesteEmail();
+ ViewModel.Loading(isLoading: false);
+ if (num)
+ {
+ ViewModel.ToggleSnackBar("E-MAIL ENVIADO COM SUCESSO.");
+ }
+ }
+
+ private void ValidarTela()
+ {
+ if (ViewModel.SelectedCredencial != null)
+ {
+ List<KeyValuePair<string, string>> errorMessages = ViewModel.SelectedCredencial.Validate();
+ ((DependencyObject)(object)this).ValidateFields(errorMessages, focusField: false);
+ }
+ }
+
+ private void Tipo_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ //IL_0001: 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_0015: Unknown result type (might be due to invalid IL or missing references)
+ //IL_001a: Unknown result type (might be due to invalid IL or missing references)
+ if ((TipoEmail?)((Selector)(ComboBox)sender).SelectedItem == (TipoEmail?)0 && ViewModel.SelectedCredencial.Email != null && ViewModel.SelectedCredencial.Email.Contains("@gmail.com"))
+ {
+ EmailBox.Text = "";
+ }
+ }
+
+ private void EmailBox_OnLostKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
+ {
+ //IL_0001: Unknown result type (might be due to invalid IL or missing references)
+ if (((TextBox)sender).Text.Contains("@gmail.com"))
+ {
+ ((Selector)TipoBox).SelectedItem = (object)(TipoEmail)1;
+ }
+ }
+
+ [DebuggerNonUserCode]
+ [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
+ public void InitializeComponent()
+ {
+ if (!_contentLoaded)
+ {
+ _contentLoaded = true;
+ Uri uri = new Uri("/Gestor.Application;component/views/ferramentas/cadastroemailview.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_0066: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0072: Unknown result type (might be due to invalid IL or missing references)
+ //IL_007c: Expected O, but got Unknown
+ //IL_007d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0089: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0093: Expected O, but got Unknown
+ //IL_0096: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00a0: Expected O, but got Unknown
+ //IL_00a2: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00ae: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00b8: Expected O, but got Unknown
+ //IL_00ba: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00c6: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00d0: Expected O, but got Unknown
+ //IL_00d3: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00dd: Expected O, but got Unknown
+ //IL_00ea: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00f4: Expected O, but got Unknown
+ //IL_00f7: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0101: Expected O, but got Unknown
+ //IL_010e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0118: Expected O, but got Unknown
+ //IL_011a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0126: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0130: Expected O, but got Unknown
+ //IL_0133: Unknown result type (might be due to invalid IL or missing references)
+ //IL_013d: Expected O, but got Unknown
+ //IL_013f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_014b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0155: Expected O, but got Unknown
+ //IL_0157: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0163: Unknown result type (might be due to invalid IL or missing references)
+ //IL_016d: Expected O, but got Unknown
+ //IL_0170: Unknown result type (might be due to invalid IL or missing references)
+ //IL_017a: Expected O, but got Unknown
+ //IL_017d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0187: Expected O, but got Unknown
+ //IL_018a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0194: Expected O, but got Unknown
+ //IL_01a1: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01ab: Expected O, but got Unknown
+ //IL_01ae: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01b8: Expected O, but got Unknown
+ //IL_01bb: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01c5: Expected O, but got Unknown
+ //IL_01c8: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01d2: Expected O, but got Unknown
+ //IL_01df: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01e9: Expected O, but got Unknown
+ //IL_01f9: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0203: Expected O, but got Unknown
+ //IL_0206: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0210: Expected O, but got Unknown
+ //IL_0220: Unknown result type (might be due to invalid IL or missing references)
+ //IL_022a: Expected O, but got Unknown
+ switch (connectionId)
+ {
+ case 1:
+ ((AutoCompleteBox)target).Populating += new PopulatingEventHandler(AutoCompleteBox_Populating);
+ ((AutoCompleteBox)target).TextChanged += new RoutedEventHandler(AutoCompleteBox_OnTextChanged);
+ break;
+ case 2:
+ CredenciaisGrid = (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:
+ SalvarApoliceButton = (MenuItem)target;
+ SalvarApoliceButton.Click += new RoutedEventHandler(Salvar_OnClick);
+ break;
+ case 6:
+ CancelarApoliceButton = (MenuItem)target;
+ CancelarApoliceButton.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(ButtonBase_OnClick);
+ break;
+ case 10:
+ ((MenuItem)target).Click += new RoutedEventHandler(AbrirLog_OnClick);
+ break;
+ case 11:
+ DescricaoBox = (TextBox)target;
+ break;
+ case 12:
+ HeaderBox = (TextBox)target;
+ break;
+ case 13:
+ TipoBox = (ComboBox)target;
+ ((Selector)TipoBox).SelectionChanged += new SelectionChangedEventHandler(Tipo_OnSelectionChanged);
+ break;
+ case 14:
+ PortaBox = (TextBox)target;
+ break;
+ case 15:
+ DominioBox = (TextBox)target;
+ break;
+ case 16:
+ EmailBox = (TextBox)target;
+ ((UIElement)EmailBox).LostKeyboardFocus += new KeyboardFocusChangedEventHandler(EmailBox_OnLostKeyboardFocus);
+ break;
+ case 17:
+ SenhaBox = (CustomPasswordBox)target;
+ break;
+ case 18:
+ LoginBox = (TextBox)target;
+ break;
+ case 19:
+ CabecalhoTitulo = (TextBlock)target;
+ break;
+ case 20:
+ Cabecalho = (WebEditor)target;
+ break;
+ case 21:
+ AssinaturaTitulo = (TextBlock)target;
+ break;
+ case 22:
+ Assinatura = (WebEditor)target;
+ break;
+ default:
+ _contentLoaded = true;
+ break;
+ }
+ }
+}
diff --git a/Decompiler/Gestor.Application.Views.Ferramentas/CadastroParceiroView.cs b/Decompiler/Gestor.Application.Views.Ferramentas/CadastroParceiroView.cs
new file mode 100644
index 0000000..3212dae
--- /dev/null
+++ b/Decompiler/Gestor.Application.Views.Ferramentas/CadastroParceiroView.cs
@@ -0,0 +1,442 @@
+using System;
+using System.CodeDom.Compiler;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Diagnostics;
+using System.Runtime.CompilerServices;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Controls.Primitives;
+using System.Windows.Input;
+using System.Windows.Markup;
+using System.Windows.Threading;
+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.Generic;
+using Gestor.Model.Domain.Seguros;
+
+namespace Gestor.Application.Views.Ferramentas;
+
+public class CadastroParceiroView : BaseUserControl, IComponentConnector
+{
+ [Serializable]
+ [CompilerGenerated]
+ private sealed class _003C_003Ec
+ {
+ public static readonly _003C_003Ec _003C_003E9 = new _003C_003Ec();
+
+ public static MouseButtonEventHandler _003C_003E9__5_0;
+
+ internal void _003CContentLoad_003Eb__5_0(object sender, MouseButtonEventArgs args)
+ {
+ }
+ }
+
+ internal DataGrid ParceiroGrid;
+
+ internal MenuItem MaisOpcoesButton;
+
+ internal TextBox NomeBox;
+
+ internal TextBox DocumentoPrincipalBox;
+
+ internal TextBox PrimeiroPrefixo;
+
+ internal TextBox PrimeiroTelefone;
+
+ internal TextBox SegundoPrefixo;
+
+ internal TextBox SegundoTelefone;
+
+ internal TextBox TerceiroPrefixo;
+
+ internal TextBox TerceiroTelefone;
+
+ internal TextBox EmailBox;
+
+ internal TextBox CepBox;
+
+ internal TextBox EnderecoBox;
+
+ internal TextBox NumeroBox;
+
+ internal TextBox BairroBox;
+
+ internal TextBox CidadeBox;
+
+ internal TextBox EstadoBox;
+
+ private bool _contentLoaded;
+
+ public CadastroParceiroViewModel ViewModel { get; set; }
+
+ public CadastroParceiroView(Parceiro parceiro = null)
+ {
+ CadastroParceiroView cadastroParceiroView = this;
+ ((FrameworkElement)this).Tag = "CADASTRO DE PARCEIROS";
+ ViewModel = new CadastroParceiroViewModel(parceiro);
+ ((FrameworkElement)this).DataContext = ViewModel;
+ InitializeComponent();
+ Dispatcher dispatcher = ((DispatcherObject)this).Dispatcher;
+ if (dispatcher != null)
+ {
+ dispatcher.BeginInvoke((DispatcherPriority)7, (Delegate)(Action)delegate
+ {
+ cadastroParceiroView.ContentLoad(parceiro);
+ });
+ }
+ }
+
+ private void ContentLoad(Parceiro parceiro)
+ {
+ //IL_001c: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0026: Expected O, but got Unknown
+ //IL_0040: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0045: Unknown result type (might be due to invalid IL or missing references)
+ //IL_004b: Expected O, but got Unknown
+ if (parceiro == null)
+ {
+ ((Selector)ParceiroGrid).SelectedIndex = -1;
+ }
+ ((Selector)ParceiroGrid).SelectionChanged += new SelectionChangedEventHandler(ParceiroGrid_OnSelectionChanged);
+ DataGrid parceiroGrid = ParceiroGrid;
+ object obj = _003C_003Ec._003C_003E9__5_0;
+ if (obj == null)
+ {
+ MouseButtonEventHandler val = delegate
+ {
+ };
+ _003C_003Ec._003C_003E9__5_0 = val;
+ obj = (object)val;
+ }
+ ((Control)parceiroGrid).MouseDoubleClick += (MouseButtonEventHandler)obj;
+ }
+
+ 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.CancelParceiro = (Parceiro)((DomainBase)ViewModel.SelectedParceiro).Clone();
+ ViewModel.Alterar(alterar: true);
+ ValidarTela();
+ ((DomainBase)ViewModel.SelectedParceiro).Initialize();
+ }
+
+ private void Excluir_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.Excluir();
+ }
+
+ private async void Salvar_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.Loading(isLoading: true);
+ ((UIElement)NomeBox).Focus();
+ 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 AutoCompleteBoxParceiro_Populating(object sender, PopulatingEventArgs e)
+ {
+ e.Cancel = true;
+ ViewModel.Filtrar(ValidationHelper.RemoveDiacritics(e.Parameter.Trim())).ContinueWith(delegate(Task<List<Parceiro>> 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.FiltrarParceiro("");
+ }
+ }
+
+ private void ParceiroGrid_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ //IL_0001: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0007: Expected O, but got Unknown
+ //IL_0031: Unknown result type (might be due to invalid IL or missing references)
+ //IL_003b: Expected O, but got Unknown
+ DataGrid val = (DataGrid)sender;
+ if (val == null || ((Selector)val).SelectedIndex >= 0)
+ {
+ ViewModel.SelecionarParceiro((Parceiro)((val != null) ? ((ItemsControl)val).Items[((Selector)val).SelectedIndex] : null));
+ }
+ }
+
+ private void AbrirLog_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.AbrirLog((TipoTela)22, ((DomainBase)ViewModel.SelectedParceiro).Id);
+ }
+
+ private async void PostcodeBox_OnLostFocus(object sender, RoutedEventArgs e)
+ {
+ string text = ValidationHelper.FormatPostCode(((TextBox)sender).Text);
+ CepBox.Text = text;
+ if (ValidationHelper.ValidatePostCode(text))
+ {
+ EnderecoBase val = await ViewModel.BuscaCep(text);
+ if (val != null)
+ {
+ EnderecoBox.Text = val.Endereco;
+ CidadeBox.Text = val.Cidade;
+ EstadoBox.Text = val.Estado;
+ BairroBox.Text = val.Bairro;
+ }
+ }
+ }
+
+ private void DocumentoPrincipalBox_LostFocus(object sender, RoutedEventArgs e)
+ {
+ //IL_0001: Unknown result type (might be due to invalid IL or missing references)
+ if (!((TextBoxBase)(TextBox)sender).IsReadOnly)
+ {
+ string text = ValidationHelper.Clear(DocumentoPrincipalBox.Text);
+ if (!string.IsNullOrEmpty(text))
+ {
+ DocumentoPrincipalBox.Text = ((text.Length == 11) ? ValidationHelper.FormatDocument(text.PadLeft(11, '0').Substring(0, 11)) : ValidationHelper.FormatDocument(text.PadLeft(14, '0').Substring(0, 14)));
+ }
+ }
+ }
+
+ private void ValidarTela()
+ {
+ if (ViewModel.SelectedParceiro != null)
+ {
+ List<KeyValuePair<string, string>> errorMessages = ViewModel.SelectedParceiro.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/cadastroparceiroview.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_006e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_007a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0084: Expected O, but got Unknown
+ //IL_0085: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0091: Unknown result type (might be due to invalid IL or missing references)
+ //IL_009b: Expected O, but got Unknown
+ //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_00f2: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00fe: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0108: Expected O, but got Unknown
+ //IL_010a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0116: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0120: Expected O, but got Unknown
+ //IL_0123: Unknown result type (might be due to invalid IL or missing references)
+ //IL_012d: Expected O, but got Unknown
+ //IL_012f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_013b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0145: Expected O, but got Unknown
+ //IL_0148: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0152: 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_016c: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0176: Expected O, but got Unknown
+ //IL_0184: Unknown result type (might be due to invalid IL or missing references)
+ //IL_018e: Expected O, but got Unknown
+ //IL_0191: Unknown result type (might be due to invalid IL or missing references)
+ //IL_019b: Expected O, but got Unknown
+ //IL_01a9: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01b3: Expected O, but got Unknown
+ //IL_01b6: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01c0: Expected O, but got Unknown
+ //IL_01ce: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01d8: Expected O, but got Unknown
+ //IL_01e6: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01f0: Expected O, but got Unknown
+ //IL_01f3: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01fd: Expected O, but got Unknown
+ //IL_020b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0215: Expected O, but got Unknown
+ //IL_0218: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0222: Expected O, but got Unknown
+ //IL_0230: Unknown result type (might be due to invalid IL or missing references)
+ //IL_023a: Expected O, but got Unknown
+ //IL_0248: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0252: Expected O, but got Unknown
+ //IL_0255: Unknown result type (might be due to invalid IL or missing references)
+ //IL_025f: Expected O, but got Unknown
+ //IL_026d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0277: Expected O, but got Unknown
+ //IL_027a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0284: Expected O, but got Unknown
+ //IL_0292: Unknown result type (might be due to invalid IL or missing references)
+ //IL_029c: Expected O, but got Unknown
+ //IL_02aa: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02b4: Expected O, but got Unknown
+ //IL_02b7: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02c1: Expected O, but got Unknown
+ //IL_02c4: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02ce: Expected O, but got Unknown
+ //IL_02db: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02e5: Expected O, but got Unknown
+ //IL_02f3: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02fd: Expected O, but got Unknown
+ //IL_0300: Unknown result type (might be due to invalid IL or missing references)
+ //IL_030a: Expected O, but got Unknown
+ //IL_030d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0317: Expected O, but got Unknown
+ //IL_031a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0324: Expected O, but got Unknown
+ //IL_0327: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0331: Expected O, but got Unknown
+ //IL_0334: Unknown result type (might be due to invalid IL or missing references)
+ //IL_033e: Expected O, but got Unknown
+ switch (connectionId)
+ {
+ case 1:
+ ((AutoCompleteBox)target).Populating += new PopulatingEventHandler(AutoCompleteBoxParceiro_Populating);
+ ((AutoCompleteBox)target).TextChanged += new RoutedEventHandler(AutoCompleteBox_OnTextChanged);
+ break;
+ case 2:
+ ParceiroGrid = (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:
+ DocumentoPrincipalBox = (TextBox)target;
+ ((UIElement)DocumentoPrincipalBox).LostFocus += new RoutedEventHandler(DocumentoPrincipalBox_LostFocus);
+ ((UIElement)DocumentoPrincipalBox).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 12:
+ PrimeiroPrefixo = (TextBox)target;
+ ((UIElement)PrimeiroPrefixo).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 13:
+ PrimeiroTelefone = (TextBox)target;
+ ((UIElement)PrimeiroTelefone).LostFocus += new RoutedEventHandler(FormatarTelefone);
+ ((UIElement)PrimeiroTelefone).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 14:
+ SegundoPrefixo = (TextBox)target;
+ ((UIElement)SegundoPrefixo).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 15:
+ SegundoTelefone = (TextBox)target;
+ ((UIElement)SegundoTelefone).LostFocus += new RoutedEventHandler(FormatarTelefone);
+ ((UIElement)SegundoTelefone).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 16:
+ TerceiroPrefixo = (TextBox)target;
+ ((UIElement)TerceiroPrefixo).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 17:
+ TerceiroTelefone = (TextBox)target;
+ ((UIElement)TerceiroTelefone).LostFocus += new RoutedEventHandler(FormatarTelefone);
+ ((UIElement)TerceiroTelefone).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 18:
+ EmailBox = (TextBox)target;
+ break;
+ case 19:
+ CepBox = (TextBox)target;
+ ((UIElement)CepBox).LostFocus += new RoutedEventHandler(PostcodeBox_OnLostFocus);
+ ((UIElement)CepBox).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 20:
+ EnderecoBox = (TextBox)target;
+ break;
+ case 21:
+ NumeroBox = (TextBox)target;
+ break;
+ case 22:
+ BairroBox = (TextBox)target;
+ break;
+ case 23:
+ CidadeBox = (TextBox)target;
+ break;
+ case 24:
+ EstadoBox = (TextBox)target;
+ break;
+ default:
+ _contentLoaded = true;
+ break;
+ }
+ }
+}
diff --git a/Decompiler/Gestor.Application.Views.Ferramentas/DownloadWindow.cs b/Decompiler/Gestor.Application.Views.Ferramentas/DownloadWindow.cs
new file mode 100644
index 0000000..0c208ad
--- /dev/null
+++ b/Decompiler/Gestor.Application.Views.Ferramentas/DownloadWindow.cs
@@ -0,0 +1,217 @@
+using System;
+using System.CodeDom.Compiler;
+using System.ComponentModel;
+using System.Diagnostics;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Input;
+using System.Windows.Markup;
+using System.Windows.Media;
+using System.Windows.Shapes;
+using System.Windows.Shell;
+using System.Windows.Threading;
+using Gestor.Application.ViewModels.Ferramentas;
+using Gestor.Model.API;
+
+namespace Gestor.Application.Views.Ferramentas;
+
+public class DownloadWindow : Window, IComponentConnector
+{
+ internal DownloadViewModel ViewModel;
+
+ private bool _buttonClickable;
+
+ internal WindowChrome WindowChrome;
+
+ internal Grid MinimizeButton;
+
+ internal Grid MaximizeButton;
+
+ internal Grid CloseButton;
+
+ private bool _contentLoaded;
+
+ private void TopControls_OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
+ {
+ //IL_0008: Unknown result type (might be due to invalid IL or missing references)
+ //IL_000e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0030: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0035: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0024: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0029: Unknown result type (might be due to invalid IL or missing references)
+ //IL_003f: Expected O, but got Unknown
+ _buttonClickable = true;
+ ((Panel)(Grid)sender).Background = (Brush)((((FrameworkElement)(Grid)sender).Name == "CloseButton") ? new SolidColorBrush(Colors.Red) : new SolidColorBrush(Colors.DimGray));
+ }
+
+ private void TopControls_OnMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
+ {
+ //IL_000f: Unknown result type (might be due to invalid IL or missing references)
+ if (_buttonClickable)
+ {
+ ((object)this).GetType().GetMethod(((FrameworkElement)(Grid)sender).Name + "_Click")?.Invoke(this, null);
+ }
+ }
+
+ private static void TopControls_OnMouseEnter(object sender, MouseEventArgs e)
+ {
+ //IL_0001: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0007: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0029: Unknown result type (might be due to invalid IL or missing references)
+ //IL_002e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_001d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0022: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0038: Expected O, but got Unknown
+ //IL_0039: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0044: Expected O, but got Unknown
+ //IL_004e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0053: Unknown result type (might be due to invalid IL or missing references)
+ //IL_005d: Expected O, but got Unknown
+ ((Panel)(Grid)sender).Background = (Brush)((((FrameworkElement)(Grid)sender).Name == "CloseButton") ? new SolidColorBrush(Colors.IndianRed) : new SolidColorBrush(Colors.Gray));
+ DependencyObject child = VisualTreeHelper.GetChild((DependencyObject)(Grid)sender, 0);
+ Path val = (Path)(object)((child is Path) ? child : null);
+ if (val != null)
+ {
+ ((Shape)val).Stroke = (Brush)new SolidColorBrush(Colors.White);
+ }
+ }
+
+ private void TopControls_OnMouseLeave(object sender, MouseEventArgs e)
+ {
+ //IL_0008: Unknown result type (might be due to invalid IL or missing references)
+ //IL_000d: 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
+ //IL_001d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0028: Expected O, but got Unknown
+ //IL_0032: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0037: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0041: Expected O, but got Unknown
+ _buttonClickable = false;
+ ((Panel)(Grid)sender).Background = (Brush)new SolidColorBrush(Colors.Transparent);
+ DependencyObject child = VisualTreeHelper.GetChild((DependencyObject)(Grid)sender, 0);
+ Path val = (Path)(object)((child is Path) ? child : null);
+ if (val != null)
+ {
+ ((Shape)val).Stroke = (Brush)new SolidColorBrush(Colors.White);
+ }
+ }
+
+ public void MinimizeButton_Click()
+ {
+ ((Window)this).WindowState = (WindowState)1;
+ }
+
+ public void CloseButton_Click()
+ {
+ ((Window)this).Close();
+ }
+
+ public DownloadWindow(Parameters parameters)
+ {
+ ViewModel = new DownloadViewModel(parameters);
+ ((FrameworkElement)this).DataContext = ViewModel;
+ InitializeComponent();
+ Dispatcher dispatcher = ((DispatcherObject)this).Dispatcher;
+ if (dispatcher != null)
+ {
+ dispatcher.BeginInvoke((DispatcherPriority)7, (Delegate)new Action(ContentLoad));
+ }
+ }
+
+ private void ContentLoad()
+ {
+ //IL_000d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0017: Expected O, but got Unknown
+ //IL_0024: Unknown result type (might be due to invalid IL or missing references)
+ //IL_002e: Expected O, but got Unknown
+ //IL_003b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0045: Expected O, but got Unknown
+ //IL_0052: Unknown result type (might be due to invalid IL or missing references)
+ //IL_005c: Expected O, but got Unknown
+ //IL_0069: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0073: Expected O, but got Unknown
+ //IL_0080: Unknown result type (might be due to invalid IL or missing references)
+ //IL_008a: Expected O, but got Unknown
+ ((UIElement)MinimizeButton).MouseEnter += new MouseEventHandler(TopControls_OnMouseEnter);
+ ((UIElement)MinimizeButton).MouseLeave += new MouseEventHandler(TopControls_OnMouseLeave);
+ ((UIElement)MaximizeButton).MouseEnter += new MouseEventHandler(TopControls_OnMouseEnter);
+ ((UIElement)MaximizeButton).MouseLeave += new MouseEventHandler(TopControls_OnMouseLeave);
+ ((UIElement)CloseButton).MouseEnter += new MouseEventHandler(TopControls_OnMouseEnter);
+ ((UIElement)CloseButton).MouseLeave += new MouseEventHandler(TopControls_OnMouseLeave);
+ }
+
+ private async void DownloadWindow_OnLoaded(object sender, RoutedEventArgs e)
+ {
+ ViewModel.IsEnabled = false;
+ await ViewModel.Atualizar();
+ }
+
+ [DebuggerNonUserCode]
+ [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
+ public void InitializeComponent()
+ {
+ if (!_contentLoaded)
+ {
+ _contentLoaded = true;
+ Uri uri = new Uri("/Gestor.Application;component/views/ferramentas/downloadwindow.xaml", UriKind.Relative);
+ Application.LoadComponent((object)this, uri);
+ }
+ }
+
+ [DebuggerNonUserCode]
+ [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ void IComponentConnector.Connect(int connectionId, object target)
+ {
+ //IL_002e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0038: Expected O, but got Unknown
+ //IL_003b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0045: Expected O, but got Unknown
+ //IL_0048: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0052: Expected O, but got Unknown
+ //IL_005f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0069: Expected O, but got Unknown
+ //IL_0076: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0080: Expected O, but got Unknown
+ //IL_0083: Unknown result type (might be due to invalid IL or missing references)
+ //IL_008d: Expected O, but got Unknown
+ //IL_009a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00a4: Expected O, but got Unknown
+ //IL_00b1: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00bb: Expected O, but got Unknown
+ //IL_00be: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00c8: Expected O, but got Unknown
+ //IL_00d5: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00df: Expected O, but got Unknown
+ //IL_00ec: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00f6: Expected O, but got Unknown
+ switch (connectionId)
+ {
+ case 1:
+ ((FrameworkElement)(DownloadWindow)target).Loaded += new RoutedEventHandler(DownloadWindow_OnLoaded);
+ break;
+ case 2:
+ WindowChrome = (WindowChrome)target;
+ break;
+ case 3:
+ MinimizeButton = (Grid)target;
+ ((UIElement)MinimizeButton).MouseLeftButtonDown += new MouseButtonEventHandler(TopControls_OnMouseLeftButtonDown);
+ ((UIElement)MinimizeButton).MouseLeftButtonUp += new MouseButtonEventHandler(TopControls_OnMouseLeftButtonUp);
+ break;
+ case 4:
+ MaximizeButton = (Grid)target;
+ ((UIElement)MaximizeButton).MouseLeftButtonDown += new MouseButtonEventHandler(TopControls_OnMouseLeftButtonDown);
+ ((UIElement)MaximizeButton).MouseLeftButtonUp += new MouseButtonEventHandler(TopControls_OnMouseLeftButtonUp);
+ break;
+ case 5:
+ CloseButton = (Grid)target;
+ ((UIElement)CloseButton).MouseLeftButtonDown += new MouseButtonEventHandler(TopControls_OnMouseLeftButtonDown);
+ ((UIElement)CloseButton).MouseLeftButtonUp += new MouseButtonEventHandler(TopControls_OnMouseLeftButtonUp);
+ break;
+ default:
+ _contentLoaded = true;
+ break;
+ }
+ }
+}
diff --git a/Decompiler/Gestor.Application.Views.Ferramentas/EmpresaView.cs b/Decompiler/Gestor.Application.Views.Ferramentas/EmpresaView.cs
new file mode 100644
index 0000000..f940576
--- /dev/null
+++ b/Decompiler/Gestor.Application.Views.Ferramentas/EmpresaView.cs
@@ -0,0 +1,469 @@
+using System;
+using System.CodeDom.Compiler;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Diagnostics;
+using System.Runtime.CompilerServices;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Controls.Primitives;
+using System.Windows.Input;
+using System.Windows.Markup;
+using System.Windows.Threading;
+using Gestor.Application.Componentes;
+using Gestor.Application.Drawers;
+using Gestor.Application.Drawers.Configuracoes;
+using Gestor.Application.Helpers;
+using Gestor.Application.Servicos;
+using Gestor.Application.ViewModels.Ferramentas;
+using Gestor.Application.Views.Generic;
+using Gestor.Common.Validation;
+using Gestor.Model.Common;
+using Gestor.Model.Domain.Common;
+using Gestor.Model.Domain.Generic;
+
+namespace Gestor.Application.Views.Ferramentas;
+
+public class EmpresaView : BaseUserControl, IComponentConnector
+{
+ [Serializable]
+ [CompilerGenerated]
+ private sealed class _003C_003Ec
+ {
+ public static readonly _003C_003Ec _003C_003E9 = new _003C_003Ec();
+
+ public static MouseButtonEventHandler _003C_003E9__5_0;
+
+ internal void _003CContentLoad_003Eb__5_0(object sender, MouseButtonEventArgs args)
+ {
+ }
+ }
+
+ internal DataGrid EmpresaGrid;
+
+ internal MenuItem Alterar;
+
+ internal TextBox DocumentoPrincipalBox;
+
+ internal TextBox NomeBox;
+
+ internal TextBox CepBox;
+
+ internal TextBox EnderecoBox;
+
+ internal TextBox BairroBox;
+
+ internal TextBox CidadeBox;
+
+ internal TextBox EstadoBox;
+
+ internal CustomPasswordBox SenhaBox;
+
+ private bool _contentLoaded;
+
+ public EmpresaViewModel ViewModel { get; set; }
+
+ public EmpresaView()
+ {
+ ((FrameworkElement)this).Tag = "CADASTRO DE EMPRESA E FILIAIS";
+ ViewModel = new EmpresaViewModel();
+ ((FrameworkElement)this).DataContext = ViewModel;
+ InitializeComponent();
+ Dispatcher dispatcher = ((DispatcherObject)this).Dispatcher;
+ if (dispatcher != null)
+ {
+ dispatcher.BeginInvoke((DispatcherPriority)7, (Delegate)new Action(ContentLoad));
+ }
+ }
+
+ private void ContentLoad()
+ {
+ //IL_0019: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0023: Expected O, but got Unknown
+ //IL_003d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0042: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0048: Expected O, but got Unknown
+ ((Selector)EmpresaGrid).SelectedIndex = 0;
+ ((Selector)EmpresaGrid).SelectionChanged += new SelectionChangedEventHandler(EmpresaGrid_OnSelectionChanged);
+ DataGrid empresaGrid = EmpresaGrid;
+ object obj = _003C_003Ec._003C_003E9__5_0;
+ if (obj == null)
+ {
+ MouseButtonEventHandler val = delegate
+ {
+ };
+ _003C_003Ec._003C_003E9__5_0 = val;
+ obj = (object)val;
+ }
+ ((Control)empresaGrid).MouseDoubleClick += (MouseButtonEventHandler)obj;
+ if (((DomainBase)Recursos.Usuario).Id == 0L)
+ {
+ ((UIElement)Alterar).IsEnabled = true;
+ }
+ }
+
+ private void Cancelar_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.CancelarAlteracao();
+ if (((DomainBase)Recursos.Usuario).Id == 0L)
+ {
+ ((UIElement)Alterar).IsEnabled = true;
+ }
+ ((TextBoxBase)NomeBox).IsReadOnly = true;
+ ((TextBoxBase)DocumentoPrincipalBox).IsReadOnly = true;
+ ViewModel.PassWordReadOnly = ViewModel.EnableFields;
+ ViewModel.ConfirmacaoSenha = (Visibility)2;
+ }
+
+ 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);
+ ViewModel.PassWordReadOnly = ViewModel.EnableFields;
+ ViewModel.ConfirmacaoSenha = (Visibility)((list == null || list.Count <= 0) ? 2 : 0);
+ if (((DomainBase)Recursos.Usuario).Id == 0L)
+ {
+ ((UIElement)Alterar).IsEnabled = true;
+ ((TextBoxBase)NomeBox).IsReadOnly = true;
+ ((TextBoxBase)DocumentoPrincipalBox).IsReadOnly = true;
+ }
+ if (!num)
+ {
+ await ViewModel.ShowMessage(list, ViewModel.ErroCamposInvalidos, "OK");
+ }
+ }
+
+ 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.CancelEmpresa = (Empresa)((DomainBase)ViewModel.SelectedEmpresa).Clone();
+ ViewModel.Alterar(alterar: true);
+ PermissaoAuteracao();
+ ViewModel.PassWordReadOnly = ViewModel.EnableFields;
+ ViewModel.ConfirmacaoSenha = (Visibility)((((DomainBase)ViewModel.SelectedEmpresa).Id != 1) ? 2 : 0);
+ }
+
+ public void PermissaoAuteracao()
+ {
+ if (((DomainBase)Recursos.Usuario).Id != 0L)
+ {
+ ((TextBoxBase)DocumentoPrincipalBox).IsReadOnly = true;
+ ((TextBoxBase)NomeBox).IsReadOnly = true;
+ return;
+ }
+ ViewModel.ConfirmacaoSenha = (Visibility)((((DomainBase)ViewModel.SelectedEmpresa).Id != 1) ? 2 : 0);
+ ViewModel.PassWordReadOnly = true;
+ ((UIElement)Alterar).IsEnabled = false;
+ ((TextBoxBase)DocumentoPrincipalBox).IsReadOnly = false;
+ ((TextBoxBase)NomeBox).IsReadOnly = false;
+ }
+
+ private async void PostcodeBox_OnLostFocus(object sender, RoutedEventArgs e)
+ {
+ if (!ViewModel.EnableFields)
+ {
+ return;
+ }
+ string text = ValidationHelper.FormatPostCode(((TextBox)sender).Text);
+ CepBox.Text = text;
+ if (ValidationHelper.ValidatePostCode(text))
+ {
+ EnderecoBase val = await ViewModel.BuscaCep(text);
+ if (val != null)
+ {
+ EnderecoBox.Text = val.Endereco;
+ CidadeBox.Text = val.Cidade;
+ EstadoBox.Text = val.Estado;
+ BairroBox.Text = val.Bairro;
+ }
+ }
+ }
+
+ private void AutoCompleteBoxEmpresa_Populating(object sender, PopulatingEventArgs e)
+ {
+ e.Cancel = true;
+ ViewModel.Filtrar(ValidationHelper.RemoveDiacritics(e.Parameter.Trim())).ContinueWith(delegate(Task<List<Empresa>> 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.FiltrarEmpresa("");
+ }
+ }
+
+ private void EmpresaGrid_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ //IL_0001: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0007: Expected O, but got Unknown
+ //IL_0031: Unknown result type (might be due to invalid IL or missing references)
+ //IL_003b: Expected O, but got Unknown
+ DataGrid val = (DataGrid)sender;
+ if (val == null || ((Selector)val).SelectedIndex >= 0)
+ {
+ ViewModel.SelecionaEmpresa((Empresa)((val != null) ? ((ItemsControl)val).Items[((Selector)val).SelectedIndex] : null));
+ }
+ }
+
+ private async void AbrirAquivoDigital_Click(object sender, RoutedEventArgs e)
+ {
+ if (!new PermissaoArquivoDigitalServico().BuscarPermissao(Recursos.Usuario, (TipoArquivoDigital)13).Consultar)
+ {
+ await ViewModel.ShowMessage("VOCÊ NÃO POSSUI PERMISSÃO PARA ACESSAR\nARQUIVO DIGITAL DE " + ValidationHelper.GetDescription((Enum)(object)(TipoArquivoDigital)13) + ".");
+ return;
+ }
+ FiltroArquivoDigital filtro = new FiltroArquivoDigital
+ {
+ Id = ((DomainBase)ViewModel.SelectedEmpresa).Id,
+ Tipo = (TipoArquivoDigital)13,
+ Parente = ViewModel.SelectedEmpresa
+ };
+ ViewModel.ShowDrawer(new ArquivoDigitalDrawer(filtro), 0, close: false);
+ }
+
+ private void AbrirLog_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.AbrirLog((TipoTela)18, ((DomainBase)ViewModel.SelectedEmpresa).Id);
+ }
+
+ private void AbrirLogEmail_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.AbrirLogEmail((TipoTela)18, ((DomainBase)ViewModel.SelectedEmpresa).Id);
+ }
+
+ private async void Configuracoes_OnClick(object sender, RoutedEventArgs e)
+ {
+ if (await ViewModel.VerificarRestricao((TipoRestricao)64))
+ {
+ ViewModel.ShowDrawer(new ConfiguracoesDrawer(), 0, close: false);
+ }
+ }
+
+ private void DocumentoPrincipalBox_LostFocus(object sender, RoutedEventArgs e)
+ {
+ //IL_0001: Unknown result type (might be due to invalid IL or missing references)
+ if (!((TextBoxBase)(TextBox)sender).IsReadOnly)
+ {
+ string text = DocumentoPrincipalBox.Text.Clear();
+ if (!string.IsNullOrEmpty(text))
+ {
+ DocumentoPrincipalBox.Text = ((text.Length == 11) ? ValidationHelper.FormatDocument(text.PadLeft(11, '0').Substring(0, 11)) : ValidationHelper.FormatDocument(text.PadLeft(14, '0').Substring(0, 14)));
+ }
+ }
+ }
+
+ private async void AnexarLogo_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.Loading(isLoading: true);
+ await ViewModel.AnexarLogo();
+ ViewModel.Loading(isLoading: false);
+ }
+
+ [DebuggerNonUserCode]
+ [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
+ public void InitializeComponent()
+ {
+ if (!_contentLoaded)
+ {
+ _contentLoaded = true;
+ Uri uri = new Uri("/Gestor.Application;component/views/ferramentas/empresaview.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_006e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_007a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0084: Expected O, but got Unknown
+ //IL_0085: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0091: Unknown result type (might be due to invalid IL or missing references)
+ //IL_009b: Expected O, but got Unknown
+ //IL_009e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00a8: Expected O, but got Unknown
+ //IL_00ab: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00b5: Expected O, but got Unknown
+ //IL_00c2: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00cc: Expected O, but got Unknown
+ //IL_00ce: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00da: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00e4: Expected O, but got Unknown
+ //IL_00e6: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00f2: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00fc: Expected O, but got Unknown
+ //IL_00fe: Unknown result type (might be due to invalid IL or missing references)
+ //IL_010a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0114: Expected O, but got Unknown
+ //IL_0116: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0122: Unknown result type (might be due to invalid IL or missing references)
+ //IL_012c: Expected O, but got Unknown
+ //IL_012e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_013a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0144: Expected O, but got Unknown
+ //IL_0146: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0152: Unknown result type (might be due to invalid IL or missing references)
+ //IL_015c: Expected O, but got Unknown
+ //IL_015e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_016a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0174: Expected O, but got Unknown
+ //IL_0177: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0181: Expected O, but got Unknown
+ //IL_018e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0198: Expected O, but got Unknown
+ //IL_01a6: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01b0: Expected O, but got Unknown
+ //IL_01b3: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01bd: Expected O, but got Unknown
+ //IL_01c0: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01ca: Expected O, but got Unknown
+ //IL_01d7: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01e1: Expected O, but got Unknown
+ //IL_01ef: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01f9: Expected O, but got Unknown
+ //IL_01fc: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0206: Expected O, but got Unknown
+ //IL_0209: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0213: Expected O, but got Unknown
+ //IL_0216: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0220: Expected O, but got Unknown
+ //IL_0223: Unknown result type (might be due to invalid IL or missing references)
+ //IL_022d: Expected O, but got Unknown
+ //IL_023c: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0249: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0253: Expected O, but got Unknown
+ //IL_0255: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0262: Unknown result type (might be due to invalid IL or missing references)
+ //IL_026c: Expected O, but got Unknown
+ //IL_026d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_027a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0284: Expected O, but got Unknown
+ //IL_0286: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0293: Unknown result type (might be due to invalid IL or missing references)
+ //IL_029d: Expected O, but got Unknown
+ //IL_029f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02ac: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02b6: Expected O, but got Unknown
+ //IL_02b7: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02c4: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02ce: Expected O, but got Unknown
+ //IL_02d0: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02dd: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02e7: Expected O, but got Unknown
+ //IL_02e9: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02f6: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0300: Expected O, but got Unknown
+ switch (connectionId)
+ {
+ case 1:
+ ((AutoCompleteBox)target).Populating += new PopulatingEventHandler(AutoCompleteBoxEmpresa_Populating);
+ ((AutoCompleteBox)target).TextChanged += new RoutedEventHandler(AutoCompleteBox_OnTextChanged);
+ break;
+ case 2:
+ EmpresaGrid = (DataGrid)target;
+ break;
+ case 3:
+ Alterar = (MenuItem)target;
+ Alterar.Click += new RoutedEventHandler(Alterar_OnClick);
+ break;
+ case 4:
+ ((MenuItem)target).Click += new RoutedEventHandler(Salvar_OnClick);
+ break;
+ case 5:
+ ((MenuItem)target).Click += new RoutedEventHandler(Cancelar_OnClick);
+ break;
+ case 6:
+ ((MenuItem)target).Click += new RoutedEventHandler(AbrirAquivoDigital_Click);
+ break;
+ case 7:
+ ((MenuItem)target).Click += new RoutedEventHandler(AnexarLogo_OnClick);
+ break;
+ case 8:
+ ((MenuItem)target).Click += new RoutedEventHandler(AbrirLog_OnClick);
+ break;
+ case 9:
+ ((MenuItem)target).Click += new RoutedEventHandler(AbrirLogEmail_OnClick);
+ break;
+ case 10:
+ ((MenuItem)target).Click += new RoutedEventHandler(Configuracoes_OnClick);
+ break;
+ case 11:
+ DocumentoPrincipalBox = (TextBox)target;
+ ((UIElement)DocumentoPrincipalBox).LostFocus += new RoutedEventHandler(DocumentoPrincipalBox_LostFocus);
+ ((UIElement)DocumentoPrincipalBox).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 12:
+ NomeBox = (TextBox)target;
+ break;
+ case 13:
+ CepBox = (TextBox)target;
+ ((UIElement)CepBox).LostFocus += new RoutedEventHandler(PostcodeBox_OnLostFocus);
+ ((UIElement)CepBox).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 14:
+ EnderecoBox = (TextBox)target;
+ break;
+ case 15:
+ BairroBox = (TextBox)target;
+ break;
+ case 16:
+ CidadeBox = (TextBox)target;
+ break;
+ case 17:
+ EstadoBox = (TextBox)target;
+ break;
+ case 18:
+ SenhaBox = (CustomPasswordBox)target;
+ break;
+ case 19:
+ ((UIElement)(TextBox)target).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 20:
+ ((UIElement)(TextBox)target).LostFocus += new RoutedEventHandler(FormatarTelefone);
+ ((UIElement)(TextBox)target).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 21:
+ ((UIElement)(TextBox)target).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 22:
+ ((UIElement)(TextBox)target).LostFocus += new RoutedEventHandler(FormatarTelefone);
+ ((UIElement)(TextBox)target).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 23:
+ ((UIElement)(TextBox)target).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 24:
+ ((UIElement)(TextBox)target).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ default:
+ _contentLoaded = true;
+ break;
+ }
+ }
+}
diff --git a/Decompiler/Gestor.Application.Views.Ferramentas/EstipulanteView.cs b/Decompiler/Gestor.Application.Views.Ferramentas/EstipulanteView.cs
new file mode 100644
index 0000000..b352d2f
--- /dev/null
+++ b/Decompiler/Gestor.Application.Views.Ferramentas/EstipulanteView.cs
@@ -0,0 +1,448 @@
+using System;
+using System.CodeDom.Compiler;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Diagnostics;
+using System.Runtime.CompilerServices;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Controls.Primitives;
+using System.Windows.Input;
+using System.Windows.Markup;
+using System.Windows.Threading;
+using Gestor.Application.Drawers;
+using Gestor.Application.Helpers;
+using Gestor.Application.Servicos;
+using Gestor.Application.ViewModels.Ferramentas;
+using Gestor.Application.Views.Generic;
+using Gestor.Common.Validation;
+using Gestor.Model.Common;
+using Gestor.Model.Domain.Generic;
+using Gestor.Model.Domain.Seguros;
+
+namespace Gestor.Application.Views.Ferramentas;
+
+public class EstipulanteView : BaseUserControl, IComponentConnector
+{
+ [Serializable]
+ [CompilerGenerated]
+ private sealed class _003C_003Ec
+ {
+ public static readonly _003C_003Ec _003C_003E9 = new _003C_003Ec();
+
+ public static MouseButtonEventHandler _003C_003E9__2_0;
+
+ internal void _003CContentLoad_003Eb__2_0(object sender, MouseButtonEventArgs args)
+ {
+ }
+ }
+
+ public EstipulanteViewModel ViewModel;
+
+ internal DataGrid EstipulanteGrid;
+
+ internal MenuItem MaisOpcoesButton;
+
+ internal TextBox EmpresaBox;
+
+ internal TextBox NomeBox;
+
+ internal TextBox DocumentoPrincipalBox;
+
+ internal ToggleButton AtivoBox;
+
+ internal TextBox PrimeiroPrefixo;
+
+ internal TextBox PrimeiroTelefone;
+
+ internal TextBox SegundoPrefixo;
+
+ internal TextBox SegundoTelefone;
+
+ internal TextBox EmailBox;
+
+ internal TextBox CepBox;
+
+ internal TextBox EnderecoBox;
+
+ internal TextBox NumeroBox;
+
+ internal TextBox BairroBox;
+
+ internal TextBox CidadeBox;
+
+ internal TextBox EstadoBox;
+
+ private bool _contentLoaded;
+
+ public EstipulanteView()
+ {
+ ((FrameworkElement)this).Tag = "CADASTRO DE ESTIPULANTE";
+ ViewModel = new EstipulanteViewModel();
+ ((FrameworkElement)this).DataContext = ViewModel;
+ InitializeComponent();
+ Dispatcher dispatcher = ((DispatcherObject)this).Dispatcher;
+ if (dispatcher != null)
+ {
+ dispatcher.BeginInvoke((DispatcherPriority)7, (Delegate)new Action(ContentLoad));
+ }
+ }
+
+ private void ContentLoad()
+ {
+ //IL_0019: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0023: Expected O, but got Unknown
+ //IL_003d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0042: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0048: Expected O, but got Unknown
+ ((Selector)EstipulanteGrid).SelectedIndex = 0;
+ ((Selector)EstipulanteGrid).SelectionChanged += new SelectionChangedEventHandler(EstipulanteGrid_OnSelectionChanged);
+ DataGrid estipulanteGrid = EstipulanteGrid;
+ object obj = _003C_003Ec._003C_003E9__2_0;
+ if (obj == null)
+ {
+ MouseButtonEventHandler val = delegate
+ {
+ };
+ _003C_003Ec._003C_003E9__2_0 = val;
+ obj = (object)val;
+ }
+ ((Control)estipulanteGrid).MouseDoubleClick += (MouseButtonEventHandler)obj;
+ }
+
+ private void Incluir_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.Incluir();
+ ValidarTela();
+ }
+
+ private void Cancelar_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.CancelarAlteracao();
+ }
+
+ 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 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.CancelEstipulante = (Estipulante)((DomainBase)ViewModel.SelectedEstipulante).Clone();
+ ViewModel.Alterar(alterar: true);
+ ValidarTela();
+ }
+
+ private void Excluir_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.Excluir();
+ }
+
+ private async void PostcodeBox_OnLostFocus(object sender, RoutedEventArgs e)
+ {
+ string text = ValidationHelper.FormatPostCode(((TextBox)sender).Text);
+ CepBox.Text = text;
+ if (ValidationHelper.ValidatePostCode(text))
+ {
+ EnderecoBase val = await ViewModel.BuscaCep(text);
+ if (val != null)
+ {
+ EnderecoBox.Text = val.Endereco;
+ CidadeBox.Text = val.Cidade;
+ EstadoBox.Text = val.Estado;
+ BairroBox.Text = val.Bairro;
+ }
+ }
+ }
+
+ private void AutoCompleteBoxEstipulante_Populating(object sender, PopulatingEventArgs e)
+ {
+ e.Cancel = true;
+ ViewModel.Filtrar(ValidationHelper.RemoveDiacritics(e.Parameter.Trim())).ContinueWith(delegate(Task<List<Estipulante>> 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.FiltrarEstipulante("");
+ }
+ }
+
+ private void EstipulanteGrid_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ //IL_0001: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0007: Expected O, but got Unknown
+ //IL_0031: Unknown result type (might be due to invalid IL or missing references)
+ //IL_003b: Expected O, but got Unknown
+ DataGrid val = (DataGrid)sender;
+ if (val == null || ((Selector)val).SelectedIndex >= 0)
+ {
+ ViewModel.SelecionaEstipulante((Estipulante)((val != null) ? ((ItemsControl)val).Items[((Selector)val).SelectedIndex] : null));
+ }
+ }
+
+ private void AbrirLog_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.AbrirLog((TipoTela)9, ((DomainBase)ViewModel.SelectedEstipulante).Id);
+ }
+
+ private void DocumentoPrincipalBox_LostFocus(object sender, RoutedEventArgs e)
+ {
+ //IL_0001: Unknown result type (might be due to invalid IL or missing references)
+ if (!((TextBoxBase)(TextBox)sender).IsReadOnly)
+ {
+ string text = ValidationHelper.Clear(DocumentoPrincipalBox.Text);
+ if (!string.IsNullOrEmpty(text))
+ {
+ DocumentoPrincipalBox.Text = ((text.Length == 11) ? ValidationHelper.FormatDocument(text.PadLeft(11, '0').Substring(0, 11)) : ValidationHelper.FormatDocument(text.PadLeft(14, '0').Substring(0, 14)));
+ }
+ }
+ }
+
+ private void ValidarTela()
+ {
+ if (ViewModel.SelectedEstipulante != null)
+ {
+ List<KeyValuePair<string, string>> errorMessages = ViewModel.SelectedEstipulante.Validate();
+ ((DependencyObject)(object)this).ValidateFields(errorMessages, focusField: false);
+ }
+ }
+
+ private async void ArquivoDigital_OnClick(object sender, RoutedEventArgs e)
+ {
+ if (!new PermissaoArquivoDigitalServico().BuscarPermissao(Recursos.Usuario, (TipoArquivoDigital)5).Consultar)
+ {
+ await ViewModel.ShowMessage("VOCÊ NÃO POSSUI PERMISSÃO PARA ACESSAR\nARQUIVO DIGITAL DE " + ValidationHelper.GetDescription((Enum)(object)(TipoArquivoDigital)17) + ".");
+ return;
+ }
+ FiltroArquivoDigital filtro = new FiltroArquivoDigital
+ {
+ Id = ((DomainBase)ViewModel.SelectedEstipulante).Id,
+ Tipo = (TipoArquivoDigital)17,
+ Parente = ViewModel.SelectedEstipulante
+ };
+ ViewModel.ShowDrawer(new ArquivoDigitalDrawer(filtro), 0, close: false);
+ }
+
+ [DebuggerNonUserCode]
+ [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
+ public void InitializeComponent()
+ {
+ if (!_contentLoaded)
+ {
+ _contentLoaded = true;
+ Uri uri = new Uri("/Gestor.Application;component/views/ferramentas/estipulanteview.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_0072: Unknown result type (might be due to invalid IL or missing references)
+ //IL_007e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0088: Expected O, but got Unknown
+ //IL_0089: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0095: Unknown result type (might be due to invalid IL or missing references)
+ //IL_009f: Expected O, but got Unknown
+ //IL_00a2: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00ac: Expected O, but got Unknown
+ //IL_00ae: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00ba: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00c4: Expected O, but got Unknown
+ //IL_00c6: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00d2: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00dc: Expected O, but got Unknown
+ //IL_00de: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00ea: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00f4: Expected O, but got Unknown
+ //IL_00f6: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0102: Unknown result type (might be due to invalid IL or missing references)
+ //IL_010c: Expected O, but got Unknown
+ //IL_010e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_011a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0124: Expected O, but got Unknown
+ //IL_0127: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0131: Expected O, but got Unknown
+ //IL_0133: Unknown result type (might be due to invalid IL or missing references)
+ //IL_013f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0149: Expected O, but got Unknown
+ //IL_014b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0157: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0161: Expected O, but got Unknown
+ //IL_0164: Unknown result type (might be due to invalid IL or missing references)
+ //IL_016e: Expected O, but got Unknown
+ //IL_0171: Unknown result type (might be due to invalid IL or missing references)
+ //IL_017b: Expected O, but got Unknown
+ //IL_017e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0188: Expected O, but got Unknown
+ //IL_0196: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01a0: Expected O, but got Unknown
+ //IL_01ad: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01b7: Expected O, but got Unknown
+ //IL_01ba: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01c4: Expected O, but got Unknown
+ //IL_01c7: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01d1: Expected O, but got Unknown
+ //IL_01df: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01e9: Expected O, but got Unknown
+ //IL_01ec: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01f6: Expected O, but got Unknown
+ //IL_0204: Unknown result type (might be due to invalid IL or missing references)
+ //IL_020e: Expected O, but got Unknown
+ //IL_021c: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0226: Expected O, but got Unknown
+ //IL_0229: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0233: Expected O, but got Unknown
+ //IL_0241: Unknown result type (might be due to invalid IL or missing references)
+ //IL_024b: Expected O, but got Unknown
+ //IL_024e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0258: Expected O, but got Unknown
+ //IL_0266: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0270: Expected O, but got Unknown
+ //IL_027e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0288: Expected O, but got Unknown
+ //IL_028b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0295: Expected O, but got Unknown
+ //IL_0298: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02a2: Expected O, but got Unknown
+ //IL_02af: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02b9: Expected O, but got Unknown
+ //IL_02c7: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02d1: Expected O, but got Unknown
+ //IL_02d4: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02de: Expected O, but got Unknown
+ //IL_02e1: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02eb: Expected O, but got Unknown
+ //IL_02ee: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02f8: Expected O, but got Unknown
+ //IL_02fb: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0305: Expected O, but got Unknown
+ //IL_0308: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0312: Expected O, but got Unknown
+ switch (connectionId)
+ {
+ case 1:
+ ((AutoCompleteBox)target).Populating += new PopulatingEventHandler(AutoCompleteBoxEstipulante_Populating);
+ ((AutoCompleteBox)target).TextChanged += new RoutedEventHandler(AutoCompleteBox_OnTextChanged);
+ break;
+ case 2:
+ EstipulanteGrid = (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:
+ ((MenuItem)target).Click += new RoutedEventHandler(ArquivoDigital_OnClick);
+ break;
+ case 11:
+ EmpresaBox = (TextBox)target;
+ break;
+ case 12:
+ NomeBox = (TextBox)target;
+ break;
+ case 13:
+ DocumentoPrincipalBox = (TextBox)target;
+ ((UIElement)DocumentoPrincipalBox).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ ((UIElement)DocumentoPrincipalBox).LostFocus += new RoutedEventHandler(DocumentoPrincipalBox_LostFocus);
+ break;
+ case 14:
+ AtivoBox = (ToggleButton)target;
+ break;
+ case 15:
+ PrimeiroPrefixo = (TextBox)target;
+ ((UIElement)PrimeiroPrefixo).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 16:
+ PrimeiroTelefone = (TextBox)target;
+ ((UIElement)PrimeiroTelefone).LostFocus += new RoutedEventHandler(FormatarTelefone);
+ ((UIElement)PrimeiroTelefone).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 17:
+ SegundoPrefixo = (TextBox)target;
+ ((UIElement)SegundoPrefixo).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 18:
+ SegundoTelefone = (TextBox)target;
+ ((UIElement)SegundoTelefone).LostFocus += new RoutedEventHandler(FormatarTelefone);
+ ((UIElement)SegundoTelefone).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 19:
+ EmailBox = (TextBox)target;
+ break;
+ case 20:
+ CepBox = (TextBox)target;
+ ((UIElement)CepBox).LostFocus += new RoutedEventHandler(PostcodeBox_OnLostFocus);
+ ((UIElement)CepBox).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 21:
+ EnderecoBox = (TextBox)target;
+ break;
+ case 22:
+ NumeroBox = (TextBox)target;
+ break;
+ case 23:
+ BairroBox = (TextBox)target;
+ break;
+ case 24:
+ CidadeBox = (TextBox)target;
+ break;
+ case 25:
+ EstadoBox = (TextBox)target;
+ break;
+ default:
+ _contentLoaded = true;
+ break;
+ }
+ }
+}
diff --git a/Decompiler/Gestor.Application.Views.Ferramentas/EtiquetaView.cs b/Decompiler/Gestor.Application.Views.Ferramentas/EtiquetaView.cs
new file mode 100644
index 0000000..ec115cb
--- /dev/null
+++ b/Decompiler/Gestor.Application.Views.Ferramentas/EtiquetaView.cs
@@ -0,0 +1,164 @@
+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.Input;
+using System.Windows.Markup;
+using Gestor.Application.ViewModels.Ferramentas;
+using Gestor.Application.Views.Generic;
+using Gestor.Common.Validation;
+using Gestor.Model.Domain.Seguros;
+
+namespace Gestor.Application.Views.Ferramentas;
+
+public class EtiquetaView : BaseUserControl, IComponentConnector
+{
+ internal EtiquetaViewModel ViewModel;
+
+ internal AutoCompleteBox AutoCompleteBox;
+
+ internal ProgressBar ProgressRing;
+
+ internal DataGrid DataGrid;
+
+ internal Grid Botoes;
+
+ internal ComboBox CboTipoEtiqueta;
+
+ private bool _contentLoaded;
+
+ public EtiquetaView(List<Documento> list, bool apenasCliente)
+ {
+ ViewModel = new EtiquetaViewModel();
+ ((FrameworkElement)this).DataContext = ViewModel;
+ InitializeComponent();
+ ((UIElement)CboTipoEtiqueta).IsEnabled = !apenasCliente;
+ CarregarClientes(list, apenasCliente);
+ }
+
+ private async void CarregarClientes(List<Documento> list, bool apenasCliente)
+ {
+ ((UIElement)ProgressRing).Visibility = (Visibility)0;
+ ((UIElement)DataGrid).Visibility = (Visibility)2;
+ ((UIElement)Botoes).IsEnabled = false;
+ ((UIElement)AutoCompleteBox).IsEnabled = false;
+ await ViewModel.CarregarDados(list, apenasCliente);
+ ((UIElement)ProgressRing).Visibility = (Visibility)2;
+ ((UIElement)DataGrid).Visibility = (Visibility)0;
+ ((UIElement)Botoes).IsEnabled = true;
+ ((UIElement)AutoCompleteBox).IsEnabled = true;
+ }
+
+ private void Emitir_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.EmitirEtiquetas();
+ }
+
+ private void AutoCompleteBox_Populating(object sender, PopulatingEventArgs e)
+ {
+ if (e.Parameter.Length < 3)
+ {
+ return;
+ }
+ e.Cancel = true;
+ ViewModel.Filtrar(ValidationHelper.RemoveDiacritics(e.Parameter.Trim())).ContinueWith(delegate(Task<List<Documento>> 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.FiltrarApolice("");
+ }
+ }
+
+ [DebuggerNonUserCode]
+ [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
+ public void InitializeComponent()
+ {
+ if (!_contentLoaded)
+ {
+ _contentLoaded = true;
+ Uri uri = new Uri("/Gestor.Application;component/views/ferramentas/etiquetaview.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_002b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0035: Expected O, but got Unknown
+ //IL_0042: Unknown result type (might be due to invalid IL or missing references)
+ //IL_004c: Expected O, but got Unknown
+ //IL_0059: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0063: Expected O, but got Unknown
+ //IL_0066: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0070: Expected O, but got Unknown
+ //IL_0073: Unknown result type (might be due to invalid IL or missing references)
+ //IL_007d: Expected O, but got Unknown
+ //IL_0080: Unknown result type (might be due to invalid IL or missing references)
+ //IL_008a: Expected O, but got Unknown
+ //IL_008c: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0099: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00a3: Expected O, but got Unknown
+ //IL_00a6: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00b0: Expected O, but got Unknown
+ //IL_00b2: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00be: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00c8: Expected O, but got Unknown
+ switch (connectionId)
+ {
+ case 1:
+ AutoCompleteBox = (AutoCompleteBox)target;
+ AutoCompleteBox.Populating += new PopulatingEventHandler(AutoCompleteBox_Populating);
+ AutoCompleteBox.TextChanged += new RoutedEventHandler(AutoCompleteBox_OnTextChanged);
+ break;
+ case 2:
+ ProgressRing = (ProgressBar)target;
+ break;
+ case 3:
+ DataGrid = (DataGrid)target;
+ break;
+ case 4:
+ Botoes = (Grid)target;
+ break;
+ case 5:
+ ((UIElement)(TextBox)target).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 6:
+ CboTipoEtiqueta = (ComboBox)target;
+ break;
+ case 7:
+ ((MenuItem)target).Click += new RoutedEventHandler(Emitir_OnClick);
+ break;
+ default:
+ _contentLoaded = true;
+ break;
+ }
+ }
+}
diff --git a/Decompiler/Gestor.Application.Views.Ferramentas/IncluirRamoView.cs b/Decompiler/Gestor.Application.Views.Ferramentas/IncluirRamoView.cs
new file mode 100644
index 0000000..27d4df5
--- /dev/null
+++ b/Decompiler/Gestor.Application.Views.Ferramentas/IncluirRamoView.cs
@@ -0,0 +1,137 @@
+using System;
+using System.CodeDom.Compiler;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Diagnostics;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Controls.Primitives;
+using System.Windows.Input;
+using System.Windows.Markup;
+using System.Windows.Threading;
+using Gestor.Application.Actions;
+using Gestor.Application.ViewModels.Ferramentas;
+using Gestor.Application.Views.Generic;
+using Gestor.Model.Domain.Seguros;
+
+namespace Gestor.Application.Views.Ferramentas;
+
+public class IncluirRamoView : BaseUserControl, IComponentConnector
+{
+ public IncluirRamoViewModel ViewModel;
+
+ internal DataGrid RamoGrid;
+
+ private bool _contentLoaded;
+
+ public IncluirRamoView(List<Ramo> ramos)
+ {
+ ViewModel = new IncluirRamoViewModel(ramos);
+ ((FrameworkElement)this).DataContext = ViewModel;
+ InitializeComponent();
+ Dispatcher dispatcher = ((DispatcherObject)this).Dispatcher;
+ if (dispatcher != null)
+ {
+ dispatcher.BeginInvoke((DispatcherPriority)7, (Delegate)new Action(ContentLoad));
+ }
+ }
+
+ private void ContentLoad()
+ {
+ //IL_000d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0017: Expected O, but got Unknown
+ ((Selector)RamoGrid).SelectionChanged += new SelectionChangedEventHandler(RamoGrid_OnSelectionChanged);
+ }
+
+ private void RamoGrid_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ //IL_0001: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0007: Expected O, but got Unknown
+ //IL_0031: Unknown result type (might be due to invalid IL or missing references)
+ //IL_003b: Expected O, but got Unknown
+ DataGrid val = (DataGrid)sender;
+ if (val == null || ((Selector)val).SelectedIndex >= 0)
+ {
+ ViewModel.SelectedRamo = (Ramo)((val != null) ? ((ItemsControl)val).Items[((Selector)val).SelectedIndex] : null);
+ }
+ }
+
+ private void Pesquisar_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.Pesquisar();
+ }
+
+ private void Incluir_OnClick(object sender, RoutedEventArgs e)
+ {
+ if (ViewModel.SelectedRamo != null)
+ {
+ ViewModel.AdicionarRamo = ViewModel.SelectedRamo;
+ Gestor.Application.Actions.Actions.CloseHoster?.Invoke();
+ }
+ }
+
+ private void Pesquisar_OnPreviewKeyDown(object sender, KeyEventArgs e)
+ {
+ //IL_0001: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0007: Invalid comparison between Unknown and I4
+ if ((int)e.Key == 6)
+ {
+ ViewModel.Pesquisar();
+ }
+ }
+
+ [DebuggerNonUserCode]
+ [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
+ public void InitializeComponent()
+ {
+ if (!_contentLoaded)
+ {
+ _contentLoaded = true;
+ Uri uri = new Uri("/Gestor.Application;component/views/ferramentas/incluirramoview.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_001b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0027: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0031: Expected O, but got Unknown
+ //IL_0033: Unknown result type (might be due to invalid IL or missing references)
+ //IL_003f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0049: Expected O, but got Unknown
+ //IL_004c: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0056: Expected O, but got Unknown
+ //IL_0058: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0064: Unknown result type (might be due to invalid IL or missing references)
+ //IL_006e: Expected O, but got Unknown
+ switch (connectionId)
+ {
+ case 1:
+ ((UIElement)(TextBox)target).PreviewKeyDown += new KeyEventHandler(Pesquisar_OnPreviewKeyDown);
+ break;
+ case 2:
+ ((ButtonBase)(Button)target).Click += new RoutedEventHandler(Pesquisar_OnClick);
+ break;
+ case 3:
+ RamoGrid = (DataGrid)target;
+ break;
+ case 4:
+ ((ButtonBase)(Button)target).Click += new RoutedEventHandler(Incluir_OnClick);
+ break;
+ default:
+ _contentLoaded = true;
+ break;
+ }
+ }
+}
diff --git a/Decompiler/Gestor.Application.Views.Ferramentas/IncluirSeguradoraView.cs b/Decompiler/Gestor.Application.Views.Ferramentas/IncluirSeguradoraView.cs
new file mode 100644
index 0000000..90c0bd8
--- /dev/null
+++ b/Decompiler/Gestor.Application.Views.Ferramentas/IncluirSeguradoraView.cs
@@ -0,0 +1,137 @@
+using System;
+using System.CodeDom.Compiler;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Diagnostics;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Controls.Primitives;
+using System.Windows.Input;
+using System.Windows.Markup;
+using System.Windows.Threading;
+using Gestor.Application.Actions;
+using Gestor.Application.ViewModels.Ferramentas;
+using Gestor.Application.Views.Generic;
+using Gestor.Model.Domain.Seguros;
+
+namespace Gestor.Application.Views.Ferramentas;
+
+public class IncluirSeguradoraView : BaseUserControl, IComponentConnector
+{
+ public IncluirSeguradoraViewModel ViewModel;
+
+ internal DataGrid SeguradoraGrid;
+
+ private bool _contentLoaded;
+
+ public IncluirSeguradoraView(List<Seguradora> seguradoras)
+ {
+ ViewModel = new IncluirSeguradoraViewModel(seguradoras);
+ ((FrameworkElement)this).DataContext = ViewModel;
+ InitializeComponent();
+ Dispatcher dispatcher = ((DispatcherObject)this).Dispatcher;
+ if (dispatcher != null)
+ {
+ dispatcher.BeginInvoke((DispatcherPriority)7, (Delegate)new Action(ContentLoad));
+ }
+ }
+
+ private void ContentLoad()
+ {
+ //IL_000d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0017: Expected O, but got Unknown
+ ((Selector)SeguradoraGrid).SelectionChanged += new SelectionChangedEventHandler(SeguradoraGrid_OnSelectionChanged);
+ }
+
+ private void SeguradoraGrid_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ //IL_0001: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0007: Expected O, but got Unknown
+ //IL_0031: Unknown result type (might be due to invalid IL or missing references)
+ //IL_003b: Expected O, but got Unknown
+ DataGrid val = (DataGrid)sender;
+ if (val == null || ((Selector)val).SelectedIndex >= 0)
+ {
+ ViewModel.SelectedSeguradora = (Seguradora)((val != null) ? ((ItemsControl)val).Items[((Selector)val).SelectedIndex] : null);
+ }
+ }
+
+ private void Pesquisar_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.Pesquisar();
+ }
+
+ private void Incluir_OnClick(object sender, RoutedEventArgs e)
+ {
+ if (ViewModel.SelectedSeguradora != null)
+ {
+ ViewModel.AdicionarSeguradora = ViewModel.SelectedSeguradora;
+ Gestor.Application.Actions.Actions.CloseHoster?.Invoke();
+ }
+ }
+
+ private void Pesquisar_OnPreviewKeyDown(object sender, KeyEventArgs e)
+ {
+ //IL_0001: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0007: Invalid comparison between Unknown and I4
+ if ((int)e.Key == 6)
+ {
+ ViewModel.Pesquisar();
+ }
+ }
+
+ [DebuggerNonUserCode]
+ [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
+ public void InitializeComponent()
+ {
+ if (!_contentLoaded)
+ {
+ _contentLoaded = true;
+ Uri uri = new Uri("/Gestor.Application;component/views/ferramentas/incluirseguradoraview.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_001b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0027: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0031: Expected O, but got Unknown
+ //IL_0033: Unknown result type (might be due to invalid IL or missing references)
+ //IL_003f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0049: Expected O, but got Unknown
+ //IL_004c: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0056: Expected O, but got Unknown
+ //IL_0058: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0064: Unknown result type (might be due to invalid IL or missing references)
+ //IL_006e: Expected O, but got Unknown
+ switch (connectionId)
+ {
+ case 1:
+ ((UIElement)(TextBox)target).PreviewKeyDown += new KeyEventHandler(Pesquisar_OnPreviewKeyDown);
+ break;
+ case 2:
+ ((ButtonBase)(Button)target).Click += new RoutedEventHandler(Pesquisar_OnClick);
+ break;
+ case 3:
+ SeguradoraGrid = (DataGrid)target;
+ break;
+ case 4:
+ ((ButtonBase)(Button)target).Click += new RoutedEventHandler(Incluir_OnClick);
+ break;
+ default:
+ _contentLoaded = true;
+ break;
+ }
+ }
+}
diff --git a/Decompiler/Gestor.Application.Views.Ferramentas/MalaDiretaView.cs b/Decompiler/Gestor.Application.Views.Ferramentas/MalaDiretaView.cs
new file mode 100644
index 0000000..ca1fce5
--- /dev/null
+++ b/Decompiler/Gestor.Application.Views.Ferramentas/MalaDiretaView.cs
@@ -0,0 +1,308 @@
+using System;
+using System.CodeDom.Compiler;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Diagnostics;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Controls.Primitives;
+using System.Windows.Data;
+using System.Windows.Markup;
+using Gestor.Application.Componentes;
+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.Common;
+using Gestor.Model.Domain.Generic;
+using Gestor.Model.Domain.MalaDireta;
+using MaterialDesignThemes.Wpf;
+using Xceed.Wpf.AvalonDock.Controls;
+
+namespace Gestor.Application.Views.Ferramentas;
+
+public class MalaDiretaView : BaseUserControl, IComponentConnector, IStyleConnector
+{
+ internal MalaDiretaViewModel ViewModel;
+
+ internal DataGrid Grid;
+
+ internal TextBox AssuntoBox;
+
+ internal WebEditor WebEditor;
+
+ private bool _contentLoaded;
+
+ public MalaDiretaView(List<MalaDireta> maladireta, string assunto = null, string corpo = null, FiltroArquivoDigital filtro = null)
+ {
+ ViewModel = new MalaDiretaViewModel(filtro);
+ ((FrameworkElement)this).DataContext = ViewModel;
+ InitializeComponent();
+ CarregarClientes(maladireta, assunto, corpo);
+ }
+
+ private async void CarregarClientes(List<MalaDireta> maladireta, string assunto = null, string corpo = null)
+ {
+ ViewModel.IsEnabled = false;
+ await ViewModel.CarregarEmails(maladireta, assunto, corpo);
+ ViewModel.IsEnabled = true;
+ }
+
+ private void Fechar_OnClick(object sender, RoutedEventArgs e)
+ {
+ Funcoes.Destroy<HosterWindow>("ENVIO DE E-MAIL");
+ }
+
+ private async void Enviar_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.IsEnabled = false;
+ ViewModel.Corpo = WebEditor.GetHtml();
+ await ViewModel.Enviar();
+ ViewModel.IsEnabled = true;
+ }
+
+ private void CheckBox_Checked(object sender, RoutedEventArgs e)
+ {
+ ViewModel.Selecionar();
+ }
+
+ private void AnexarArquivos_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.Anexar();
+ }
+
+ 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<ListBox>((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 Incluir_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.Incluir();
+ ((UIElement)AssuntoBox).Focus();
+ }
+
+ private void Alterar_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.Alterar(alterar: true);
+ }
+
+ private async void Salvar_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.Loading(isLoading: true);
+ ViewModel.Corpo = WebEditor.GetHtml();
+ List<KeyValuePair<string, string>> list = await ViewModel.Salvar();
+ 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 VariaveisBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ //IL_0001: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0007: Expected O, but got Unknown
+ //IL_001b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0020: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0027: Unknown result type (might be due to invalid IL or missing references)
+ ComboBox val = (ComboBox)sender;
+ if (((Selector)val).SelectedItem != null)
+ {
+ VariaveisMalaDireta variaveisMalaDireta = ((ComboVariavel)((Selector)val).SelectedItem).VariaveisMalaDireta;
+ WebEditor.InsertText(ValidationHelper.GetEntity((Enum)(object)variaveisMalaDireta) + " ");
+ ((Selector)val).SelectedItem = null;
+ }
+ }
+
+ private void ModelosBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ //IL_0001: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0007: Expected O, but got Unknown
+ ComboBox val = (ComboBox)sender;
+ if (((Selector)val).SelectedItem != null)
+ {
+ ModeloMalaDireta modeloMalaDireta = ((ComboModelo)((Selector)val).SelectedItem).ModeloMalaDireta;
+ if (((DomainBase)modeloMalaDireta).Id != 0L)
+ {
+ ViewModel.Corpo = modeloMalaDireta.Corpo;
+ ViewModel.Assunto = modeloMalaDireta.Assunto;
+ }
+ }
+ }
+
+ private async void AdicionarCC_OnClick(object sender, RoutedEventArgs e)
+ {
+ Button box = (Button)sender;
+ if (((FrameworkElement)box).DataContext != null)
+ {
+ ((UIElement)WebEditor).Visibility = (Visibility)2;
+ Copia val = await ViewModel.ShowCopiaDialog(((MalaDireta)((FrameworkElement)box).DataContext).Copia);
+ ((UIElement)WebEditor).Visibility = (Visibility)0;
+ if (val != null)
+ {
+ ((MalaDireta)((FrameworkElement)box).DataContext).Copia = val;
+ }
+ }
+ }
+
+ [DebuggerNonUserCode]
+ [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
+ public void InitializeComponent()
+ {
+ if (!_contentLoaded)
+ {
+ _contentLoaded = true;
+ Uri uri = new Uri("/Gestor.Application;component/views/ferramentas/maladiretaview.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_004f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0059: Expected O, but got Unknown
+ //IL_005b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0067: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0071: Expected O, but got Unknown
+ //IL_0073: Unknown result type (might be due to invalid IL or missing references)
+ //IL_007f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0089: Expected O, but got Unknown
+ //IL_008b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0097: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00a1: Expected O, but got Unknown
+ //IL_00a3: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00af: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00b9: Expected O, but got Unknown
+ //IL_00bb: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00c7: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00d1: Expected O, but got Unknown
+ //IL_00d3: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00df: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00e9: Expected O, but got Unknown
+ //IL_00ec: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00f6: Expected O, but got Unknown
+ //IL_00f8: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0104: Unknown result type (might be due to invalid IL or missing references)
+ //IL_010e: Expected O, but got Unknown
+ //IL_011d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0129: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0133: Expected O, but got Unknown
+ //IL_0135: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0141: Unknown result type (might be due to invalid IL or missing references)
+ //IL_014b: Expected O, but got Unknown
+ //IL_014d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0159: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0163: Expected O, but got Unknown
+ switch (connectionId)
+ {
+ case 1:
+ Grid = (DataGrid)target;
+ break;
+ case 4:
+ ((MenuItem)target).Click += new RoutedEventHandler(Incluir_OnClick);
+ break;
+ case 5:
+ ((MenuItem)target).Click += new RoutedEventHandler(Alterar_OnClick);
+ break;
+ case 6:
+ ((MenuItem)target).Click += new RoutedEventHandler(Salvar_OnClick);
+ break;
+ case 7:
+ ((MenuItem)target).Click += new RoutedEventHandler(Cancelar_OnClick);
+ break;
+ case 8:
+ ((MenuItem)target).Click += new RoutedEventHandler(Excluir_OnClick);
+ break;
+ case 9:
+ ((Selector)(ComboBox)target).SelectionChanged += new SelectionChangedEventHandler(ModelosBox_SelectionChanged);
+ break;
+ case 10:
+ AssuntoBox = (TextBox)target;
+ break;
+ case 11:
+ ((Selector)(ComboBox)target).SelectionChanged += new SelectionChangedEventHandler(VariaveisBox_SelectionChanged);
+ break;
+ case 13:
+ WebEditor = (WebEditor)target;
+ break;
+ case 14:
+ ((MenuItem)target).Click += new RoutedEventHandler(AnexarArquivos_OnClick);
+ break;
+ case 15:
+ ((MenuItem)target).Click += new RoutedEventHandler(Enviar_OnClick);
+ break;
+ case 16:
+ ((MenuItem)target).Click += new RoutedEventHandler(Fechar_OnClick);
+ break;
+ default:
+ _contentLoaded = true;
+ break;
+ }
+ }
+
+ [DebuggerNonUserCode]
+ [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ void IStyleConnector.Connect(int connectionId, object target)
+ {
+ //IL_000f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_001b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0025: Expected O, but got Unknown
+ //IL_0026: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0032: Unknown result type (might be due to invalid IL or missing references)
+ //IL_003c: Expected O, but got Unknown
+ //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_0056: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0062: Unknown result type (might be due to invalid IL or missing references)
+ //IL_006c: Expected O, but got Unknown
+ switch (connectionId)
+ {
+ case 2:
+ ((ToggleButton)(CheckBox)target).Checked += new RoutedEventHandler(CheckBox_Checked);
+ ((ToggleButton)(CheckBox)target).Unchecked += new RoutedEventHandler(CheckBox_Checked);
+ break;
+ case 3:
+ ((ButtonBase)(Button)target).Click += new RoutedEventHandler(AdicionarCC_OnClick);
+ break;
+ case 12:
+ ((Chip)target).DeleteClick += new RoutedEventHandler(DeleteArquivo_OnDeleteClick);
+ break;
+ }
+ }
+}
diff --git a/Decompiler/Gestor.Application.Views.Ferramentas/ManutencaoPagamentosView.cs b/Decompiler/Gestor.Application.Views.Ferramentas/ManutencaoPagamentosView.cs
new file mode 100644
index 0000000..a6d7bb5
--- /dev/null
+++ b/Decompiler/Gestor.Application.Views.Ferramentas/ManutencaoPagamentosView.cs
@@ -0,0 +1,266 @@
+using System;
+using System.CodeDom.Compiler;
+using System.ComponentModel;
+using System.Diagnostics;
+using System.Linq;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Controls.Primitives;
+using System.Windows.Data;
+using System.Windows.Input;
+using System.Windows.Markup;
+using Gestor.Application.Servicos.Seguros;
+using Gestor.Application.ViewModels.Ferramentas;
+using Gestor.Application.Views.Generic;
+using Gestor.Application.Views.Seguros;
+using Gestor.Model.Common;
+using Gestor.Model.Domain.Ferramentas;
+using Gestor.Model.Domain.Relatorios;
+using Gestor.Model.Domain.Seguros;
+using MaterialDesignThemes.Wpf;
+using Xceed.Wpf.AvalonDock.Controls;
+
+namespace Gestor.Application.Views.Ferramentas;
+
+public class ManutencaoPagamentosView : BaseUserControl, IComponentConnector, IStyleConnector
+{
+ private bool _contentLoaded;
+
+ public ManutencaoPagamentosViewModel ViewModel { get; set; }
+
+ public ManutencaoPagamentosView()
+ {
+ ((FrameworkElement)this).Tag = "MANUTENÇÃO DE PAGAMENTOS";
+ ViewModel = new ManutencaoPagamentosViewModel();
+ ((FrameworkElement)this).DataContext = ViewModel;
+ InitializeComponent();
+ }
+
+ private async void Buscar_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.Loading(isLoading: true);
+ await ViewModel.Buscar();
+ ViewModel.Loading(isLoading: false);
+ }
+
+ private async void Excluir_OnClick(object sender, RoutedEventArgs e)
+ {
+ if (ViewModel.Pagamentos == null || ViewModel.Pagamentos.All((ManutencaoPagamentos x) => !x.Selecionado))
+ {
+ await ViewModel.ShowMessage("NECESSÁRIO SELECIONAR OS PAGAMENTOS QUE DESEJA EXCLUIR ANTES DE PROSSEGUIR");
+ return;
+ }
+ bool? flag = await ViewModel.ShowSenha("DESEJA REALMENTE EXCLUIR OS PAGAMENTOS SELECIONADOS?\nESSE PROCEDIMENTO É IRREVERSÍVEL.");
+ if (flag.HasValue)
+ {
+ if (!flag.GetValueOrDefault())
+ {
+ await ViewModel.ShowMessage("SENHA INVÁLIDA");
+ return;
+ }
+ ViewModel.Loading(isLoading: true);
+ await ViewModel.Excluir();
+ ViewModel.Loading(isLoading: false);
+ }
+ }
+
+ private void CheckBox_Checked(object sender, RoutedEventArgs e)
+ {
+ ViewModel.Selecionar(value: true);
+ }
+
+ private async void Apolice_OnClick(object sender, RoutedEventArgs e)
+ {
+ Button val = (Button)sender;
+ ManutencaoPagamentos manutencao = (ManutencaoPagamentos)((FrameworkElement)val).DataContext;
+ if (manutencao != null)
+ {
+ ViewModel.Loading(isLoading: true);
+ long idDocumento = manutencao.IdDocumento;
+ Documento val2 = await new ApoliceServico().BuscarApoliceAsync(idDocumento);
+ if (val2 == null)
+ {
+ ViewModel.Loading(isLoading: false);
+ return;
+ }
+ ((Window)new HosterWindow((ContentControl)(object)new ApoliceView(val2, lockInsert: true, invoke: false, (AcessoApolice)1, manutencao.IdParcela), "CADASTRO DE APÓLICES - " + val2.Controle.Cliente.Nome)).Show();
+ ViewModel.Loading(isLoading: false);
+ }
+ }
+
+ private void UnCheckBox_Checked(object sender, RoutedEventArgs e)
+ {
+ ViewModel.Selecionar(value: false);
+ }
+
+ private void FecharFiltro_OnClick(object sender, RoutedEventArgs e)
+ {
+ //IL_000c: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0012: Invalid comparison between Unknown and I4
+ ViewModel.VisibilityFiltroPersonalizado = (Visibility)(((int)ViewModel.VisibilityFiltroPersonalizado != 2) ? 2 : 0);
+ }
+
+ private void AdicionarFiltro_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.AdcionarFiltroPersonalizado();
+ }
+
+ private void ExcluirFiltro_OnClick(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<ListBox>((DependencyObject)(object)val);
+ FiltroPersonalizado val3 = (FiltroPersonalizado)((ItemsControl)val2).Items[((CollectionView)((ItemsControl)val2).Items).IndexOf(((FrameworkElement)val).DataContext)];
+ if (val3 != null)
+ {
+ ViewModel.FiltroPersonalizadoSelecionado.Remove(val3);
+ ViewModel.PesquisaPersonalizada();
+ }
+ }
+ }
+
+ [DebuggerNonUserCode]
+ [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
+ public void InitializeComponent()
+ {
+ if (!_contentLoaded)
+ {
+ _contentLoaded = true;
+ Uri uri = new Uri("/Gestor.Application;component/views/ferramentas/manutencaopagamentosview.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_0032: Unknown result type (might be due to invalid IL or missing references)
+ //IL_003e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0048: Expected O, but got Unknown
+ //IL_0049: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0055: Unknown result type (might be due to invalid IL or missing references)
+ //IL_005f: Expected O, but got Unknown
+ //IL_0060: Unknown result type (might be due to invalid IL or missing references)
+ //IL_006c: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0076: Expected O, but got Unknown
+ //IL_0078: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0084: Unknown result type (might be due to invalid IL or missing references)
+ //IL_008e: Expected O, but got Unknown
+ //IL_008f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_009b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00a5: Expected O, but got Unknown
+ //IL_00a6: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00b2: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00bc: Expected O, but got Unknown
+ //IL_00be: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00ca: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00d4: Expected O, but got Unknown
+ //IL_00d6: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00e2: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00ec: Expected O, but got Unknown
+ //IL_00ee: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00fa: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0104: Expected O, but got Unknown
+ //IL_0106: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0112: Unknown result type (might be due to invalid IL or missing references)
+ //IL_011c: Expected O, but got Unknown
+ //IL_011e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_012a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0134: Expected O, but got Unknown
+ //IL_0135: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0141: Unknown result type (might be due to invalid IL or missing references)
+ //IL_014b: Expected O, but got Unknown
+ //IL_014d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0159: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0163: Expected O, but got Unknown
+ //IL_0164: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0170: Unknown result type (might be due to invalid IL or missing references)
+ //IL_017a: Expected O, but got Unknown
+ //IL_017c: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0188: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0192: Expected O, but got Unknown
+ switch (connectionId)
+ {
+ case 1:
+ ((UIElement)(DatePicker)target).LostKeyboardFocus += new KeyboardFocusChangedEventHandler(base.DatePicker_OnLostKeyboardFocus);
+ ((UIElement)(DatePicker)target).PreviewKeyDown += new KeyEventHandler(base.DatePicker_PreviewKeyDown);
+ ((Control)(DatePicker)target).MouseDoubleClick += new MouseButtonEventHandler(base.DataAtual_OnDoubleClick);
+ break;
+ case 2:
+ ((UIElement)(DatePicker)target).LostKeyboardFocus += new KeyboardFocusChangedEventHandler(base.DatePicker_OnLostKeyboardFocus);
+ ((UIElement)(DatePicker)target).PreviewKeyDown += new KeyEventHandler(base.DatePicker_PreviewKeyDown);
+ ((Control)(DatePicker)target).MouseDoubleClick += new MouseButtonEventHandler(base.DataAtual_OnDoubleClick);
+ break;
+ case 3:
+ ((ButtonBase)(Button)target).Click += new RoutedEventHandler(Buscar_OnClick);
+ break;
+ case 4:
+ ((MenuItem)target).Click += new RoutedEventHandler(Excluir_OnClick);
+ break;
+ case 5:
+ ((MenuItem)target).Click += new RoutedEventHandler(FecharFiltro_OnClick);
+ break;
+ case 6:
+ ((ButtonBase)(Button)target).Click += new RoutedEventHandler(FecharFiltro_OnClick);
+ break;
+ case 7:
+ ((UIElement)(DatePicker)target).LostKeyboardFocus += new KeyboardFocusChangedEventHandler(base.DatePicker_OnLostKeyboardFocus);
+ ((Control)(DatePicker)target).MouseDoubleClick += new MouseButtonEventHandler(base.DataAtual_OnDoubleClick);
+ break;
+ case 8:
+ ((UIElement)(DatePicker)target).LostKeyboardFocus += new KeyboardFocusChangedEventHandler(base.DatePicker_OnLostKeyboardFocus);
+ ((Control)(DatePicker)target).MouseDoubleClick += new MouseButtonEventHandler(base.DataAtual_OnDoubleClick);
+ break;
+ case 9:
+ ((ButtonBase)(Button)target).Click += new RoutedEventHandler(AdicionarFiltro_OnClick);
+ break;
+ default:
+ _contentLoaded = true;
+ break;
+ }
+ }
+
+ [DebuggerNonUserCode]
+ [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ void IStyleConnector.Connect(int connectionId, object target)
+ {
+ //IL_0017: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0023: Unknown result type (might be due to invalid IL or missing references)
+ //IL_002d: Expected O, but got Unknown
+ //IL_002f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_003b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0045: Expected O, but got Unknown
+ //IL_0046: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0052: Unknown result type (might be due to invalid IL or missing references)
+ //IL_005c: Expected O, but got Unknown
+ //IL_005e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_006a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0074: Expected O, but got Unknown
+ switch (connectionId)
+ {
+ case 10:
+ ((Chip)target).DeleteClick += new RoutedEventHandler(ExcluirFiltro_OnClick);
+ break;
+ case 11:
+ ((ToggleButton)(CheckBox)target).Checked += new RoutedEventHandler(CheckBox_Checked);
+ ((ToggleButton)(CheckBox)target).Unchecked += new RoutedEventHandler(UnCheckBox_Checked);
+ break;
+ case 12:
+ ((ButtonBase)(Button)target).Click += new RoutedEventHandler(Apolice_OnClick);
+ break;
+ }
+ }
+}
diff --git a/Decompiler/Gestor.Application.Views.Ferramentas/NotaFiscalView.cs b/Decompiler/Gestor.Application.Views.Ferramentas/NotaFiscalView.cs
new file mode 100644
index 0000000..662d646
--- /dev/null
+++ b/Decompiler/Gestor.Application.Views.Ferramentas/NotaFiscalView.cs
@@ -0,0 +1,352 @@
+using System;
+using System.CodeDom.Compiler;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Diagnostics;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Input;
+using System.Windows.Markup;
+using System.Windows.Threading;
+using CurrencyTextBoxControl;
+using Gestor.Application.Drawers;
+using Gestor.Application.Helpers;
+using Gestor.Application.Servicos;
+using Gestor.Application.ViewModels.Ferramentas;
+using Gestor.Application.Views.Generic;
+using Gestor.Common.Validation;
+using Gestor.Model.Common;
+using Gestor.Model.Domain.Configuracoes;
+using Gestor.Model.Domain.Ferramentas;
+using Gestor.Model.Domain.Generic;
+
+namespace Gestor.Application.Views.Ferramentas;
+
+public class NotaFiscalView : BaseUserControl, IComponentConnector
+{
+ public NotaFiscalViewModel ViewModel;
+
+ internal DataGrid NotaFiscalGrid;
+
+ internal DataGridTextColumn NomeField;
+
+ internal DataGridTextColumn ApelidoField;
+
+ internal MenuItem MaisOpcoesButton;
+
+ internal DatePicker DataPicker;
+
+ internal CurrencyTextBox ValorBrutoBox;
+
+ internal CurrencyTextBox ValorIssBox;
+
+ internal CurrencyTextBox ValorIrBox;
+
+ internal CurrencyTextBox ValorLiquidoBox;
+
+ internal TextBox ExtratoBox;
+
+ internal ComboBox EstipulanteBox;
+
+ private bool _contentLoaded;
+
+ public NotaFiscalView()
+ {
+ ((FrameworkElement)this).Tag = "CADASTRO DE NOTA FISCAL";
+ ViewModel = new NotaFiscalViewModel();
+ ((FrameworkElement)this).DataContext = ViewModel;
+ InitializeComponent();
+ Dispatcher dispatcher = ((DispatcherObject)this).Dispatcher;
+ if (dispatcher != null)
+ {
+ dispatcher.BeginInvoke((DispatcherPriority)7, (Delegate)new Action(ContentLoad));
+ }
+ }
+
+ private void ContentLoad()
+ {
+ ((DataGridColumn)NomeField).Visibility = (Visibility)(ViewModel.Apelido ? 2 : 0);
+ ((DataGridColumn)ApelidoField).Visibility = (Visibility)((!ViewModel.Apelido) ? 2 : 0);
+ }
+
+ private void AutoCompleteBoxNotaFiscal_Populating(object sender, PopulatingEventArgs e)
+ {
+ e.Cancel = true;
+ ViewModel.Filtrar(ValidationHelper.RemoveDiacritics(e.Parameter.Trim())).ContinueWith(delegate(Task<List<NotaFiscal>> 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.FiltrarNotaFiscal("");
+ }
+ }
+
+ private void Incluir_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.Incluir();
+ }
+
+ 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.CancelNotaFiscal = (NotaFiscal)((DomainBase)ViewModel.SelectedNotaFiscal).Clone();
+ ViewModel.Alterar(alterar: true);
+ ((DomainBase)ViewModel.SelectedNotaFiscal).Initialize();
+ }
+
+ private async void Salvar_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.Loading(isLoading: true);
+ DataPicker.SelectedDate = Convert.ToDateTime(DataPicker.Text);
+ 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)55, ((DomainBase)ViewModel.SelectedNotaFiscal).Id);
+ }
+
+ private async void UIElement_OnLostFocus(object sender, RoutedEventArgs e)
+ {
+ if (ViewModel.SelectedNotaFiscal != null && ViewModel.EnableFields)
+ {
+ bool flag = Recursos.Configuracoes.Any((ConfiguracaoSistema x) => (int)x.Configuracao == 5);
+ if (((FrameworkElement)(CurrencyTextBox)sender).Name == "ValorBrutoBox" && flag && ValorIssBox.Number == 0m)
+ {
+ decimal num = await ViewModel.BuscarImposto();
+ ValorIssBox.Number = ValorBrutoBox.Number * num;
+ }
+ ValorLiquidoBox.Number = ValorBrutoBox.Number - ValorIssBox.Number - ValorIrBox.Number;
+ }
+ }
+
+ private async void Importar_Click(object sender, RoutedEventArgs e)
+ {
+ ViewModel.IsEnabled = false;
+ ViewModel.EnableMenu = false;
+ ViewModel.EnableMainMenu = false;
+ List<NotaFiscal> list = await ViewModel.ShowExtratoComissaoDialog(ViewModel.Seguradoras);
+ if (list != null)
+ {
+ await ViewModel.SalvarLote(list);
+ }
+ ViewModel.EnableMainMenu = true;
+ ViewModel.EnableMenu = true;
+ ViewModel.IsEnabled = true;
+ }
+
+ private async void ArquivoDigital_OnClick(object sender, RoutedEventArgs e)
+ {
+ if (!new PermissaoArquivoDigitalServico().BuscarPermissao(Recursos.Usuario, (TipoArquivoDigital)16).Consultar)
+ {
+ await ViewModel.ShowMessage("VOCÊ NÃO POSSUI PERMISSÃO PARA ACESSAR\nARQUIVO DIGITAL DE " + ValidationHelper.GetDescription((Enum)(object)(TipoArquivoDigital)16) + ".");
+ return;
+ }
+ FiltroArquivoDigital filtro = new FiltroArquivoDigital
+ {
+ Id = ((DomainBase)ViewModel.SelectedNotaFiscal).Id,
+ Tipo = (TipoArquivoDigital)16,
+ Parente = ViewModel.SelectedNotaFiscal
+ };
+ ViewModel.ShowDrawer(new ArquivoDigitalDrawer(filtro), 0, close: false);
+ }
+
+ [DebuggerNonUserCode]
+ [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
+ public void InitializeComponent()
+ {
+ if (!_contentLoaded)
+ {
+ _contentLoaded = true;
+ Uri uri = new Uri("/Gestor.Application;component/views/ferramentas/notafiscalview.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_005e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_006a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0074: Expected O, but got Unknown
+ //IL_0075: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0081: Unknown result type (might be due to invalid IL or missing references)
+ //IL_008b: Expected O, but got Unknown
+ //IL_008e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0098: Expected O, but got Unknown
+ //IL_009b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00a5: Expected O, but got Unknown
+ //IL_00a8: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00b2: Expected O, but got Unknown
+ //IL_00b4: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00c0: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00ca: Expected O, but got Unknown
+ //IL_00cc: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00d8: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00e2: Expected O, but got Unknown
+ //IL_00e4: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00f0: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00fa: Expected O, but got Unknown
+ //IL_00fc: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0108: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0112: Expected O, but got Unknown
+ //IL_0114: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0120: Unknown result type (might be due to invalid IL or missing references)
+ //IL_012a: Expected O, but got Unknown
+ //IL_012c: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0138: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0142: Expected O, but got Unknown
+ //IL_0145: Unknown result type (might be due to invalid IL or missing references)
+ //IL_014f: Expected O, but got Unknown
+ //IL_0151: Unknown result type (might be due to invalid IL or missing references)
+ //IL_015d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0167: Expected O, but got Unknown
+ //IL_0169: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0175: Unknown result type (might be due to invalid IL or missing references)
+ //IL_017f: Expected O, but got Unknown
+ //IL_0182: Unknown result type (might be due to invalid IL or missing references)
+ //IL_018c: Expected O, but got Unknown
+ //IL_0199: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01a3: Expected O, but got Unknown
+ //IL_01b0: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01ba: Expected O, but got Unknown
+ //IL_01c7: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01d1: Expected O, but got Unknown
+ //IL_01d4: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01de: Expected O, but got Unknown
+ //IL_01eb: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01f5: Expected O, but got Unknown
+ //IL_01f8: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0202: Expected O, but got Unknown
+ //IL_020f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0219: Expected O, but got Unknown
+ //IL_021c: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0226: Expected O, but got Unknown
+ //IL_0233: Unknown result type (might be due to invalid IL or missing references)
+ //IL_023d: Expected O, but got Unknown
+ //IL_0240: Unknown result type (might be due to invalid IL or missing references)
+ //IL_024a: Expected O, but got Unknown
+ //IL_0257: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0261: Expected O, but got Unknown
+ //IL_0264: Unknown result type (might be due to invalid IL or missing references)
+ //IL_026e: Expected O, but got Unknown
+ //IL_0271: Unknown result type (might be due to invalid IL or missing references)
+ //IL_027b: Expected O, but got Unknown
+ switch (connectionId)
+ {
+ case 1:
+ ((AutoCompleteBox)target).Populating += new PopulatingEventHandler(AutoCompleteBoxNotaFiscal_Populating);
+ ((AutoCompleteBox)target).TextChanged += new RoutedEventHandler(AutoCompleteBox_OnTextChanged);
+ break;
+ case 2:
+ NotaFiscalGrid = (DataGrid)target;
+ break;
+ case 3:
+ NomeField = (DataGridTextColumn)target;
+ break;
+ case 4:
+ ApelidoField = (DataGridTextColumn)target;
+ break;
+ case 5:
+ ((MenuItem)target).Click += new RoutedEventHandler(Incluir_OnClick);
+ break;
+ case 6:
+ ((MenuItem)target).Click += new RoutedEventHandler(Importar_Click);
+ break;
+ case 7:
+ ((MenuItem)target).Click += new RoutedEventHandler(Alterar_OnClick);
+ break;
+ case 8:
+ ((MenuItem)target).Click += new RoutedEventHandler(Salvar_OnClick);
+ break;
+ case 9:
+ ((MenuItem)target).Click += new RoutedEventHandler(Cancelar_OnClick);
+ break;
+ case 10:
+ ((MenuItem)target).Click += new RoutedEventHandler(Excluir_OnClick);
+ break;
+ case 11:
+ MaisOpcoesButton = (MenuItem)target;
+ break;
+ case 12:
+ ((MenuItem)target).Click += new RoutedEventHandler(AbrirLog_OnClick);
+ break;
+ case 13:
+ ((MenuItem)target).Click += new RoutedEventHandler(ArquivoDigital_OnClick);
+ break;
+ case 14:
+ DataPicker = (DatePicker)target;
+ ((UIElement)DataPicker).LostKeyboardFocus += new KeyboardFocusChangedEventHandler(base.DatePicker_OnLostKeyboardFocus);
+ ((Control)DataPicker).MouseDoubleClick += new MouseButtonEventHandler(base.DataAtual_OnDoubleClick);
+ ((UIElement)DataPicker).PreviewKeyDown += new KeyEventHandler(base.DatePicker_PreviewKeyDown);
+ break;
+ case 15:
+ ValorBrutoBox = (CurrencyTextBox)target;
+ ((UIElement)ValorBrutoBox).LostFocus += new RoutedEventHandler(UIElement_OnLostFocus);
+ break;
+ case 16:
+ ValorIssBox = (CurrencyTextBox)target;
+ ((UIElement)ValorIssBox).LostFocus += new RoutedEventHandler(UIElement_OnLostFocus);
+ break;
+ case 17:
+ ValorIrBox = (CurrencyTextBox)target;
+ ((UIElement)ValorIrBox).LostFocus += new RoutedEventHandler(UIElement_OnLostFocus);
+ break;
+ case 18:
+ ValorLiquidoBox = (CurrencyTextBox)target;
+ ((UIElement)ValorLiquidoBox).LostFocus += new RoutedEventHandler(UIElement_OnLostFocus);
+ break;
+ case 19:
+ ExtratoBox = (TextBox)target;
+ break;
+ case 20:
+ EstipulanteBox = (ComboBox)target;
+ break;
+ default:
+ _contentLoaded = true;
+ break;
+ }
+ }
+}
diff --git a/Decompiler/Gestor.Application.Views.Ferramentas/ProdutoView.cs b/Decompiler/Gestor.Application.Views.Ferramentas/ProdutoView.cs
new file mode 100644
index 0000000..c976d02
--- /dev/null
+++ b/Decompiler/Gestor.Application.Views.Ferramentas/ProdutoView.cs
@@ -0,0 +1,256 @@
+using System;
+using System.CodeDom.Compiler;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Diagnostics;
+using System.Runtime.CompilerServices;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Controls.Primitives;
+using System.Windows.Input;
+using System.Windows.Markup;
+using System.Windows.Threading;
+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.Generic;
+using Gestor.Model.Domain.Seguros;
+
+namespace Gestor.Application.Views.Ferramentas;
+
+public class ProdutoView : BaseUserControl, IComponentConnector
+{
+ [Serializable]
+ [CompilerGenerated]
+ private sealed class _003C_003Ec
+ {
+ public static readonly _003C_003Ec _003C_003E9 = new _003C_003Ec();
+
+ public static MouseButtonEventHandler _003C_003E9__2_0;
+
+ internal void _003CContentLoad_003Eb__2_0(object sender, MouseButtonEventArgs args)
+ {
+ }
+ }
+
+ public ProdutoViewModel ViewModel;
+
+ internal DataGrid ProdutoGrid;
+
+ internal MenuItem MaisOpcoesButton;
+
+ internal ToggleButton AtivoBox;
+
+ private bool _contentLoaded;
+
+ public ProdutoView()
+ {
+ ((FrameworkElement)this).Tag = "CADASTRO DE PRODUTOS";
+ ViewModel = new ProdutoViewModel();
+ ((FrameworkElement)this).DataContext = ViewModel;
+ InitializeComponent();
+ Dispatcher dispatcher = ((DispatcherObject)this).Dispatcher;
+ if (dispatcher != null)
+ {
+ dispatcher.BeginInvoke((DispatcherPriority)7, (Delegate)new Action(ContentLoad));
+ }
+ }
+
+ private void ContentLoad()
+ {
+ //IL_0019: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0023: Expected O, but got Unknown
+ //IL_003d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0042: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0048: Expected O, but got Unknown
+ ((Selector)ProdutoGrid).SelectedIndex = 0;
+ ((Selector)ProdutoGrid).SelectionChanged += new SelectionChangedEventHandler(EstipulanteGrid_OnSelectionChanged);
+ DataGrid produtoGrid = ProdutoGrid;
+ object obj = _003C_003Ec._003C_003E9__2_0;
+ if (obj == null)
+ {
+ MouseButtonEventHandler val = delegate
+ {
+ };
+ _003C_003Ec._003C_003E9__2_0 = val;
+ obj = (object)val;
+ }
+ ((Control)produtoGrid).MouseDoubleClick += (MouseButtonEventHandler)obj;
+ }
+
+ private void Incluir_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.Incluir();
+ ValidarTela();
+ }
+
+ private void Cancelar_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.CancelarAlteracao();
+ }
+
+ 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 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.CancelProduto = (Produto)((DomainBase)ViewModel.SelectedProduto).Clone();
+ ViewModel.Alterar(alterar: true);
+ ValidarTela();
+ ((DomainBase)ViewModel.SelectedProduto).Initialize();
+ }
+
+ private void AutoCompleteBoxProduto_Populating(object sender, PopulatingEventArgs e)
+ {
+ e.Cancel = true;
+ ViewModel.Filtrar(ValidationHelper.RemoveDiacritics(e.Parameter.Trim())).ContinueWith(delegate(Task<List<Produto>> 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.FiltrarProduto("");
+ }
+ }
+
+ private void EstipulanteGrid_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ //IL_0001: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0007: Expected O, but got Unknown
+ //IL_0031: Unknown result type (might be due to invalid IL or missing references)
+ //IL_003b: Expected O, but got Unknown
+ DataGrid val = (DataGrid)sender;
+ if (val == null || ((Selector)val).SelectedIndex >= 0)
+ {
+ ViewModel.SelecionaProduto((Produto)((val != null) ? ((ItemsControl)val).Items[((Selector)val).SelectedIndex] : null));
+ }
+ }
+
+ private void AbrirLog_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.AbrirLog((TipoTela)10, ((DomainBase)ViewModel.SelectedProduto).Id);
+ }
+
+ private void ValidarTela()
+ {
+ if (ViewModel.SelectedProduto != null)
+ {
+ List<KeyValuePair<string, string>> errorMessages = ViewModel.SelectedProduto.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/produtoview.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_0032: Unknown result type (might be due to invalid IL or missing references)
+ //IL_003e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0048: Expected O, but got Unknown
+ //IL_0049: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0055: Unknown result type (might be due to invalid IL or missing references)
+ //IL_005f: Expected O, but got Unknown
+ //IL_0062: Unknown result type (might be due to invalid IL or missing references)
+ //IL_006c: Expected O, but got Unknown
+ //IL_006e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_007a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0084: Expected O, but got Unknown
+ //IL_0086: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0092: Unknown result type (might be due to invalid IL or missing references)
+ //IL_009c: Expected O, but got Unknown
+ //IL_009e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00aa: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00b4: Expected O, but got Unknown
+ //IL_00b6: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00c2: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00cc: Expected O, but got Unknown
+ //IL_00cf: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00d9: Expected O, but got Unknown
+ //IL_00db: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00e7: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00f1: Expected O, but got Unknown
+ //IL_00f4: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00fe: Expected O, but got Unknown
+ switch (connectionId)
+ {
+ case 1:
+ ((AutoCompleteBox)target).Populating += new PopulatingEventHandler(AutoCompleteBoxProduto_Populating);
+ ((AutoCompleteBox)target).TextChanged += new RoutedEventHandler(AutoCompleteBox_OnTextChanged);
+ break;
+ case 2:
+ ProdutoGrid = (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:
+ MaisOpcoesButton = (MenuItem)target;
+ break;
+ case 8:
+ ((MenuItem)target).Click += new RoutedEventHandler(AbrirLog_OnClick);
+ break;
+ case 9:
+ AtivoBox = (ToggleButton)target;
+ break;
+ default:
+ _contentLoaded = true;
+ break;
+ }
+ }
+}
diff --git a/Decompiler/Gestor.Application.Views.Ferramentas/ProtocoloDocumentosView.cs b/Decompiler/Gestor.Application.Views.Ferramentas/ProtocoloDocumentosView.cs
new file mode 100644
index 0000000..23b871e
--- /dev/null
+++ b/Decompiler/Gestor.Application.Views.Ferramentas/ProtocoloDocumentosView.cs
@@ -0,0 +1,196 @@
+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.ViewModels.Ferramentas;
+using Gestor.Common.Validation;
+using Gestor.Model.Common;
+using Gestor.Model.Domain.Seguros;
+
+namespace Gestor.Application.Views.Ferramentas;
+
+public class ProtocoloDocumentosView : UserControl, IComponentConnector, IStyleConnector
+{
+ private bool _contentLoaded;
+
+ public ProtocoloDocumentosViewModel ViewModel { get; set; }
+
+ public ProtocoloDocumentosView()
+ {
+ ((FrameworkElement)this).Tag = "PROTOCOLOS E ETIQUETAS";
+ ViewModel = new ProtocoloDocumentosViewModel();
+ ((FrameworkElement)this).DataContext = ViewModel;
+ InitializeComponent();
+ }
+
+ private void AutoCompleteClienteBox_Populating(object sender, PopulatingEventArgs e)
+ {
+ if (e.Parameter.Length < 3)
+ {
+ return;
+ }
+ e.Cancel = true;
+ ViewModel.BuscarCliente(ValidationHelper.RemoveDiacritics(e.Parameter.Trim()), null, (TipoFiltroCliente)2).ContinueWith(delegate(Task<List<Cliente>> 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 AdicionarProtocolo_OnClick(object sender, RoutedEventArgs e)
+ {
+ //IL_0020: Unknown result type (might be due to invalid IL or missing references)
+ //IL_002a: Expected O, but got Unknown
+ Button val = (Button)((sender is Button) ? sender : null);
+ if (val != null && ((FrameworkElement)val).DataContext != null)
+ {
+ ViewModel.AdicionarProtocolo((Documento)((FrameworkElement)val).DataContext);
+ }
+ }
+
+ private void AdicionarEtiqueta_OnClick(object sender, RoutedEventArgs e)
+ {
+ //IL_0020: Unknown result type (might be due to invalid IL or missing references)
+ //IL_002a: Expected O, but got Unknown
+ Button val = (Button)((sender is Button) ? sender : null);
+ if (val != null && ((FrameworkElement)val).DataContext != null)
+ {
+ ViewModel.AdicionarEtiqueta((Documento)((FrameworkElement)val).DataContext);
+ }
+ }
+
+ private void AdicionarEtiquetaCliente_OnClick(object sender, RoutedEventArgs e)
+ {
+ MenuItem val = (MenuItem)((sender is MenuItem) ? sender : null);
+ if (val != null && ((FrameworkElement)val).DataContext != null)
+ {
+ ViewModel.AdicionarEtiquetaCliente();
+ }
+ }
+
+ private void Remover_OnClick(object sender, RoutedEventArgs e)
+ {
+ Button val = (Button)((sender is Button) ? sender : null);
+ if (val != null && ((FrameworkElement)val).DataContext != null)
+ {
+ ViewModel.Remover((ProtocoloEtiqueta)((FrameworkElement)val).DataContext);
+ }
+ }
+
+ private void ImprimirProtocolo_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.Imprimir((TipoProtocoloEtiqueta)0);
+ }
+
+ private void ImprimirEtiqueta_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.Imprimir((TipoProtocoloEtiqueta)1);
+ }
+
+ private void AdicionarEtiquetaCorretora_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.AdicionarEtiquetaCorretora();
+ }
+
+ [DebuggerNonUserCode]
+ [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
+ public void InitializeComponent()
+ {
+ if (!_contentLoaded)
+ {
+ _contentLoaded = true;
+ Uri uri = new Uri("/Gestor.Application;component/views/ferramentas/protocolodocumentosview.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_001f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_002b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0035: Expected O, but got Unknown
+ //IL_0037: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0043: Unknown result type (might be due to invalid IL or missing references)
+ //IL_004d: Expected O, but got Unknown
+ //IL_004f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_005b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0065: Expected O, but got Unknown
+ //IL_0067: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0073: Unknown result type (might be due to invalid IL or missing references)
+ //IL_007d: Expected O, but got Unknown
+ //IL_007f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_008b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0095: Expected O, but got Unknown
+ switch (connectionId)
+ {
+ case 1:
+ ((AutoCompleteBox)target).Populating += new PopulatingEventHandler(AutoCompleteClienteBox_Populating);
+ break;
+ case 2:
+ ((MenuItem)target).Click += new RoutedEventHandler(AdicionarEtiquetaCliente_OnClick);
+ break;
+ case 3:
+ ((MenuItem)target).Click += new RoutedEventHandler(AdicionarEtiquetaCorretora_OnClick);
+ break;
+ case 4:
+ ((MenuItem)target).Click += new RoutedEventHandler(ImprimirProtocolo_OnClick);
+ break;
+ case 5:
+ ((MenuItem)target).Click += new RoutedEventHandler(ImprimirEtiqueta_OnClick);
+ break;
+ default:
+ _contentLoaded = true;
+ break;
+ }
+ }
+
+ [DebuggerNonUserCode]
+ [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ void IStyleConnector.Connect(int connectionId, object target)
+ {
+ //IL_0016: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0022: Unknown result type (might be due to invalid IL or missing references)
+ //IL_002c: Expected O, but got Unknown
+ //IL_002e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_003a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0044: Expected O, but got Unknown
+ //IL_0046: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0052: Unknown result type (might be due to invalid IL or missing references)
+ //IL_005c: Expected O, but got Unknown
+ switch (connectionId)
+ {
+ case 6:
+ ((ButtonBase)(Button)target).Click += new RoutedEventHandler(AdicionarProtocolo_OnClick);
+ break;
+ case 7:
+ ((ButtonBase)(Button)target).Click += new RoutedEventHandler(AdicionarEtiqueta_OnClick);
+ break;
+ case 8:
+ ((ButtonBase)(Button)target).Click += new RoutedEventHandler(Remover_OnClick);
+ break;
+ }
+ }
+}
diff --git a/Decompiler/Gestor.Application.Views.Ferramentas/QualificacaoView.cs b/Decompiler/Gestor.Application.Views.Ferramentas/QualificacaoView.cs
new file mode 100644
index 0000000..c61b7f6
--- /dev/null
+++ b/Decompiler/Gestor.Application.Views.Ferramentas/QualificacaoView.cs
@@ -0,0 +1,210 @@
+using System;
+using System.CodeDom.Compiler;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Diagnostics;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Markup;
+using CurrencyTextBoxControl;
+using Gestor.Application.Helpers;
+using Gestor.Application.ViewModels.Ferramentas;
+using Gestor.Application.Views.Generic;
+using Gestor.Model.Common;
+using Gestor.Model.Domain.Generic;
+using Gestor.Model.Domain.Seguros;
+
+namespace Gestor.Application.Views.Ferramentas;
+
+public class QualificacaoView : BaseUserControl, IComponentConnector
+{
+ public QualificacaoViewModel ViewModel;
+
+ internal MenuItem MaisOpcoesButton;
+
+ private bool _contentLoaded;
+
+ public QualificacaoView()
+ {
+ ((FrameworkElement)this).Tag = "CADASTRO DE QUALIFICAÇÃO";
+ ViewModel = new QualificacaoViewModel();
+ ((FrameworkElement)this).DataContext = ViewModel;
+ InitializeComponent();
+ }
+
+ private void Cancelar_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.CancelarAlteracao();
+ }
+
+ 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 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.CancelQualificacao = (Qualificacao)((DomainBase)ViewModel.SelectedQualificacao).Clone();
+ ViewModel.Alterar(alterar: true);
+ ((DomainBase)ViewModel.SelectedQualificacao).Initialize();
+ }
+
+ private void AbrirLog_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.AbrirLog((TipoTela)48, ((DomainBase)ViewModel.SelectedQualificacao).Id);
+ }
+
+ private void CurrencyTextBox_OnLostFocus(object sender, RoutedEventArgs e)
+ {
+ if (ViewModel.SelectedQualificacao.Liquido2 <= ViewModel.SelectedQualificacao.Liquido1)
+ {
+ ViewModel.SelectedQualificacao.Liquido2 = ViewModel.SelectedQualificacao.Liquido1 + 0.01m;
+ }
+ if (ViewModel.SelectedQualificacao.Liquido3 <= ViewModel.SelectedQualificacao.Liquido2)
+ {
+ ViewModel.SelectedQualificacao.Liquido3 = ViewModel.SelectedQualificacao.Liquido2 + 0.01m;
+ }
+ if (ViewModel.SelectedQualificacao.Comissao2 <= ViewModel.SelectedQualificacao.Comissao1)
+ {
+ ViewModel.SelectedQualificacao.Comissao2 = ViewModel.SelectedQualificacao.Comissao1 + 0.01m;
+ }
+ if (ViewModel.SelectedQualificacao.Comissao3 <= ViewModel.SelectedQualificacao.Comissao2)
+ {
+ ViewModel.SelectedQualificacao.Comissao3 = ViewModel.SelectedQualificacao.Comissao2 + 0.01m;
+ }
+ if (ViewModel.SelectedQualificacao.Resultado2 <= ViewModel.SelectedQualificacao.Resultado1)
+ {
+ ViewModel.SelectedQualificacao.Resultado2 = ViewModel.SelectedQualificacao.Resultado1 + 0.01m;
+ }
+ if (ViewModel.SelectedQualificacao.Resultado3 <= ViewModel.SelectedQualificacao.Resultado2)
+ {
+ ViewModel.SelectedQualificacao.Resultado3 = ViewModel.SelectedQualificacao.Resultado2 + 0.01m;
+ }
+ ViewModel.SelectedQualificacao = ViewModel.SelectedQualificacao;
+ }
+
+ [DebuggerNonUserCode]
+ [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
+ public void InitializeComponent()
+ {
+ if (!_contentLoaded)
+ {
+ _contentLoaded = true;
+ Uri uri = new Uri("/Gestor.Application;component/views/ferramentas/qualificacaoview.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_0046: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0052: Unknown result type (might be due to invalid IL or missing references)
+ //IL_005c: Expected O, but got Unknown
+ //IL_005e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_006a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0074: Expected O, but got Unknown
+ //IL_0076: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0082: Unknown result type (might be due to invalid IL or missing references)
+ //IL_008c: Expected O, but got Unknown
+ //IL_008f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0099: Expected O, but got Unknown
+ //IL_009b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00a7: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00b1: Expected O, but got Unknown
+ //IL_00b3: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00bf: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00c9: Expected O, but got Unknown
+ //IL_00cb: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00d7: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00e1: Expected O, but got Unknown
+ //IL_00e3: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00ef: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00f9: Expected O, but got Unknown
+ //IL_00fb: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0107: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0111: Expected O, but got Unknown
+ //IL_0113: Unknown result type (might be due to invalid IL or missing references)
+ //IL_011f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0129: Expected O, but got Unknown
+ //IL_012b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0137: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0141: Expected O, but got Unknown
+ //IL_0143: Unknown result type (might be due to invalid IL or missing references)
+ //IL_014f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0159: Expected O, but got Unknown
+ //IL_015b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0167: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0171: Expected O, but got Unknown
+ //IL_0173: Unknown result type (might be due to invalid IL or missing references)
+ //IL_017f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0189: Expected O, but got Unknown
+ switch (connectionId)
+ {
+ case 1:
+ ((MenuItem)target).Click += new RoutedEventHandler(Alterar_OnClick);
+ break;
+ case 2:
+ ((MenuItem)target).Click += new RoutedEventHandler(Salvar_OnClick);
+ break;
+ case 3:
+ ((MenuItem)target).Click += new RoutedEventHandler(Cancelar_OnClick);
+ break;
+ case 4:
+ MaisOpcoesButton = (MenuItem)target;
+ break;
+ case 5:
+ ((MenuItem)target).Click += new RoutedEventHandler(AbrirLog_OnClick);
+ break;
+ case 6:
+ ((UIElement)(CurrencyTextBox)target).LostFocus += new RoutedEventHandler(CurrencyTextBox_OnLostFocus);
+ break;
+ case 7:
+ ((UIElement)(CurrencyTextBox)target).LostFocus += new RoutedEventHandler(CurrencyTextBox_OnLostFocus);
+ break;
+ case 8:
+ ((UIElement)(CurrencyTextBox)target).LostFocus += new RoutedEventHandler(CurrencyTextBox_OnLostFocus);
+ break;
+ case 9:
+ ((UIElement)(CurrencyTextBox)target).LostFocus += new RoutedEventHandler(CurrencyTextBox_OnLostFocus);
+ break;
+ case 10:
+ ((UIElement)(CurrencyTextBox)target).LostFocus += new RoutedEventHandler(CurrencyTextBox_OnLostFocus);
+ break;
+ case 11:
+ ((UIElement)(CurrencyTextBox)target).LostFocus += new RoutedEventHandler(CurrencyTextBox_OnLostFocus);
+ break;
+ case 12:
+ ((UIElement)(CurrencyTextBox)target).LostFocus += new RoutedEventHandler(CurrencyTextBox_OnLostFocus);
+ break;
+ case 13:
+ ((UIElement)(CurrencyTextBox)target).LostFocus += new RoutedEventHandler(CurrencyTextBox_OnLostFocus);
+ break;
+ case 14:
+ ((UIElement)(CurrencyTextBox)target).LostFocus += new RoutedEventHandler(CurrencyTextBox_OnLostFocus);
+ break;
+ default:
+ _contentLoaded = true;
+ break;
+ }
+ }
+}
diff --git a/Decompiler/Gestor.Application.Views.Ferramentas/RamoView.cs b/Decompiler/Gestor.Application.Views.Ferramentas/RamoView.cs
new file mode 100644
index 0000000..6d45419
--- /dev/null
+++ b/Decompiler/Gestor.Application.Views.Ferramentas/RamoView.cs
@@ -0,0 +1,351 @@
+using System;
+using System.CodeDom.Compiler;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Diagnostics;
+using System.Linq;
+using System.Runtime.CompilerServices;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Controls.Primitives;
+using System.Windows.Input;
+using System.Windows.Markup;
+using System.Windows.Threading;
+using CurrencyTextBoxControl;
+using Gestor.Application.Drawers;
+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.Configuracoes;
+using Gestor.Model.Domain.Generic;
+using Gestor.Model.Domain.Seguros;
+
+namespace Gestor.Application.Views.Ferramentas;
+
+public class RamoView : BaseUserControl, IComponentConnector
+{
+ [Serializable]
+ [CompilerGenerated]
+ private sealed class _003C_003Ec
+ {
+ public static readonly _003C_003Ec _003C_003E9 = new _003C_003Ec();
+
+ public static MouseButtonEventHandler _003C_003E9__5_0;
+
+ public static MouseButtonEventHandler _003C_003E9__5_1;
+
+ public static Func<ConfiguracaoSistema, bool> _003C_003E9__16_0;
+
+ internal void _003CContentLoad_003Eb__5_0(object sender, MouseButtonEventArgs args)
+ {
+ }
+
+ internal void _003CContentLoad_003Eb__5_1(object sender, MouseButtonEventArgs args)
+ {
+ }
+
+ internal bool _003CImpostos_OnClick_003Eb__16_0(ConfiguracaoSistema x)
+ {
+ //IL_0001: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0007: Invalid comparison between Unknown and I4
+ return (int)x.Configuracao != 5;
+ }
+ }
+
+ internal DataGrid RamoGrid;
+
+ internal MenuItem MaisOpcoesButton;
+
+ internal TextBox ApoliceBox;
+
+ internal CurrencyTextBox IofBox;
+
+ internal DataGrid CoberturaGrid;
+
+ private bool _contentLoaded;
+
+ public RamoViewModel ViewModel { get; set; }
+
+ public RamoView()
+ {
+ ((FrameworkElement)this).Tag = "RAMOS";
+ ViewModel = new RamoViewModel();
+ ((FrameworkElement)this).DataContext = ViewModel;
+ InitializeComponent();
+ Dispatcher dispatcher = ((DispatcherObject)this).Dispatcher;
+ if (dispatcher != null)
+ {
+ dispatcher.BeginInvoke((DispatcherPriority)7, (Delegate)new Action(ContentLoad));
+ }
+ ((FrameworkElement)RamoGrid).DataContext = ((FrameworkElement)this).DataContext;
+ ((FrameworkElement)CoberturaGrid).DataContext = ((FrameworkElement)this).DataContext;
+ }
+
+ private void ContentLoad()
+ {
+ //IL_0019: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0023: Expected O, but got Unknown
+ //IL_003d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0042: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0048: Expected O, but got Unknown
+ //IL_0067: Unknown result type (might be due to invalid IL or missing references)
+ //IL_006c: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0072: Expected O, but got Unknown
+ ((Selector)RamoGrid).SelectedIndex = 0;
+ ((Selector)RamoGrid).SelectionChanged += new SelectionChangedEventHandler(RamoGrid_OnSelectionChanged);
+ DataGrid ramoGrid = RamoGrid;
+ object obj = _003C_003Ec._003C_003E9__5_0;
+ if (obj == null)
+ {
+ MouseButtonEventHandler val = delegate
+ {
+ };
+ _003C_003Ec._003C_003E9__5_0 = val;
+ obj = (object)val;
+ }
+ ((Control)ramoGrid).MouseDoubleClick += (MouseButtonEventHandler)obj;
+ DataGrid coberturaGrid = CoberturaGrid;
+ object obj2 = _003C_003Ec._003C_003E9__5_1;
+ if (obj2 == null)
+ {
+ MouseButtonEventHandler val2 = delegate
+ {
+ };
+ _003C_003Ec._003C_003E9__5_1 = val2;
+ obj2 = (object)val2;
+ }
+ ((Control)coberturaGrid).MouseDoubleClick += (MouseButtonEventHandler)obj2;
+ }
+
+ 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 AutoCompleteBoxRamo_Populating(object sender, PopulatingEventArgs e)
+ {
+ e.Cancel = true;
+ ViewModel.Filtrar(ValidationHelper.RemoveDiacritics(e.Parameter.Trim())).ContinueWith(delegate(Task<List<Ramo>> 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 AutoCompleteBoxCobertura_Populating(object sender, PopulatingEventArgs e)
+ {
+ e.Cancel = true;
+ ViewModel.FiltrarCobertura(ValidationHelper.RemoveDiacritics(e.Parameter.Trim())).ContinueWith(delegate(Task<List<CoberturaPadrao>> 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.FiltrarRamo("");
+ }
+ }
+
+ private void AutoCompleteBoxCobertura_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.FiltrarCoberturaRamo("");
+ }
+ }
+
+ 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.CancelRamo = (Ramo)((DomainBase)ViewModel.SelectedRamo).Clone();
+ ViewModel.Alterar(alterar: true);
+ }
+
+ private void RamoGrid_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ //IL_0001: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0007: Expected O, but got Unknown
+ //IL_0031: Unknown result type (might be due to invalid IL or missing references)
+ //IL_003b: Expected O, but got Unknown
+ DataGrid val = (DataGrid)sender;
+ if (val == null || ((Selector)val).SelectedIndex >= 0)
+ {
+ ViewModel.SelecionaRamo((Ramo)((val != null) ? ((ItemsControl)val).Items[((Selector)val).SelectedIndex] : null));
+ }
+ }
+
+ private void AbrirLog_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.AbrirLog((TipoTela)12, ((DomainBase)ViewModel.SelectedRamo).Id);
+ }
+
+ private void Incluir_OnClick(object sender, RoutedEventArgs e)
+ {
+ IncluirRamoView incluirRamoView = new IncluirRamoView(ViewModel.Ramos);
+ ((Window)new HosterWindow((ContentControl)(object)incluirRamoView, "INCLUIR RAMO", 500.0, 600.0)).ShowDialog();
+ if (incluirRamoView.ViewModel.AdicionarRamo != null)
+ {
+ ViewModel.Incluir(incluirRamoView.ViewModel.AdicionarRamo);
+ }
+ }
+
+ private async void Impostos_OnClick(object sender, RoutedEventArgs e)
+ {
+ if (Recursos.Configuracoes.All((ConfiguracaoSistema x) => (int)x.Configuracao != 5))
+ {
+ await ViewModel.ShowMessage("RECURSO NÃO HABILITADO, ACESSE AS CONFIGURAÇÕES DENTRO DO CADASTRO DE EMPRESAS E FILIAIS PARA HABILITAR O RECURSO.");
+ }
+ else if (await ViewModel.VerificarPermissao((TipoTela)56))
+ {
+ ViewModel.ShowDrawer(new ImpostoDrawer(1, ((DomainBase)ViewModel.SelectedRamo).Id), 0, close: false);
+ }
+ }
+
+ [DebuggerNonUserCode]
+ [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
+ public void InitializeComponent()
+ {
+ if (!_contentLoaded)
+ {
+ _contentLoaded = true;
+ Uri uri = new Uri("/Gestor.Application;component/views/ferramentas/ramoview.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_007e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_008a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0094: Expected O, but got Unknown
+ //IL_0096: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00a2: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00ac: Expected O, but got Unknown
+ //IL_00ae: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00ba: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00c4: Expected O, but got Unknown
+ //IL_00c6: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00d2: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00dc: Expected O, but got Unknown
+ //IL_00df: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00e9: Expected O, but got Unknown
+ //IL_00eb: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00f7: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0101: Expected O, but got Unknown
+ //IL_0103: Unknown result type (might be due to invalid IL or missing references)
+ //IL_010f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0119: Expected O, but got Unknown
+ //IL_011c: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0126: Expected O, but got Unknown
+ //IL_0129: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0133: Expected O, but got Unknown
+ //IL_0135: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0141: Unknown result type (might be due to invalid IL or missing references)
+ //IL_014b: Expected O, but got Unknown
+ //IL_014c: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0158: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0162: Expected O, but got Unknown
+ //IL_0165: Unknown result type (might be due to invalid IL or missing references)
+ //IL_016f: Expected O, but got Unknown
+ switch (connectionId)
+ {
+ case 1:
+ ((AutoCompleteBox)target).Populating += new PopulatingEventHandler(AutoCompleteBoxRamo_Populating);
+ ((AutoCompleteBox)target).TextChanged += new RoutedEventHandler(AutoCompleteBox_OnTextChanged);
+ break;
+ case 2:
+ RamoGrid = (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:
+ MaisOpcoesButton = (MenuItem)target;
+ break;
+ case 8:
+ ((MenuItem)target).Click += new RoutedEventHandler(AbrirLog_OnClick);
+ break;
+ case 9:
+ ((MenuItem)target).Click += new RoutedEventHandler(Impostos_OnClick);
+ break;
+ case 10:
+ ApoliceBox = (TextBox)target;
+ break;
+ case 11:
+ IofBox = (CurrencyTextBox)target;
+ break;
+ case 12:
+ ((AutoCompleteBox)target).Populating += new PopulatingEventHandler(AutoCompleteBoxCobertura_Populating);
+ ((AutoCompleteBox)target).TextChanged += new RoutedEventHandler(AutoCompleteBoxCobertura_OnTextChanged);
+ break;
+ case 13:
+ CoberturaGrid = (DataGrid)target;
+ break;
+ default:
+ _contentLoaded = true;
+ break;
+ }
+ }
+}
diff --git a/Decompiler/Gestor.Application.Views.Ferramentas/ReciboView.cs b/Decompiler/Gestor.Application.Views.Ferramentas/ReciboView.cs
new file mode 100644
index 0000000..268adc7
--- /dev/null
+++ b/Decompiler/Gestor.Application.Views.Ferramentas/ReciboView.cs
@@ -0,0 +1,334 @@
+using System;
+using System.CodeDom.Compiler;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Diagnostics;
+using System.Runtime.CompilerServices;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Controls.Primitives;
+using System.Windows.Input;
+using System.Windows.Markup;
+using System.Windows.Threading;
+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;
+using Gestor.Model.Domain.Seguros;
+
+namespace Gestor.Application.Views.Ferramentas;
+
+public class ReciboView : BaseUserControl, IComponentConnector
+{
+ [Serializable]
+ [CompilerGenerated]
+ private sealed class _003C_003Ec
+ {
+ public static readonly _003C_003Ec _003C_003E9 = new _003C_003Ec();
+
+ public static MouseButtonEventHandler _003C_003E9__2_0;
+
+ internal void _003CContentLoad_003Eb__2_0(object sender, MouseButtonEventArgs args)
+ {
+ }
+ }
+
+ public ReciboViewModel ViewModel;
+
+ internal DataGrid ReciboGrid;
+
+ internal MenuItem MaisOpcoesButton;
+
+ private bool _contentLoaded;
+
+ public ReciboView()
+ {
+ ((FrameworkElement)this).Tag = "CADASTRO DE RECIBOS";
+ ViewModel = new ReciboViewModel();
+ ((FrameworkElement)this).DataContext = ViewModel;
+ InitializeComponent();
+ Dispatcher dispatcher = ((DispatcherObject)this).Dispatcher;
+ if (dispatcher != null)
+ {
+ dispatcher.BeginInvoke((DispatcherPriority)7, (Delegate)new Action(ContentLoad));
+ }
+ }
+
+ private void ContentLoad()
+ {
+ //IL_0019: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0023: Expected O, but got Unknown
+ //IL_003d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0042: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0048: Expected O, but got Unknown
+ ((Selector)ReciboGrid).SelectedIndex = 0;
+ ((Selector)ReciboGrid).SelectionChanged += new SelectionChangedEventHandler(ReciboGrid_OnSelectionChanged);
+ DataGrid reciboGrid = ReciboGrid;
+ object obj = _003C_003Ec._003C_003E9__2_0;
+ if (obj == null)
+ {
+ MouseButtonEventHandler val = delegate
+ {
+ };
+ _003C_003Ec._003C_003E9__2_0 = val;
+ obj = (object)val;
+ }
+ ((Control)reciboGrid).MouseDoubleClick += (MouseButtonEventHandler)obj;
+ }
+
+ 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)
+ {
+ ReciboGrid.ScrollIntoView(((Selector)ReciboGrid).SelectedItem);
+ }
+ else
+ {
+ await ViewModel.ShowMessage(list, ViewModel.ErroCamposInvalidos, "OK");
+ }
+ }
+
+ 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.CancelRecibo = (Recibo)((DomainBase)ViewModel.SelectedRecibo).Clone();
+ ViewModel.Alterar(alterar: true);
+ ValidarTela();
+ ((DomainBase)ViewModel.SelectedRecibo).Initialize();
+ }
+
+ private void Cancelar_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.CancelarAlteracao();
+ }
+
+ private void AutoCompleteBoxRecibo_Populating(object sender, PopulatingEventArgs e)
+ {
+ e.Cancel = true;
+ ViewModel.Filtrar(ValidationHelper.RemoveDiacritics(e.Parameter.Trim())).ContinueWith(delegate(Task<List<Recibo>> 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.FiltrarRecibo("");
+ }
+ }
+
+ private void ReciboGrid_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ //IL_0001: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0007: Expected O, but got Unknown
+ //IL_0031: Unknown result type (might be due to invalid IL or missing references)
+ //IL_003b: Expected O, but got Unknown
+ DataGrid val = (DataGrid)sender;
+ if (val == null || ((Selector)val).SelectedIndex >= 0)
+ {
+ ViewModel.SelectedRecibo = (Recibo)((val != null) ? ((ItemsControl)val).Items[((Selector)val).SelectedIndex] : null);
+ }
+ }
+
+ private void AbrirLog_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.AbrirLog((TipoTela)42, ((DomainBase)ViewModel.SelectedRecibo).Id);
+ }
+
+ private void Incluir_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.Incluir();
+ ValidarTela();
+ }
+
+ private void Excluir_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.Excluir();
+ }
+
+ private void Imprimir_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.Print();
+ }
+
+ private void AutoCompleteBox_Populating(object sender, PopulatingEventArgs e)
+ {
+ if (e.Parameter.Trim().Length < 3)
+ {
+ return;
+ }
+ e.Cancel = true;
+ ViewModel.BuscarClienteEmpresa(ValidationHelper.RemoveDiacritics(e.Parameter.Trim())).ContinueWith(delegate(Task<List<Cliente>> 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 ValidarTela()
+ {
+ if (ViewModel.SelectedRecibo != null)
+ {
+ List<KeyValuePair<string, string>> errorMessages = ViewModel.SelectedRecibo.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/reciboview.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_004a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0056: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0060: Expected O, but got Unknown
+ //IL_0061: Unknown result type (might be due to invalid IL or missing references)
+ //IL_006d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0077: Expected O, but got Unknown
+ //IL_007a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0084: Expected O, but got Unknown
+ //IL_0086: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0092: Unknown result type (might be due to invalid IL or missing references)
+ //IL_009c: Expected O, but got Unknown
+ //IL_009e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00aa: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00b4: Expected O, but got Unknown
+ //IL_00b6: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00c2: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00cc: Expected O, but got Unknown
+ //IL_00ce: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00da: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00e4: Expected O, but got Unknown
+ //IL_00e6: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00f2: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00fc: Expected O, but got Unknown
+ //IL_00ff: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0109: Expected O, but got Unknown
+ //IL_010b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0117: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0121: Expected O, but got Unknown
+ //IL_0123: Unknown result type (might be due to invalid IL or missing references)
+ //IL_012f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0139: Expected O, but got Unknown
+ //IL_013b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0147: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0151: Expected O, but got Unknown
+ //IL_0152: Unknown result type (might be due to invalid IL or missing references)
+ //IL_015e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0168: Expected O, but got Unknown
+ //IL_0169: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0175: Unknown result type (might be due to invalid IL or missing references)
+ //IL_017f: Expected O, but got Unknown
+ //IL_0181: Unknown result type (might be due to invalid IL or missing references)
+ //IL_018d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0197: Expected O, but got Unknown
+ //IL_0199: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01a6: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01b0: Expected O, but got Unknown
+ //IL_01b2: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01be: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01c8: Expected O, but got Unknown
+ //IL_01ca: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01d7: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01e1: Expected O, but got Unknown
+ switch (connectionId)
+ {
+ case 1:
+ ((AutoCompleteBox)target).Populating += new PopulatingEventHandler(AutoCompleteBoxRecibo_Populating);
+ ((AutoCompleteBox)target).TextChanged += new RoutedEventHandler(AutoCompleteBox_OnTextChanged);
+ break;
+ case 2:
+ ReciboGrid = (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(Imprimir_OnClick);
+ break;
+ case 10:
+ ((MenuItem)target).Click += new RoutedEventHandler(AbrirLog_OnClick);
+ break;
+ case 11:
+ ((UIElement)(DatePicker)target).LostKeyboardFocus += new KeyboardFocusChangedEventHandler(base.DatePicker_OnLostKeyboardFocus);
+ ((UIElement)(DatePicker)target).PreviewKeyDown += new KeyEventHandler(base.DatePicker_PreviewKeyDown);
+ ((Control)(DatePicker)target).MouseDoubleClick += new MouseButtonEventHandler(base.DataAtual_OnDoubleClick);
+ break;
+ case 12:
+ ((AutoCompleteBox)target).Populating += new PopulatingEventHandler(AutoCompleteBox_Populating);
+ break;
+ case 13:
+ ((UIElement)(TextBox)target).LostKeyboardFocus += new KeyboardFocusChangedEventHandler(FormatarDocumento);
+ break;
+ case 14:
+ ((AutoCompleteBox)target).Populating += new PopulatingEventHandler(AutoCompleteBox_Populating);
+ break;
+ case 15:
+ ((UIElement)(TextBox)target).LostKeyboardFocus += new KeyboardFocusChangedEventHandler(FormatarDocumento);
+ break;
+ default:
+ _contentLoaded = true;
+ break;
+ }
+ }
+}
diff --git a/Decompiler/Gestor.Application.Views.Ferramentas/SeguradoraView.cs b/Decompiler/Gestor.Application.Views.Ferramentas/SeguradoraView.cs
new file mode 100644
index 0000000..34e7151
--- /dev/null
+++ b/Decompiler/Gestor.Application.Views.Ferramentas/SeguradoraView.cs
@@ -0,0 +1,665 @@
+using System;
+using System.CodeDom.Compiler;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Diagnostics;
+using System.Linq;
+using System.Runtime.CompilerServices;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Controls.Primitives;
+using System.Windows.Data;
+using System.Windows.Input;
+using System.Windows.Markup;
+using System.Windows.Threading;
+using CurrencyTextBoxControl;
+using Gestor.Application.Drawers;
+using Gestor.Application.Helpers;
+using Gestor.Application.Servicos;
+using Gestor.Application.ViewModels.Ferramentas;
+using Gestor.Application.Views.Generic;
+using Gestor.Common.Helpers;
+using Gestor.Common.Validation;
+using Gestor.Model.Common;
+using Gestor.Model.Domain.Configuracoes;
+using Gestor.Model.Domain.Generic;
+using Gestor.Model.Domain.Seguros;
+using Xceed.Wpf.AvalonDock.Controls;
+
+namespace Gestor.Application.Views.Ferramentas;
+
+public class SeguradoraView : BaseUserControl, IComponentConnector, IStyleConnector
+{
+ [Serializable]
+ [CompilerGenerated]
+ private sealed class _003C_003Ec
+ {
+ public static readonly _003C_003Ec _003C_003E9 = new _003C_003Ec();
+
+ public static MouseButtonEventHandler _003C_003E9__2_0;
+
+ public static Func<ConfiguracaoSistema, bool> _003C_003E9__21_0;
+
+ internal void _003CContentLoad_003Eb__2_0(object sender, MouseButtonEventArgs args)
+ {
+ }
+
+ internal bool _003CImpostos_OnClick_003Eb__21_0(ConfiguracaoSistema x)
+ {
+ //IL_0001: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0007: Invalid comparison between Unknown and I4
+ return (int)x.Configuracao != 5;
+ }
+ }
+
+ public SeguradoraViewModel ViewModel;
+
+ internal DataGrid SeguradoraGrid;
+
+ internal DataGridTextColumn NomeField;
+
+ internal DataGridTextColumn ApelidoField;
+
+ internal MenuItem MaisOpcoesButton;
+
+ internal ToggleButton AtivoBox;
+
+ internal TextBox DocumentoPrincipalBox;
+
+ internal TextBox AssistenciaBox;
+
+ internal TextBox SusepBox;
+
+ internal TextBox CodigoCiaBox;
+
+ internal TextBox LinkAppAndroidBox;
+
+ internal TextBox LinkAppIosBox;
+
+ internal CurrencyTextBox ToleranciaComissaoBox;
+
+ internal CurrencyTextBox ToleranciaPremioBox;
+
+ internal TextBox ObservacaoBox;
+
+ internal ListBox ContatosListBox;
+
+ internal ListBox EnderecoSeguradoraBox;
+
+ private bool _contentLoaded;
+
+ public SeguradoraView()
+ {
+ ((FrameworkElement)this).Tag = "CADASTRO DE SEGURADORA";
+ Tela = (TipoTela)13;
+ ViewModel = new SeguradoraViewModel();
+ ((FrameworkElement)this).DataContext = ViewModel;
+ InitializeComponent();
+ Dispatcher dispatcher = ((DispatcherObject)this).Dispatcher;
+ if (dispatcher != null)
+ {
+ dispatcher.BeginInvoke((DispatcherPriority)7, (Delegate)new Action(ContentLoad));
+ }
+ }
+
+ private void ContentLoad()
+ {
+ //IL_0019: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0023: Expected O, but got Unknown
+ //IL_003d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0042: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0048: Expected O, but got Unknown
+ ((Selector)SeguradoraGrid).SelectedIndex = 0;
+ ((Selector)SeguradoraGrid).SelectionChanged += new SelectionChangedEventHandler(SeguradoraGrid_OnSelectionChanged);
+ DataGrid seguradoraGrid = SeguradoraGrid;
+ object obj = _003C_003Ec._003C_003E9__2_0;
+ if (obj == null)
+ {
+ MouseButtonEventHandler val = delegate
+ {
+ };
+ _003C_003Ec._003C_003E9__2_0 = val;
+ obj = (object)val;
+ }
+ ((Control)seguradoraGrid).MouseDoubleClick += (MouseButtonEventHandler)obj;
+ ((DataGridColumn)NomeField).Visibility = (Visibility)(ViewModel.Apelido ? 2 : 0);
+ ((DataGridColumn)ApelidoField).Visibility = (Visibility)((!ViewModel.Apelido) ? 2 : 0);
+ }
+
+ private async void Salvar_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.Loading(isLoading: true);
+ ViewModel.SelectedSeguradora.NomeSocial = ViewModel.SelectedSeguradora.NomeSocialBanco.Trim();
+ if ((ToleranciaComissaoBox.Number > 2m || ToleranciaPremioBox.Number > 2m) && (ViewModel.Tolerancia != ToleranciaComissaoBox.Number || ViewModel.Tolerancia != ToleranciaPremioBox.Number))
+ {
+ bool? flag = await ViewModel.ShowSenha("TOLERÂNCIA DE COMISSÃO, DIFERENÇA IMPORTAÇÃO OU REPASSE MAIOR QUE R$2,00, PREENCHA A SENHA ADM PARA PROSSEGUIR.");
+ if (!flag.HasValue)
+ {
+ ViewModel.Loading(isLoading: false);
+ return;
+ }
+ if (!flag.GetValueOrDefault())
+ {
+ await ViewModel.ShowMessage("SENHA INVÁLIDA");
+ ViewModel.Loading(isLoading: false);
+ return;
+ }
+ }
+ 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 Alterar_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.Clonar();
+ ViewModel.Alterar(alterar: true);
+ ValidarTela();
+ }
+
+ private void Cancelar_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.CancelarAlteracao();
+ }
+
+ private void IncluirTelefone_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.IncluirTelefone();
+ ValidarTela();
+ }
+
+ private void ExcluirTelefone_OnClick(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
+ Button val = (Button)((sender is Button) ? sender : null);
+ if (val != null)
+ {
+ ListBox val2 = Extentions.FindVisualAncestor<ListBox>((DependencyObject)(object)val);
+ SeguradoraContato contato = (SeguradoraContato)((ItemsControl)val2).Items[((CollectionView)((ItemsControl)val2).Items).IndexOf(((FrameworkElement)val).DataContext)];
+ ViewModel.ExcluirTelefone(contato);
+ }
+ }
+
+ private void ExcluirEndereco_OnClick(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
+ Button val = (Button)((sender is Button) ? sender : null);
+ if (val != null)
+ {
+ ListBox val2 = Extentions.FindVisualAncestor<ListBox>((DependencyObject)(object)val);
+ SeguradoraEndereco endereco = (SeguradoraEndereco)((ItemsControl)val2).Items[((CollectionView)((ItemsControl)val2).Items).IndexOf(((FrameworkElement)val).DataContext)];
+ ViewModel.ExcluirEndereco(endereco);
+ }
+ }
+
+ private void IncluirEndereco_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.IncluirEndereco();
+ ValidarTela();
+ }
+
+ public async void Metas_Click(object sender, RoutedEventArgs e)
+ {
+ ViewModel.Loading(isLoading: true);
+ if (await ViewModel.VerificarPermissao((TipoTela)31))
+ {
+ ViewModel.ShowDrawer(new MetaSeguradoraView(ViewModel.SelectedSeguradora), 0, close: false);
+ ViewModel.Loading(isLoading: false);
+ }
+ }
+
+ private async void PostcodeBox_OnLostFocus(object sender, RoutedEventArgs e)
+ {
+ TextBox val = (TextBox)sender;
+ string text = ValidationHelper.FormatPostCode(val.Text);
+ if (ValidationHelper.ValidatePostCode(text))
+ {
+ ListBox val2 = Extentions.FindVisualAncestor<ListBox>((DependencyObject)(object)val);
+ ListBoxItem val3 = (ListBoxItem)((ItemsControl)val2).ItemContainerGenerator.ContainerFromIndex(((CollectionView)((ItemsControl)val2).Items).IndexOf(((FrameworkElement)val).DataContext));
+ ContentPresenter contentPresenter = FindVisualChild.Find<ContentPresenter>((DependencyObject)(object)val3);
+ DataTemplate dataTemplate = contentPresenter.ContentTemplate;
+ ((TextBox)((FrameworkTemplate)dataTemplate).FindName("CepBox", (FrameworkElement)(object)contentPresenter)).Text = text;
+ EnderecoBase val4 = await ViewModel.BuscaCep(text);
+ if (val4 != null)
+ {
+ TextBox val5 = (TextBox)((FrameworkTemplate)dataTemplate).FindName("EnderecoBox", (FrameworkElement)(object)contentPresenter);
+ TextBox val6 = (TextBox)((FrameworkTemplate)dataTemplate).FindName("CidadeBox", (FrameworkElement)(object)contentPresenter);
+ TextBox val7 = (TextBox)((FrameworkTemplate)dataTemplate).FindName("EstadoBox", (FrameworkElement)(object)contentPresenter);
+ TextBox val8 = (TextBox)((FrameworkTemplate)dataTemplate).FindName("BairroBox", (FrameworkElement)(object)contentPresenter);
+ val5.Text = val4.Endereco;
+ val6.Text = val4.Cidade;
+ val7.Text = val4.Estado;
+ val8.Text = val4.Bairro;
+ }
+ }
+ }
+
+ private void AutoCompleteBoxSeguradora_Populating(object sender, PopulatingEventArgs e)
+ {
+ e.Cancel = true;
+ ViewModel.Filtrar(ValidationHelper.RemoveDiacritics(e.Parameter.Trim())).ContinueWith(delegate(Task<List<Seguradora>> 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.FiltrarSeguradora("");
+ }
+ }
+
+ private void AutoCompleteBoxDescricao_Populating(object sender, PopulatingEventArgs e)
+ {
+ e.Cancel = true;
+ ViewModel.FiltrarConfig(ValidationHelper.RemoveDiacritics(e.Parameter.Trim())).ContinueWith(delegate(Task<List<ConfigExtratoImport>> 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 AutoCompleteBoxDescricao_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.FiltrarDescricao("");
+ }
+ }
+
+ private void SeguradoraGrid_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ //IL_0001: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0007: Expected O, but got Unknown
+ //IL_0031: Unknown result type (might be due to invalid IL or missing references)
+ //IL_003b: Expected O, but got Unknown
+ DataGrid val = (DataGrid)sender;
+ if (val == null || ((Selector)val).SelectedIndex >= 0)
+ {
+ ViewModel.SelecionaSeguradora((Seguradora)((val != null) ? ((ItemsControl)val).Items[((Selector)val).SelectedIndex] : null));
+ }
+ }
+
+ private async void AbrirAquivoDigital_Click(object sender, RoutedEventArgs e)
+ {
+ if (!new PermissaoArquivoDigitalServico().BuscarPermissao(Recursos.Usuario, (TipoArquivoDigital)8).Consultar)
+ {
+ await ViewModel.ShowMessage("VOCÊ NÃO POSSUI PERMISSÃO PARA ACESSAR\nARQUIVO DIGITAL DE " + EnumHelper.GetDescription<TipoArquivoDigital>((TipoArquivoDigital)8) + ".");
+ return;
+ }
+ FiltroArquivoDigital filtro = new FiltroArquivoDigital
+ {
+ Id = ((DomainBase)ViewModel.SelectedSeguradora).Id,
+ Tipo = (TipoArquivoDigital)8,
+ Parente = ViewModel.SelectedSeguradora
+ };
+ ViewModel.ShowDrawer(new ArquivoDigitalDrawer(filtro), 0, close: false);
+ }
+
+ private void AbrirLog_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.AbrirLog((TipoTela)13, ((DomainBase)ViewModel.SelectedSeguradora).Id);
+ }
+
+ private void Incluir_OnClick(object sender, RoutedEventArgs e)
+ {
+ IncluirSeguradoraView incluirSeguradoraView = new IncluirSeguradoraView(ViewModel.Seguradoras);
+ ((Window)new HosterWindow((ContentControl)(object)incluirSeguradoraView, "INCLUIR SEGURADORA", 500.0, 600.0)).ShowDialog();
+ if (incluirSeguradoraView.ViewModel.AdicionarSeguradora != null)
+ {
+ ViewModel.Incluir(incluirSeguradoraView.ViewModel.AdicionarSeguradora);
+ }
+ }
+
+ private void AbrirLogEmail_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.AbrirLogEmail((TipoTela)13, ((DomainBase)ViewModel.SelectedSeguradora).Id);
+ }
+
+ private async void Impostos_OnClick(object sender, RoutedEventArgs e)
+ {
+ if (Recursos.Configuracoes.All((ConfiguracaoSistema x) => (int)x.Configuracao != 5))
+ {
+ await ViewModel.ShowMessage("RECURSO NÃO HABILITADO, ACESSE AS CONFIGURAÇÕES DENTRO DO CADASTRO DE EMPRESAS E FILIAIS PARA HABILITAR O RECURSO.");
+ }
+ else if (await ViewModel.VerificarPermissao((TipoTela)56))
+ {
+ ViewModel.ShowDrawer(new ImpostoDrawer(0, ((DomainBase)ViewModel.SelectedSeguradora).Id), 0, close: false);
+ }
+ }
+
+ private void DocumentoPrincipalBox_LostFocus(object sender, RoutedEventArgs e)
+ {
+ //IL_0001: Unknown result type (might be due to invalid IL or missing references)
+ if (!((TextBoxBase)(TextBox)sender).IsReadOnly)
+ {
+ string text = ValidationHelper.Clear(DocumentoPrincipalBox.Text);
+ if (!string.IsNullOrEmpty(text))
+ {
+ DocumentoPrincipalBox.Text = ((text.Length == 11) ? ValidationHelper.FormatDocument(text.PadLeft(11, '0').Substring(0, 11)) : ValidationHelper.FormatDocument(text.PadLeft(14, '0').Substring(0, 14)));
+ }
+ }
+ }
+
+ private void ValidarTela()
+ {
+ if (ViewModel.SelectedSeguradora != null)
+ {
+ List<KeyValuePair<string, string>> list = ViewModel.SelectedSeguradora.Validate();
+ SeguradoraContato? obj = ViewModel.Contatos.FirstOrDefault();
+ list.AddRange(((obj != null) ? obj.Validate() : null) ?? new List<KeyValuePair<string, string>>());
+ SeguradoraEndereco? obj2 = ViewModel.Enderecos.FirstOrDefault();
+ list.AddRange(((obj2 != null) ? obj2.Validate() : null) ?? new List<KeyValuePair<string, string>>());
+ ((DependencyObject)(object)this).ValidateFields(list, focusField: false);
+ }
+ }
+
+ public void Selector_ContactChanged(object sender, SelectionChangedEventArgs e)
+ {
+ ViewModel.TipoTelefoneVisibility = (Visibility)0;
+ ViewModel.TelefoneVisibility = (Visibility)0;
+ ViewModel.PrefixoVisibility = (Visibility)0;
+ }
+
+ [DebuggerNonUserCode]
+ [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
+ public void InitializeComponent()
+ {
+ if (!_contentLoaded)
+ {
+ _contentLoaded = true;
+ Uri uri = new Uri("/Gestor.Application;component/views/ferramentas/seguradoraview.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_00a2: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00ae: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00b8: Expected O, but got Unknown
+ //IL_00b9: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00c5: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00cf: Expected O, but got Unknown
+ //IL_00d1: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00dd: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00e7: Expected O, but got Unknown
+ //IL_00e8: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00f4: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00fe: Expected O, but got Unknown
+ //IL_0101: Unknown result type (might be due to invalid IL or missing references)
+ //IL_010b: Expected O, but got Unknown
+ //IL_010e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0118: Expected O, but got Unknown
+ //IL_011b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0125: Expected O, but got Unknown
+ //IL_0127: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0133: Unknown result type (might be due to invalid IL or missing references)
+ //IL_013d: Expected O, but got Unknown
+ //IL_013f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_014b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0155: Expected O, but got Unknown
+ //IL_0157: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0163: Unknown result type (might be due to invalid IL or missing references)
+ //IL_016d: Expected O, but got Unknown
+ //IL_016f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_017b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0185: Expected O, but got Unknown
+ //IL_0187: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0193: Unknown result type (might be due to invalid IL or missing references)
+ //IL_019d: Expected O, but got Unknown
+ //IL_01a0: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01aa: Expected O, but got Unknown
+ //IL_01ac: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01b8: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01c2: Expected O, but got Unknown
+ //IL_01c4: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01d0: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01da: Expected O, but got Unknown
+ //IL_01dc: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01e8: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01f2: Expected O, but got Unknown
+ //IL_01f4: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0200: Unknown result type (might be due to invalid IL or missing references)
+ //IL_020a: Expected O, but got Unknown
+ //IL_020d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0217: Expected O, but got Unknown
+ //IL_021a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0224: Expected O, but got Unknown
+ //IL_0232: Unknown result type (might be due to invalid IL or missing references)
+ //IL_023c: Expected O, but got Unknown
+ //IL_0249: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0253: Expected O, but got Unknown
+ //IL_0256: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0260: Expected O, but got Unknown
+ //IL_0263: Unknown result type (might be due to invalid IL or missing references)
+ //IL_026d: Expected O, but got Unknown
+ //IL_0270: Unknown result type (might be due to invalid IL or missing references)
+ //IL_027a: Expected O, but got Unknown
+ //IL_027d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0287: Expected O, but got Unknown
+ //IL_028a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0294: Expected O, but got Unknown
+ //IL_0297: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02a1: Expected O, but got Unknown
+ //IL_02a4: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02ae: Expected O, but got Unknown
+ //IL_02b1: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02bb: Expected O, but got Unknown
+ //IL_02bd: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02c9: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02d3: Expected O, but got Unknown
+ //IL_02d6: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02e0: Expected O, but got Unknown
+ //IL_02e2: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02ee: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02f8: Expected O, but got Unknown
+ //IL_02fb: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0305: Expected O, but got Unknown
+ //IL_0307: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0313: Unknown result type (might be due to invalid IL or missing references)
+ //IL_031d: Expected O, but got Unknown
+ //IL_031e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_032a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0334: Expected O, but got Unknown
+ switch (connectionId)
+ {
+ case 1:
+ ((AutoCompleteBox)target).Populating += new PopulatingEventHandler(AutoCompleteBoxSeguradora_Populating);
+ ((AutoCompleteBox)target).TextChanged += new RoutedEventHandler(AutoCompleteBox_OnTextChanged);
+ break;
+ case 2:
+ ((AutoCompleteBox)target).Populating += new PopulatingEventHandler(AutoCompleteBoxSeguradora_Populating);
+ ((AutoCompleteBox)target).TextChanged += new RoutedEventHandler(AutoCompleteBox_OnTextChanged);
+ break;
+ case 3:
+ SeguradoraGrid = (DataGrid)target;
+ break;
+ case 4:
+ NomeField = (DataGridTextColumn)target;
+ break;
+ case 5:
+ ApelidoField = (DataGridTextColumn)target;
+ break;
+ case 6:
+ ((MenuItem)target).Click += new RoutedEventHandler(Incluir_OnClick);
+ break;
+ case 7:
+ ((MenuItem)target).Click += new RoutedEventHandler(Alterar_OnClick);
+ break;
+ case 8:
+ ((MenuItem)target).Click += new RoutedEventHandler(Salvar_OnClick);
+ break;
+ case 9:
+ ((MenuItem)target).Click += new RoutedEventHandler(Cancelar_OnClick);
+ break;
+ case 10:
+ ((MenuItem)target).Click += new RoutedEventHandler(AbrirAquivoDigital_Click);
+ break;
+ case 11:
+ MaisOpcoesButton = (MenuItem)target;
+ break;
+ case 12:
+ ((MenuItem)target).Click += new RoutedEventHandler(Metas_Click);
+ break;
+ case 13:
+ ((MenuItem)target).Click += new RoutedEventHandler(Impostos_OnClick);
+ break;
+ case 14:
+ ((MenuItem)target).Click += new RoutedEventHandler(AbrirLog_OnClick);
+ break;
+ case 15:
+ ((MenuItem)target).Click += new RoutedEventHandler(AbrirLogEmail_OnClick);
+ break;
+ case 16:
+ AtivoBox = (ToggleButton)target;
+ break;
+ case 17:
+ DocumentoPrincipalBox = (TextBox)target;
+ ((UIElement)DocumentoPrincipalBox).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ ((UIElement)DocumentoPrincipalBox).LostFocus += new RoutedEventHandler(DocumentoPrincipalBox_LostFocus);
+ break;
+ case 18:
+ AssistenciaBox = (TextBox)target;
+ break;
+ case 19:
+ SusepBox = (TextBox)target;
+ break;
+ case 20:
+ CodigoCiaBox = (TextBox)target;
+ break;
+ case 21:
+ LinkAppAndroidBox = (TextBox)target;
+ break;
+ case 22:
+ LinkAppIosBox = (TextBox)target;
+ break;
+ case 23:
+ ToleranciaComissaoBox = (CurrencyTextBox)target;
+ break;
+ case 24:
+ ToleranciaPremioBox = (CurrencyTextBox)target;
+ break;
+ case 25:
+ ObservacaoBox = (TextBox)target;
+ break;
+ case 26:
+ ((MenuItem)target).Click += new RoutedEventHandler(IncluirTelefone_OnClick);
+ break;
+ case 27:
+ ContatosListBox = (ListBox)target;
+ break;
+ case 32:
+ ((MenuItem)target).Click += new RoutedEventHandler(IncluirEndereco_OnClick);
+ break;
+ case 33:
+ EnderecoSeguradoraBox = (ListBox)target;
+ break;
+ case 37:
+ ((AutoCompleteBox)target).Populating += new PopulatingEventHandler(AutoCompleteBoxDescricao_Populating);
+ ((AutoCompleteBox)target).TextChanged += new RoutedEventHandler(AutoCompleteBoxDescricao_OnTextChanged);
+ break;
+ default:
+ _contentLoaded = true;
+ break;
+ }
+ }
+
+ [DebuggerNonUserCode]
+ [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ void IStyleConnector.Connect(int connectionId, object target)
+ {
+ //IL_002f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_003b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0045: Expected O, but got Unknown
+ //IL_0047: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0054: Unknown result type (might be due to invalid IL or missing references)
+ //IL_005e: Expected O, but got Unknown
+ //IL_0060: Unknown result type (might be due to invalid IL or missing references)
+ //IL_006d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0077: Expected O, but got Unknown
+ //IL_0078: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0085: Unknown result type (might be due to invalid IL or missing references)
+ //IL_008f: Expected O, but got Unknown
+ //IL_0091: Unknown result type (might be due to invalid IL or missing references)
+ //IL_009d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00a7: Expected O, but got Unknown
+ //IL_00a9: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00b5: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00bf: Expected O, but got Unknown
+ //IL_00c0: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00cd: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00d7: Expected O, but got Unknown
+ //IL_00d9: 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_00f2: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00fe: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0108: Expected O, but got Unknown
+ switch (connectionId)
+ {
+ case 28:
+ ((Selector)(ComboBox)target).SelectionChanged += new SelectionChangedEventHandler(Selector_ContactChanged);
+ break;
+ case 29:
+ ((UIElement)(TextBox)target).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 30:
+ ((UIElement)(TextBox)target).LostFocus += new RoutedEventHandler(FormatarTelefone);
+ ((UIElement)(TextBox)target).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 31:
+ ((ButtonBase)(Button)target).Click += new RoutedEventHandler(ExcluirTelefone_OnClick);
+ break;
+ case 34:
+ ((UIElement)(TextBox)target).LostFocus += new RoutedEventHandler(PostcodeBox_OnLostFocus);
+ ((UIElement)(TextBox)target).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 35:
+ ((UIElement)(TextBox)target).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 36:
+ ((ButtonBase)(Button)target).Click += new RoutedEventHandler(ExcluirEndereco_OnClick);
+ break;
+ case 32:
+ case 33:
+ break;
+ }
+ }
+}
diff --git a/Decompiler/Gestor.Application.Views.Ferramentas/SocioView.cs b/Decompiler/Gestor.Application.Views.Ferramentas/SocioView.cs
new file mode 100644
index 0000000..065adb8
--- /dev/null
+++ b/Decompiler/Gestor.Application.Views.Ferramentas/SocioView.cs
@@ -0,0 +1,277 @@
+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.Input;
+using System.Windows.Markup;
+using Gestor.Application.Drawers;
+using Gestor.Application.Helpers;
+using Gestor.Application.Servicos;
+using Gestor.Application.ViewModels.Ferramentas;
+using Gestor.Application.Views.Generic;
+using Gestor.Common.Validation;
+using Gestor.Model.Common;
+using Gestor.Model.Domain.Common;
+using Gestor.Model.Domain.Generic;
+
+namespace Gestor.Application.Views.Ferramentas;
+
+public class SocioView : BaseUserControl, IComponentConnector
+{
+ internal ComboBox EmpresaFilialBox;
+
+ internal DataGrid SocioGrid;
+
+ internal MenuItem MaisOpcoesButton;
+
+ internal TextBox NomeBox;
+
+ internal TextBox PrimeiroPrefixo;
+
+ internal TextBox PrimeiroTelefone;
+
+ internal TextBox EmailBox;
+
+ private bool _contentLoaded;
+
+ public SocioViewModel ViewModel { get; set; }
+
+ public SocioView()
+ {
+ ((FrameworkElement)this).Tag = "CADASTRO DE SÓCIOS";
+ ViewModel = new SocioViewModel();
+ ((FrameworkElement)this).DataContext = ViewModel;
+ InitializeComponent();
+ }
+
+ private void AutoCompleteBoxSocio_Populating(object sender, PopulatingEventArgs e)
+ {
+ e.Cancel = true;
+ ViewModel.Filtrar(ValidationHelper.RemoveDiacritics(e.Parameter.Trim())).ContinueWith(delegate(Task<List<Socio>> 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.FiltrarSocio("");
+ }
+ }
+
+ 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.CancelSocio = (Socio)((DomainBase)ViewModel.SelectedSocio).Clone();
+ ViewModel.Alterar(alterar: true);
+ ValidarTela();
+ ((DomainBase)ViewModel.SelectedSocio).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 async void AbrirAquivoDigital_Click(object sender, RoutedEventArgs e)
+ {
+ if (!new PermissaoArquivoDigitalServico().BuscarPermissao(Recursos.Usuario, (TipoArquivoDigital)14).Consultar)
+ {
+ await ViewModel.ShowMessage("VOCÊ NÃO POSSUI PERMISSÃO PARA ACESSAR\nARQUIVO DIGITAL DE " + ValidationHelper.GetDescription((Enum)(object)(TipoArquivoDigital)14) + ".");
+ return;
+ }
+ if (ViewModel.SelectedSocio == null)
+ {
+ await ViewModel.ShowMessage("É NECESSÁRIO SELECIONAR UM SÓCIO PARA ABRIR SEU ARQUIVO DIGITAL");
+ return;
+ }
+ FiltroArquivoDigital filtro = new FiltroArquivoDigital
+ {
+ Id = ((DomainBase)ViewModel.SelectedSocio).Id,
+ Tipo = (TipoArquivoDigital)14,
+ Parente = ViewModel.SelectedSocio
+ };
+ ViewModel.ShowDrawer(new ArquivoDigitalDrawer(filtro), 0, close: false);
+ }
+
+ private void AbrirLog_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.AbrirLog((TipoTela)19, ((DomainBase)ViewModel.SelectedSocio).Id);
+ }
+
+ private void Incluir_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.Incluir();
+ ValidarTela();
+ }
+
+ private void Excluir_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.Excluir();
+ }
+
+ private void ValidarTela()
+ {
+ if (ViewModel.SelectedSocio != null)
+ {
+ List<KeyValuePair<string, string>> errorMessages = ViewModel.SelectedSocio.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/socioview.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_004b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0055: Expected O, but got Unknown
+ //IL_0057: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0063: Unknown result type (might be due to invalid IL or missing references)
+ //IL_006d: Expected O, but got Unknown
+ //IL_006e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_007a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0084: Expected O, but got Unknown
+ //IL_0087: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0091: Expected O, but got Unknown
+ //IL_0093: Unknown result type (might be due to invalid IL or missing references)
+ //IL_009f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00a9: Expected O, but got Unknown
+ //IL_00ab: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00b7: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00c1: Expected O, but got Unknown
+ //IL_00c3: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00cf: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00d9: Expected O, but got Unknown
+ //IL_00db: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00e7: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00f1: Expected O, but got Unknown
+ //IL_00f3: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00ff: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0109: Expected O, but got Unknown
+ //IL_010b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0117: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0121: Expected O, but got Unknown
+ //IL_0124: Unknown result type (might be due to invalid IL or missing references)
+ //IL_012e: Expected O, but got Unknown
+ //IL_0130: Unknown result type (might be due to invalid IL or missing references)
+ //IL_013c: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0146: Expected O, but got Unknown
+ //IL_0149: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0153: Expected O, but got Unknown
+ //IL_0156: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0160: Expected O, but got Unknown
+ //IL_016e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0178: Expected O, but got Unknown
+ //IL_017b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0185: Expected O, but got Unknown
+ //IL_0193: Unknown result type (might be due to invalid IL or missing references)
+ //IL_019d: Expected O, but got Unknown
+ //IL_01ab: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01b5: Expected O, but got Unknown
+ //IL_01b8: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01c2: Expected O, but got Unknown
+ switch (connectionId)
+ {
+ case 1:
+ EmpresaFilialBox = (ComboBox)target;
+ break;
+ case 2:
+ ((AutoCompleteBox)target).Populating += new PopulatingEventHandler(AutoCompleteBoxSocio_Populating);
+ ((AutoCompleteBox)target).TextChanged += new RoutedEventHandler(AutoCompleteBox_OnTextChanged);
+ break;
+ case 3:
+ SocioGrid = (DataGrid)target;
+ break;
+ case 4:
+ ((MenuItem)target).Click += new RoutedEventHandler(Incluir_OnClick);
+ break;
+ case 5:
+ ((MenuItem)target).Click += new RoutedEventHandler(Alterar_OnClick);
+ break;
+ case 6:
+ ((MenuItem)target).Click += new RoutedEventHandler(Salvar_OnClick);
+ break;
+ case 7:
+ ((MenuItem)target).Click += new RoutedEventHandler(Cancelar_OnClick);
+ break;
+ case 8:
+ ((MenuItem)target).Click += new RoutedEventHandler(Excluir_OnClick);
+ break;
+ case 9:
+ ((MenuItem)target).Click += new RoutedEventHandler(AbrirAquivoDigital_Click);
+ break;
+ case 10:
+ MaisOpcoesButton = (MenuItem)target;
+ break;
+ case 11:
+ ((MenuItem)target).Click += new RoutedEventHandler(AbrirLog_OnClick);
+ break;
+ case 12:
+ NomeBox = (TextBox)target;
+ break;
+ case 13:
+ PrimeiroPrefixo = (TextBox)target;
+ ((UIElement)PrimeiroPrefixo).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 14:
+ PrimeiroTelefone = (TextBox)target;
+ ((UIElement)PrimeiroTelefone).LostFocus += new RoutedEventHandler(FormatarTelefone);
+ ((UIElement)PrimeiroTelefone).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 15:
+ EmailBox = (TextBox)target;
+ break;
+ default:
+ _contentLoaded = true;
+ break;
+ }
+ }
+}
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;
+ }
+ }
+}
diff --git a/Decompiler/Gestor.Application.Views.Ferramentas/StatusView.cs b/Decompiler/Gestor.Application.Views.Ferramentas/StatusView.cs
new file mode 100644
index 0000000..1eaa3b9
--- /dev/null
+++ b/Decompiler/Gestor.Application.Views.Ferramentas/StatusView.cs
@@ -0,0 +1,274 @@
+using System;
+using System.CodeDom.Compiler;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Diagnostics;
+using System.Runtime.CompilerServices;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Controls.Primitives;
+using System.Windows.Input;
+using System.Windows.Markup;
+using System.Windows.Threading;
+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.Generic;
+using Gestor.Model.Domain.Seguros;
+
+namespace Gestor.Application.Views.Ferramentas;
+
+public class StatusView : BaseUserControl, IComponentConnector
+{
+ [Serializable]
+ [CompilerGenerated]
+ private sealed class _003C_003Ec
+ {
+ public static readonly _003C_003Ec _003C_003E9 = new _003C_003Ec();
+
+ public static MouseButtonEventHandler _003C_003E9__2_0;
+
+ internal void _003CContentLoad_003Eb__2_0(object sender, MouseButtonEventArgs args)
+ {
+ }
+ }
+
+ public StatusViewModel ViewModel;
+
+ internal DataGrid StatusGrid;
+
+ internal MenuItem MaisOpcoesButton;
+
+ internal TextBox NomeBox;
+
+ internal ToggleButton AtivoBox;
+
+ private bool _contentLoaded;
+
+ public StatusView()
+ {
+ ((FrameworkElement)this).Tag = "CADASTRO DE STATUS";
+ ViewModel = new StatusViewModel();
+ ((FrameworkElement)this).DataContext = ViewModel;
+ InitializeComponent();
+ Dispatcher dispatcher = ((DispatcherObject)this).Dispatcher;
+ if (dispatcher != null)
+ {
+ dispatcher.BeginInvoke((DispatcherPriority)7, (Delegate)new Action(ContentLoad));
+ }
+ }
+
+ private void ContentLoad()
+ {
+ //IL_0019: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0023: Expected O, but got Unknown
+ //IL_003d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0042: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0048: Expected O, but got Unknown
+ ((Selector)StatusGrid).SelectedIndex = 0;
+ ((Selector)StatusGrid).SelectionChanged += new SelectionChangedEventHandler(EstipulanteGrid_OnSelectionChanged);
+ DataGrid statusGrid = StatusGrid;
+ object obj = _003C_003Ec._003C_003E9__2_0;
+ if (obj == null)
+ {
+ MouseButtonEventHandler val = delegate
+ {
+ };
+ _003C_003Ec._003C_003E9__2_0 = val;
+ obj = (object)val;
+ }
+ ((Control)statusGrid).MouseDoubleClick += (MouseButtonEventHandler)obj;
+ }
+
+ private void Incluir_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.Incluir();
+ ValidarTela();
+ }
+
+ private void Cancelar_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.CancelarAlteracao();
+ }
+
+ 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 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.CancelStatus = (Status)((DomainBase)ViewModel.SelectedStatus).Clone();
+ ViewModel.Alterar(alterar: true);
+ ValidarTela();
+ ((DomainBase)ViewModel.SelectedStatus).Initialize();
+ }
+
+ private void AutoCompleteBoxStatus_Populating(object sender, PopulatingEventArgs e)
+ {
+ e.Cancel = true;
+ ViewModel.Filtrar(ValidationHelper.RemoveDiacritics(e.Parameter.Trim())).ContinueWith(delegate(Task<List<Status>> 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.FiltrarStatus("");
+ }
+ }
+
+ private void EstipulanteGrid_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ //IL_0001: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0007: Expected O, but got Unknown
+ //IL_0031: Unknown result type (might be due to invalid IL or missing references)
+ //IL_003b: Expected O, but got Unknown
+ DataGrid val = (DataGrid)sender;
+ if (val == null || ((Selector)val).SelectedIndex >= 0)
+ {
+ ViewModel.SelecionaStatus((Status)((val != null) ? ((ItemsControl)val).Items[((Selector)val).SelectedIndex] : null));
+ }
+ }
+
+ private void AbrirLog_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.AbrirLog((TipoTela)11, ((DomainBase)ViewModel.SelectedStatus).Id);
+ }
+
+ private void Excluir_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.Excluir();
+ }
+
+ private void ValidarTela()
+ {
+ if (ViewModel.SelectedStatus != null)
+ {
+ List<KeyValuePair<string, string>> errorMessages = ViewModel.SelectedStatus.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/statusview.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_003a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0046: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0050: Expected O, but got Unknown
+ //IL_0051: Unknown result type (might be due to invalid IL or missing references)
+ //IL_005d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0067: Expected O, but got Unknown
+ //IL_006a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0074: Expected O, but got Unknown
+ //IL_0076: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0082: Unknown result type (might be due to invalid IL or missing references)
+ //IL_008c: Expected O, but got Unknown
+ //IL_008e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_009a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00a4: Expected O, but got Unknown
+ //IL_00a6: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00b2: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00bc: Expected O, but got Unknown
+ //IL_00be: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00ca: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00d4: Expected O, but got Unknown
+ //IL_00d6: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00e2: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00ec: Expected O, but got Unknown
+ //IL_00ef: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00f9: Expected O, but got Unknown
+ //IL_00fb: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0107: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0111: Expected O, but got Unknown
+ //IL_0114: Unknown result type (might be due to invalid IL or missing references)
+ //IL_011e: Expected O, but got Unknown
+ //IL_0121: Unknown result type (might be due to invalid IL or missing references)
+ //IL_012b: Expected O, but got Unknown
+ switch (connectionId)
+ {
+ case 1:
+ ((AutoCompleteBox)target).Populating += new PopulatingEventHandler(AutoCompleteBoxStatus_Populating);
+ ((AutoCompleteBox)target).TextChanged += new RoutedEventHandler(AutoCompleteBox_OnTextChanged);
+ break;
+ case 2:
+ StatusGrid = (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;
+ default:
+ _contentLoaded = true;
+ break;
+ }
+ }
+}
diff --git a/Decompiler/Gestor.Application.Views.Ferramentas/TipoTarefaView.cs b/Decompiler/Gestor.Application.Views.Ferramentas/TipoTarefaView.cs
new file mode 100644
index 0000000..aaa0e67
--- /dev/null
+++ b/Decompiler/Gestor.Application.Views.Ferramentas/TipoTarefaView.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 TipoTarefaView : BaseUserControl, IComponentConnector
+{
+ public TipoTarefaViewModel ViewModel;
+
+ internal DataGrid TipoTarefaGrid;
+
+ internal MenuItem MaisOpcoesButton;
+
+ internal TextBox NomeBox;
+
+ internal ToggleButton AtivoBox;
+
+ internal TextBox ObsBox;
+
+ private bool _contentLoaded;
+
+ public TipoTarefaView()
+ {
+ ((FrameworkElement)this).Tag = "CADASTRO DO TIPO DE TAREFA";
+ ViewModel = new TipoTarefaViewModel();
+ ((FrameworkElement)this).DataContext = ViewModel;
+ InitializeComponent();
+ }
+
+ private void AutoCompleteBoxTipoTarefa_Populating(object sender, PopulatingEventArgs e)
+ {
+ e.Cancel = true;
+ ViewModel.Filtrar(ValidationHelper.RemoveDiacritics(e.Parameter.Trim())).ContinueWith(delegate(Task<List<TipoDeTarefa>> 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.FiltrarTipoTarefa("");
+ }
+ }
+
+ 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.CancelTipoTarefa = (TipoDeTarefa)((DomainBase)ViewModel.SelectedTipoTarefa).Clone();
+ ViewModel.Alterar(alterar: true);
+ ValidarTela();
+ ((DomainBase)ViewModel.SelectedTipoTarefa).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)52, ((DomainBase)ViewModel.SelectedTipoTarefa).Id);
+ }
+
+ private void ValidarTela()
+ {
+ if (ViewModel.SelectedTipoTarefa != null)
+ {
+ List<KeyValuePair<string, string>> errorMessages = ViewModel.SelectedTipoTarefa.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/tipotarefaview.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(AutoCompleteBoxTipoTarefa_Populating);
+ ((AutoCompleteBox)target).TextChanged += new RoutedEventHandler(AutoCompleteBox_OnTextChanged);
+ break;
+ case 2:
+ TipoTarefaGrid = (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;
+ }
+ }
+}
diff --git a/Decompiler/Gestor.Application.Views.Ferramentas/TipoVendedorView.cs b/Decompiler/Gestor.Application.Views.Ferramentas/TipoVendedorView.cs
new file mode 100644
index 0000000..6bb42d7
--- /dev/null
+++ b/Decompiler/Gestor.Application.Views.Ferramentas/TipoVendedorView.cs
@@ -0,0 +1,267 @@
+using System;
+using System.CodeDom.Compiler;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Diagnostics;
+using System.Runtime.CompilerServices;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Controls.Primitives;
+using System.Windows.Input;
+using System.Windows.Markup;
+using System.Windows.Threading;
+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.Generic;
+using Gestor.Model.Domain.Seguros;
+
+namespace Gestor.Application.Views.Ferramentas;
+
+public class TipoVendedorView : BaseUserControl, IComponentConnector
+{
+ [Serializable]
+ [CompilerGenerated]
+ private sealed class _003C_003Ec
+ {
+ public static readonly _003C_003Ec _003C_003E9 = new _003C_003Ec();
+
+ public static MouseButtonEventHandler _003C_003E9__2_0;
+
+ internal void _003CContentLoad_003Eb__2_0(object sender, MouseButtonEventArgs args)
+ {
+ }
+ }
+
+ public TipoVendedorViewModel ViewModel;
+
+ internal DataGrid TipoVendedorGrid;
+
+ internal MenuItem MaisOpcoesButton;
+
+ internal ToggleButton AtivoBox;
+
+ private bool _contentLoaded;
+
+ public TipoVendedorView()
+ {
+ ((FrameworkElement)this).Tag = "CADASTRO DE TIPO DE VENDEDOR";
+ ViewModel = new TipoVendedorViewModel();
+ ((FrameworkElement)this).DataContext = ViewModel;
+ InitializeComponent();
+ Dispatcher dispatcher = ((DispatcherObject)this).Dispatcher;
+ if (dispatcher != null)
+ {
+ dispatcher.BeginInvoke((DispatcherPriority)7, (Delegate)new Action(ContentLoad));
+ }
+ }
+
+ private void ContentLoad()
+ {
+ //IL_0019: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0023: Expected O, but got Unknown
+ //IL_003d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0042: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0048: Expected O, but got Unknown
+ ((Selector)TipoVendedorGrid).SelectedIndex = 0;
+ ((Selector)TipoVendedorGrid).SelectionChanged += new SelectionChangedEventHandler(TipoVendedorGrid_OnSelectionChanged);
+ DataGrid tipoVendedorGrid = TipoVendedorGrid;
+ object obj = _003C_003Ec._003C_003E9__2_0;
+ if (obj == null)
+ {
+ MouseButtonEventHandler val = delegate
+ {
+ };
+ _003C_003Ec._003C_003E9__2_0 = val;
+ obj = (object)val;
+ }
+ ((Control)tipoVendedorGrid).MouseDoubleClick += (MouseButtonEventHandler)obj;
+ }
+
+ private void Incluir_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.Incluir();
+ ValidarTela();
+ }
+
+ 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 AutoCompleteBoxTipoVendedor_Populating(object sender, PopulatingEventArgs e)
+ {
+ e.Cancel = true;
+ ViewModel.Filtrar(ValidationHelper.RemoveDiacritics(e.Parameter.Trim())).ContinueWith(delegate(Task<List<TipoVendedor>> 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.FiltrarTipoVendedor("");
+ }
+ }
+
+ 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.CancelTipoVendedor = (TipoVendedor)((DomainBase)ViewModel.SelectedTipoVendedor).Clone();
+ ViewModel.Alterar(alterar: true);
+ ValidarTela();
+ ((DomainBase)ViewModel.SelectedTipoVendedor).Initialize();
+ }
+
+ private void TipoVendedorGrid_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ //IL_0001: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0007: Expected O, but got Unknown
+ //IL_0031: Unknown result type (might be due to invalid IL or missing references)
+ //IL_003b: Expected O, but got Unknown
+ DataGrid val = (DataGrid)sender;
+ if (val == null || ((Selector)val).SelectedIndex >= 0)
+ {
+ ViewModel.SelecionaTipoVendedor((TipoVendedor)((val != null) ? ((ItemsControl)val).Items[((Selector)val).SelectedIndex] : null));
+ }
+ }
+
+ private void AbrirLog_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.AbrirLog((TipoTela)14, ((DomainBase)ViewModel.SelectedTipoVendedor).Id);
+ }
+
+ private void ValidarTela()
+ {
+ if (ViewModel.SelectedTipoVendedor != null)
+ {
+ List<KeyValuePair<string, string>> errorMessages = ViewModel.SelectedTipoVendedor.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/tipovendedorview.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_0036: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0042: Unknown result type (might be due to invalid IL or missing references)
+ //IL_004c: Expected O, but got Unknown
+ //IL_004d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0059: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0063: Expected O, but got Unknown
+ //IL_0066: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0070: Expected O, but got Unknown
+ //IL_0072: Unknown result type (might be due to invalid IL or missing references)
+ //IL_007e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0088: Expected O, but got Unknown
+ //IL_008a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0096: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00a0: Expected O, but got Unknown
+ //IL_00a2: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00ae: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00b8: Expected O, but got Unknown
+ //IL_00ba: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00c6: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00d0: Expected O, but got Unknown
+ //IL_00d2: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00de: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00e8: Expected O, but got Unknown
+ //IL_00eb: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00f5: Expected O, but got Unknown
+ //IL_00f7: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0103: Unknown result type (might be due to invalid IL or missing references)
+ //IL_010d: Expected O, but got Unknown
+ //IL_0110: Unknown result type (might be due to invalid IL or missing references)
+ //IL_011a: Expected O, but got Unknown
+ switch (connectionId)
+ {
+ case 1:
+ ((AutoCompleteBox)target).Populating += new PopulatingEventHandler(AutoCompleteBoxTipoVendedor_Populating);
+ ((AutoCompleteBox)target).TextChanged += new RoutedEventHandler(AutoCompleteBox_OnTextChanged);
+ break;
+ case 2:
+ TipoVendedorGrid = (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:
+ AtivoBox = (ToggleButton)target;
+ break;
+ default:
+ _contentLoaded = true;
+ break;
+ }
+ }
+}
diff --git a/Decompiler/Gestor.Application.Views.Ferramentas/UsuarioView.cs b/Decompiler/Gestor.Application.Views.Ferramentas/UsuarioView.cs
new file mode 100644
index 0000000..e0fef14
--- /dev/null
+++ b/Decompiler/Gestor.Application.Views.Ferramentas/UsuarioView.cs
@@ -0,0 +1,570 @@
+using System;
+using System.CodeDom.Compiler;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Diagnostics;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Controls.Primitives;
+using System.Windows.Input;
+using System.Windows.Markup;
+using System.Windows.Threading;
+using Gestor.Application.Drawers;
+using Gestor.Application.Helpers;
+using Gestor.Application.Servicos;
+using Gestor.Application.ViewModels.Ferramentas;
+using Gestor.Application.Views.Generic;
+using Gestor.Common.Validation;
+using Gestor.Model.Common;
+using Gestor.Model.Domain.Common;
+using Gestor.Model.Domain.Configuracoes;
+using Gestor.Model.Domain.Generic;
+using Gestor.Model.Domain.Seguros;
+using Gestor.Model.License;
+
+namespace Gestor.Application.Views.Ferramentas;
+
+public class UsuarioView : BaseUserControl, IComponentConnector
+{
+ private bool _abrindoPermissao;
+
+ private bool _firstTime = true;
+
+ private bool _setting;
+
+ internal DataGrid UsuarioGrid;
+
+ internal MenuItem CancelarApoliceButton;
+
+ internal TextBox NomeBox;
+
+ internal TextBox CepBox;
+
+ internal TextBox EnderecoBox;
+
+ internal TextBox NumeroBox;
+
+ internal TextBox BairroBox;
+
+ internal TextBox CidadeBox;
+
+ internal TextBox EstadoBox;
+
+ private bool _contentLoaded;
+
+ public UsuarioViewModel ViewModel { get; set; }
+
+ public UsuarioView()
+ {
+ ((FrameworkElement)this).Tag = "CADASTRO DE USUÁRIOS";
+ ViewModel = new UsuarioViewModel();
+ ((FrameworkElement)this).DataContext = ViewModel;
+ InitializeComponent();
+ Dispatcher dispatcher = ((DispatcherObject)this).Dispatcher;
+ if (dispatcher != null)
+ {
+ dispatcher.BeginInvoke((DispatcherPriority)7, (Delegate)new Action(ContentLoad));
+ }
+ }
+
+ private void ScrollToItem()
+ {
+ if (((Selector)UsuarioGrid).SelectedItem != null)
+ {
+ ((UIElement)UsuarioGrid).UpdateLayout();
+ UsuarioGrid.ScrollIntoView(((Selector)UsuarioGrid).SelectedItem);
+ }
+ }
+
+ private async void ContentLoad()
+ {
+ ViewModel.Loading(isLoading: true);
+ await ViewModel.Seleciona();
+ ViewModel.Loading(isLoading: false);
+ }
+
+ private void Incluir_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.Incluir();
+ List<KeyValuePair<string, string>> errorMessages = ViewModel.SelectedUsuario.Validate();
+ ((DependencyObject)(object)this).ValidateFields(errorMessages);
+ ViewModel.IsExpanded = false;
+ ((UIElement)NomeBox).Focus();
+ }
+
+ private async void Cancelar_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.Loading(isLoading: true);
+ await ViewModel.CancelarAlteracao();
+ ViewModel.Loading(isLoading: false);
+ ScrollToItem();
+ }
+
+ 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)
+ {
+ ScrollToItem();
+ }
+ else
+ {
+ await ViewModel.ShowMessage(list, ViewModel.ErroCamposInvalidos, "OK");
+ }
+ }
+
+ private async void Alterar_OnClick(object sender, RoutedEventArgs e)
+ {
+ if (LicenseHelper.Produtos.Any((Licenca produto) => (int)produto.Produto == 91) && ViewModel.SelectedUsuario.Login.Contains("@"))
+ {
+ await ViewModel.ShowMessage("ALTERAÇÃO DESSE USUARIO TEM QUE SER FEITO NO PAINEL DO AGGILIZADOR.");
+ return;
+ }
+ await ViewModel.AlterarUsuario();
+ ((DomainBase)ViewModel.SelectedUsuario).Initialize();
+ ViewModel.CancelUsuario = (Usuario)((DomainBase)ViewModel.SelectedUsuario).Clone();
+ ViewModel.Alterar(alterar: true);
+ ViewModel.IsExpanded = false;
+ ((UIElement)NomeBox).Focus();
+ }
+
+ private async void Excluir_OnClick(object sender, RoutedEventArgs e)
+ {
+ if (LicenseHelper.Produtos.Any((Licenca produto) => (int)produto.Produto == 91) && ViewModel.SelectedUsuario.Login.Contains("@"))
+ {
+ await ViewModel.ShowMessage("EXCLUSÃO DESSE USUARIO TEM QUE SER FEITO NO PAINEL DO AGGILIZADOR.");
+ return;
+ }
+ await ViewModel.Excluir();
+ ScrollToItem();
+ }
+
+ private void AutoCompleteBancoBox_Populating(object sender, PopulatingEventArgs e)
+ {
+ if (e.Parameter.Length < 3)
+ {
+ return;
+ }
+ e.Cancel = true;
+ ViewModel.BuscarBanco(ValidationHelper.RemoveDiacritics(e.Parameter.Trim())).ContinueWith(delegate(Task<List<Banco>> 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 PostcodeBox_OnLostFocus(object sender, RoutedEventArgs e)
+ {
+ string text = ValidationHelper.FormatPostCode(((TextBox)sender).Text);
+ CepBox.Text = text;
+ if (ValidationHelper.ValidatePostCode(text))
+ {
+ EnderecoBase val = await ViewModel.BuscaCep(text);
+ if (val != null)
+ {
+ EnderecoBox.Text = val.Endereco;
+ CidadeBox.Text = val.Cidade;
+ EstadoBox.Text = val.Estado;
+ BairroBox.Text = val.Bairro;
+ }
+ }
+ }
+
+ private void AutoCompleteBoxUsuario_Populating(object sender, PopulatingEventArgs e)
+ {
+ e.Cancel = true;
+ ViewModel.Filtrar(ValidationHelper.RemoveDiacritics(e.Parameter.Trim())).ContinueWith(delegate(Task<List<Usuario>> 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.FiltrarUsuario("");
+ }
+ }
+
+ private async void UsuarioGrid_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ if (ViewModel.EnableGrid)
+ {
+ DataGrid val = (DataGrid)sender;
+ if (val == null || ((Selector)val).SelectedIndex >= 0)
+ {
+ ViewModel.EnableGrid = false;
+ await ViewModel.SelecionaUsuario((Usuario)((val != null) ? ((ItemsControl)val).Items[((Selector)val).SelectedIndex] : null));
+ ViewModel.EnableGrid = true;
+ }
+ }
+ }
+
+ private async void Permissoes_OnClick(object sender, RoutedEventArgs e)
+ {
+ if (!_abrindoPermissao)
+ {
+ PermissaoUsuario val = ((IEnumerable<PermissaoUsuario>)ViewModel.PermissaoUsuario).FirstOrDefault((Func<PermissaoUsuario, bool>)((PermissaoUsuario permissao) => (int)permissao.Tela == 43));
+ int num;
+ if (!Recursos.Usuario.Administrador && ((DomainBase)Recursos.Usuario).Id != 0L && !Recursos.Usuario.Nome.Contains("ACESSO AGGER") && val != null)
+ {
+ _ = val.Consultar;
+ num = ((!val.Consultar) ? 1 : 0);
+ }
+ else
+ {
+ num = 0;
+ }
+ bool flag = (byte)num != 0;
+ if (flag)
+ {
+ flag = await ViewModel.ShowMessage("VOCÊ NÃO POSSUI PERMISSÃO PARA ACESSAR PERMISSÕES.");
+ }
+ if (!flag)
+ {
+ _abrindoPermissao = true;
+ await ViewModel.OpenPermissao();
+ await Task.Delay(1000);
+ _abrindoPermissao = false;
+ }
+ }
+ }
+
+ private async void Vinculo_OnClick(object sender, RoutedEventArgs e)
+ {
+ await ViewModel.OpenVinculo();
+ }
+
+ private async void AbrirAquivoDigital_Click(object sender, RoutedEventArgs e)
+ {
+ if (!new PermissaoArquivoDigitalServico().BuscarPermissao(Recursos.Usuario, (TipoArquivoDigital)12).Consultar)
+ {
+ await ViewModel.ShowMessage("VOCÊ NÃO POSSUI PERMISSÃO PARA ACESSAR\nARQUIVO DIGITAL DE " + ValidationHelper.GetDescription((Enum)(object)(TipoArquivoDigital)12) + ".");
+ return;
+ }
+ ViewModel.EnableAlterar = false;
+ FiltroArquivoDigital filtro = new FiltroArquivoDigital
+ {
+ Id = ((DomainBase)ViewModel.SelectedUsuario).Id,
+ Tipo = (TipoArquivoDigital)12,
+ Parente = ViewModel.SelectedUsuario
+ };
+ ViewModel.ShowDrawer(new ArquivoDigitalDrawer(filtro), 0, close: false);
+ ViewModel.EnableAlterar = true;
+ }
+
+ private void AbrirLog_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.AbrirLog((TipoTela)16, ((DomainBase)ViewModel.SelectedUsuario).Id);
+ }
+
+ private async void AbrirLogAcesso_OnClick(object sender, RoutedEventArgs e)
+ {
+ await ViewModel.ShowLogAcessoDialog((TipoTela)49, ViewModel.SelectedUsuario);
+ }
+
+ private async void TelaInicial_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ if (_setting || ((Selector)(ComboBox)sender).SelectedItem == null)
+ {
+ return;
+ }
+ if ((int)(TipoTelaInicial)((Selector)(ComboBox)sender).SelectedItem == 1 && ViewModel.Restricao((TipoRestricao)47))
+ {
+ _setting = true;
+ ((Selector)(ComboBox)sender).SelectedItem = (object)(TipoTelaInicial)0;
+ _setting = false;
+ if (_firstTime)
+ {
+ _firstTime = false;
+ return;
+ }
+ await ViewModel.ShowMessage("FAVOR DESABILITAR A RESTRIÇÃO AO PAINEL B.I. ANTES.");
+ }
+ _firstTime = false;
+ }
+
+ private void CpfBox_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 async void CriarCartao_OnClick(object sender, RoutedEventArgs e)
+ {
+ bool dadosUsuario = Recursos.Configuracoes.Any((ConfiguracaoSistema x) => (int)x.Configuracao == 30);
+ await ViewModel.CriarCartao(dadosUsuario);
+ }
+
+ private async void Click_VerificaAdmCentralSegurado(object sender, RoutedEventArgs e)
+ {
+ await ViewModel.VerificaUsuarioAdmCentralSegurado();
+ }
+
+ [DebuggerNonUserCode]
+ [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
+ public void InitializeComponent()
+ {
+ if (!_contentLoaded)
+ {
+ _contentLoaded = true;
+ Uri uri = new Uri("/Gestor.Application;component/views/ferramentas/usuarioview.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_0086: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0092: Unknown result type (might be due to invalid IL or missing references)
+ //IL_009c: Expected O, but got Unknown
+ //IL_009d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00a9: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00b3: Expected O, but got Unknown
+ //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_00f2: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00fe: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0108: Expected O, but got Unknown
+ //IL_010b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0115: Expected O, but got Unknown
+ //IL_0122: Unknown result type (might be due to invalid IL or missing references)
+ //IL_012c: Expected O, but got Unknown
+ //IL_012e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_013a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0144: Expected O, but got Unknown
+ //IL_0146: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0152: Unknown result type (might be due to invalid IL or missing references)
+ //IL_015c: Expected O, but got Unknown
+ //IL_015e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_016a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0174: Expected O, but got Unknown
+ //IL_0176: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0182: Unknown result type (might be due to invalid IL or missing references)
+ //IL_018c: Expected O, but got Unknown
+ //IL_018e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_019a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01a4: Expected O, but got Unknown
+ //IL_01a6: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01b2: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01bc: Expected O, but got Unknown
+ //IL_01be: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01ca: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01d4: Expected O, but got Unknown
+ //IL_01d7: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01e1: Expected O, but got Unknown
+ //IL_01e3: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01f0: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01fa: Expected O, but got Unknown
+ //IL_01fb: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0207: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0211: Expected O, but got Unknown
+ //IL_0213: Unknown result type (might be due to invalid IL or missing references)
+ //IL_021f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0229: Expected O, but got Unknown
+ //IL_022b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0237: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0241: Expected O, but got Unknown
+ //IL_0242: Unknown result type (might be due to invalid IL or missing references)
+ //IL_024e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0258: Expected O, but got Unknown
+ //IL_0259: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0265: Unknown result type (might be due to invalid IL or missing references)
+ //IL_026f: Expected O, but got Unknown
+ //IL_0271: Unknown result type (might be due to invalid IL or missing references)
+ //IL_027d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0287: Expected O, but got Unknown
+ //IL_0288: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0294: Unknown result type (might be due to invalid IL or missing references)
+ //IL_029e: Expected O, but got Unknown
+ //IL_029f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02ab: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02b5: Expected O, but got Unknown
+ //IL_02b7: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02c3: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02cd: Expected O, but got Unknown
+ //IL_02d0: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02da: Expected O, but got Unknown
+ //IL_02e7: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02f1: Expected O, but got Unknown
+ //IL_02ff: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0309: Expected O, but got Unknown
+ //IL_030c: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0316: Expected O, but got Unknown
+ //IL_0319: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0323: Expected O, but got Unknown
+ //IL_0326: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0330: Expected O, but got Unknown
+ //IL_0333: Unknown result type (might be due to invalid IL or missing references)
+ //IL_033d: Expected O, but got Unknown
+ //IL_0340: Unknown result type (might be due to invalid IL or missing references)
+ //IL_034a: Expected O, but got Unknown
+ //IL_034c: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0359: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0363: Expected O, but got Unknown
+ //IL_0365: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0372: Unknown result type (might be due to invalid IL or missing references)
+ //IL_037c: Expected O, but got Unknown
+ //IL_037d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_038a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0394: Expected O, but got Unknown
+ //IL_0396: Unknown result type (might be due to invalid IL or missing references)
+ //IL_03a3: Unknown result type (might be due to invalid IL or missing references)
+ //IL_03ad: Expected O, but got Unknown
+ //IL_03af: Unknown result type (might be due to invalid IL or missing references)
+ //IL_03bc: Unknown result type (might be due to invalid IL or missing references)
+ //IL_03c6: Expected O, but got Unknown
+ //IL_03c7: Unknown result type (might be due to invalid IL or missing references)
+ //IL_03d4: Unknown result type (might be due to invalid IL or missing references)
+ //IL_03de: Expected O, but got Unknown
+ //IL_03e0: Unknown result type (might be due to invalid IL or missing references)
+ //IL_03ec: Unknown result type (might be due to invalid IL or missing references)
+ //IL_03f6: Expected O, but got Unknown
+ switch (connectionId)
+ {
+ case 1:
+ ((AutoCompleteBox)target).Populating += new PopulatingEventHandler(AutoCompleteBoxUsuario_Populating);
+ ((AutoCompleteBox)target).TextChanged += new RoutedEventHandler(AutoCompleteBox_OnTextChanged);
+ break;
+ case 2:
+ UsuarioGrid = (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:
+ CancelarApoliceButton = (MenuItem)target;
+ CancelarApoliceButton.Click += new RoutedEventHandler(Cancelar_OnClick);
+ break;
+ case 7:
+ ((MenuItem)target).Click += new RoutedEventHandler(Excluir_OnClick);
+ break;
+ case 8:
+ ((MenuItem)target).Click += new RoutedEventHandler(Permissoes_OnClick);
+ break;
+ case 9:
+ ((MenuItem)target).Click += new RoutedEventHandler(Vinculo_OnClick);
+ break;
+ case 10:
+ ((MenuItem)target).Click += new RoutedEventHandler(CriarCartao_OnClick);
+ break;
+ case 11:
+ ((MenuItem)target).Click += new RoutedEventHandler(AbrirLog_OnClick);
+ break;
+ case 12:
+ ((MenuItem)target).Click += new RoutedEventHandler(AbrirAquivoDigital_Click);
+ break;
+ case 13:
+ ((MenuItem)target).Click += new RoutedEventHandler(AbrirLogAcesso_OnClick);
+ break;
+ case 14:
+ NomeBox = (TextBox)target;
+ break;
+ case 15:
+ ((UIElement)(TextBox)target).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ ((UIElement)(TextBox)target).LostFocus += new RoutedEventHandler(CpfBox_OnLostFocus);
+ break;
+ case 16:
+ ((Selector)(ComboBox)target).SelectionChanged += new SelectionChangedEventHandler(TelaInicial_OnSelectionChanged);
+ break;
+ case 17:
+ ((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 18:
+ ((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 19:
+ ((AutoCompleteBox)target).Populating += new PopulatingEventHandler(AutoCompleteBancoBox_Populating);
+ break;
+ case 20:
+ CepBox = (TextBox)target;
+ ((UIElement)CepBox).LostFocus += new RoutedEventHandler(PostcodeBox_OnLostFocus);
+ ((UIElement)CepBox).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 21:
+ EnderecoBox = (TextBox)target;
+ break;
+ case 22:
+ NumeroBox = (TextBox)target;
+ break;
+ case 23:
+ BairroBox = (TextBox)target;
+ break;
+ case 24:
+ CidadeBox = (TextBox)target;
+ break;
+ case 25:
+ EstadoBox = (TextBox)target;
+ break;
+ case 26:
+ ((UIElement)(TextBox)target).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 27:
+ ((UIElement)(TextBox)target).LostFocus += new RoutedEventHandler(FormatarTelefone);
+ ((UIElement)(TextBox)target).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 28:
+ ((UIElement)(TextBox)target).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 29:
+ ((UIElement)(TextBox)target).LostFocus += new RoutedEventHandler(FormatarTelefone);
+ ((UIElement)(TextBox)target).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 30:
+ ((ButtonBase)(ToggleButton)target).Click += new RoutedEventHandler(Click_VerificaAdmCentralSegurado);
+ break;
+ default:
+ _contentLoaded = true;
+ break;
+ }
+ }
+}
diff --git a/Decompiler/Gestor.Application.Views.Ferramentas/VendedorView.cs b/Decompiler/Gestor.Application.Views.Ferramentas/VendedorView.cs
new file mode 100644
index 0000000..a0715bd
--- /dev/null
+++ b/Decompiler/Gestor.Application.Views.Ferramentas/VendedorView.cs
@@ -0,0 +1,896 @@
+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.Controls.Primitives;
+using System.Windows.Data;
+using System.Windows.Input;
+using System.Windows.Markup;
+using CurrencyTextBoxControl;
+using Gestor.Application.Drawers;
+using Gestor.Application.Helpers;
+using Gestor.Application.Servicos;
+using Gestor.Application.Servicos.Ferramentas;
+using Gestor.Application.ViewModels.Ferramentas;
+using Gestor.Application.Views.Generic;
+using Gestor.Common.Helpers;
+using Gestor.Common.Validation;
+using Gestor.Model.Common;
+using Gestor.Model.Domain.Common;
+using Gestor.Model.Domain.Generic;
+using Gestor.Model.Domain.Seguros;
+using Xceed.Wpf.AvalonDock.Controls;
+
+namespace Gestor.Application.Views.Ferramentas;
+
+public class VendedorView : BaseUserControl, IComponentConnector, IStyleConnector
+{
+ public VendedorViewModel ViewModel;
+
+ internal DataGrid VendedorGrid;
+
+ internal MenuItem IncluirButton;
+
+ internal MenuItem AlterarButton;
+
+ internal MenuItem SalvarButton;
+
+ internal MenuItem CancelarButton;
+
+ internal MenuItem MaisOpcoesButton;
+
+ internal TextBox EmpresaBox;
+
+ internal TextBox IdBox;
+
+ internal TextBox NomeBox;
+
+ internal TextBox DocumentoPrincipalBox;
+
+ internal AutoCompleteBox AutoCompleteBanco;
+
+ internal TextBox AgenciaBox;
+
+ internal ComboBox TipoBox;
+
+ internal TextBox ContaBox;
+
+ internal TextBox TitularBox;
+
+ internal TextBox TitularDocBox;
+
+ internal ComboBox TipoIncidenciaDescontoBox;
+
+ internal ToggleButton AtivoBox;
+
+ internal Grid GridContatos;
+
+ private bool _contentLoaded;
+
+ public bool UpdatingScroll { get; set; }
+
+ public VendedorView()
+ {
+ ((FrameworkElement)this).Tag = "CADASTRO DE VENDEDOR";
+ ViewModel = new VendedorViewModel();
+ ((FrameworkElement)this).DataContext = ViewModel;
+ InitializeComponent();
+ }
+
+ private void Incluir_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.Incluir();
+ AutoCompleteBanco.Text = "";
+ ValidarTela();
+ }
+
+ private void Cancelar_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.CancelarAlteracao();
+ ViewModel.IsExpanded = true;
+ if (((DomainBase)Recursos.Usuario).Id == 0L)
+ {
+ AlterarPropriaCorretora();
+ }
+ }
+
+ private async void Salvar_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.Loading(isLoading: true);
+ ViewModel.IsExpanded = true;
+ if (!ViewModel.SelectedVendedor.Ativo && await BuscaVinculo(ViewModel.SelectedVendedor))
+ {
+ return;
+ }
+ 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)
+ {
+ if (((DomainBase)Recursos.Usuario).Id == 0L)
+ {
+ AlterarPropriaCorretora();
+ }
+ ScrollVendedor();
+ }
+ else
+ {
+ await ViewModel.ShowMessage(list, ViewModel.ErroCamposInvalidos, "OK");
+ }
+ }
+
+ private async Task<bool> BuscaVinculo(Vendedor vendedor)
+ {
+ if (!(await new VendedorUsuarioServico().FindVinculo(vendedor)))
+ {
+ return false;
+ }
+ await ViewModel.ShowMessage("NÃO É POSSÍVEL INATIVAR VENDEDOR QUE POSSUI VINCULO DE USUÁRIO.");
+ ViewModel.Loading(isLoading: false);
+ return true;
+ }
+
+ private async void Adiantamento_Click(object sender, RoutedEventArgs e)
+ {
+ if (ViewModel.SelectedVendedor != null && ViewModel.SelectedVendedor.Corretora)
+ {
+ await ViewModel.ShowMessage("NÃO É POSSÍVEL ADICIONAR ADIANTAMENTOS PARA O VENDEDOR PRÓPRIA CORRETORA.");
+ }
+ else
+ {
+ ViewModel.ShowDrawer(new AdiantamentoDrawerView(ViewModel.SelectedVendedor), 0, close: false);
+ }
+ }
+
+ private void IncluirRepasse_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.IncluirRepasse();
+ ValidarTela();
+ }
+
+ private void IncluirTelefone_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.IncluirTelefone();
+ ValidarTela();
+ }
+
+ private void ExcluirTelefone_OnClick(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
+ Button val = (Button)((sender is Button) ? sender : null);
+ if (val != null)
+ {
+ ListBox val2 = Extentions.FindVisualAncestor<ListBox>((DependencyObject)(object)val);
+ VendedorTelefone telefone = (VendedorTelefone)((ItemsControl)val2).Items[((CollectionView)((ItemsControl)val2).Items).IndexOf(((FrameworkElement)val).DataContext)];
+ ViewModel.ExcluirTelefone(telefone);
+ }
+ }
+
+ private async void Alterar_OnClick(object sender, RoutedEventArgs e)
+ {
+ Vendedor selectedVendedor = ViewModel.SelectedVendedor;
+ bool flag = selectedVendedor != null && selectedVendedor.Corretora;
+ if (flag)
+ {
+ if (((DomainBase)Recursos.Usuario).Id != 0L)
+ {
+ await ViewModel.ShowMessage("NÃO É POSSÍVEL ALTERAR O VENDEDOR PRÓPRIA CORRETORA.");
+ return;
+ }
+ AlterarPropriaCorretora(habilitar: true);
+ }
+ ViewModel.IsExpanded = false;
+ VendedorViewModel viewModel = ViewModel;
+ Vendedor selectedVendedor2 = ViewModel.SelectedVendedor;
+ viewModel.CancelVendedor = (Vendedor)((selectedVendedor2 != null) ? ((DomainBase)selectedVendedor2).Clone() : null);
+ if (!flag)
+ {
+ ViewModel.Alterar(alterar: true);
+ }
+ ValidarTela();
+ }
+
+ public async void Button_Click(object sender, RoutedEventArgs e)
+ {
+ if (ViewModel.SelectedVendedor != null && ViewModel.SelectedVendedor.Corretora)
+ {
+ await ViewModel.ShowMessage("NÃO É POSSÍVEL CRIAR METAS DE VENDEDOR PARA O VENDEDOR PRÓPRIA CORRETORA.");
+ return;
+ }
+ ViewModel.Loading(isLoading: true);
+ if (await ViewModel.VerificarPermissao((TipoTela)30))
+ {
+ ViewModel.ShowDrawer(new MetaVendedorView(ViewModel.SelectedVendedor), 0, close: false);
+ ViewModel.Loading(isLoading: false);
+ }
+ }
+
+ private void TipoBox_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ //IL_0001: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0007: Expected O, but got Unknown
+ //IL_0030: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0036: Expected O, but got Unknown
+ //IL_004a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0050: Expected O, but got Unknown
+ //IL_0060: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0067: Expected O, but got Unknown
+ //IL_006d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0072: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0080: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0083: Invalid comparison between Unknown and I4
+ //IL_0085: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0088: Invalid comparison between Unknown and I4
+ ComboBox val = (ComboBox)sender;
+ if (((Selector)val).SelectedItem == null)
+ {
+ return;
+ }
+ ListBoxItem val2 = ((DependencyObject)(object)val).FindAncestor<ListBoxItem>().FirstOrDefault();
+ if (val2 == null)
+ {
+ return;
+ }
+ ComboBox val3 = (ComboBox)((FrameworkElement)FindVisualChild.Find<ComboBox>((DependencyObject)(object)val2)).FindName("FormaPagtoBox");
+ if (val3 == null)
+ {
+ return;
+ }
+ CurrencyTextBox val4 = (CurrencyTextBox)((FrameworkElement)FindVisualChild.Find<CurrencyTextBox>((DependencyObject)(object)val2)).FindName("ValorBox");
+ CurrencyTextBox val5 = (CurrencyTextBox)((FrameworkElement)FindVisualChild.Find<CurrencyTextBox>((DependencyObject)(object)val2)).FindName("RenovacoesBox");
+ TipoRepasse val6 = (TipoRepasse)((Selector)val).SelectedItem;
+ ((Selector)val3).SelectedItem = (object)(FormaRepasse)1;
+ if ((int)val6 != 1)
+ {
+ if ((int)val6 == 2)
+ {
+ if (val4 != null)
+ {
+ val4.MaximumValue = 100m;
+ }
+ if (val5 != null)
+ {
+ val5.MaximumValue = 100m;
+ }
+ }
+ }
+ else
+ {
+ if (val4 != null)
+ {
+ val4.MaximumValue = 10000m;
+ }
+ if (val5 != null)
+ {
+ val5.MaximumValue = 10000m;
+ }
+ }
+ }
+
+ private void FormaPagtoBox_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ //IL_0001: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0007: Expected O, but got Unknown
+ //IL_0030: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0036: Expected O, but got Unknown
+ //IL_003c: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0041: Unknown result type (might be due to invalid IL or missing references)
+ //IL_004d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_004f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0061: Expected I4, but got Unknown
+ ComboBox val = (ComboBox)sender;
+ if (((Selector)val).SelectedItem == null)
+ {
+ return;
+ }
+ Grid val2 = ((DependencyObject)(object)val).FindAncestor<Grid>().FirstOrDefault();
+ if (val2 == null)
+ {
+ return;
+ }
+ ComboBox val3 = (ComboBox)((FrameworkElement)FindVisualChild.Find<ComboBox>((DependencyObject)(object)val2)).FindName("BasePagtoBox");
+ FormaRepasse val4 = (FormaRepasse)((Selector)val).SelectedItem;
+ if (val3 != null)
+ {
+ ((UIElement)val3).IsEnabled = true;
+ switch (val4 - 1)
+ {
+ case 0:
+ ((Selector)val3).SelectedItem = null;
+ break;
+ case 1:
+ ((Selector)val3).SelectedItem = (object)(BaseRepasse)1;
+ break;
+ case 2:
+ ((Selector)val3).SelectedItem = (object)(BaseRepasse)3;
+ ((UIElement)val3).IsEnabled = false;
+ break;
+ }
+ }
+ }
+
+ private void AutoCompleteBancoBox_Populating(object sender, PopulatingEventArgs e)
+ {
+ if (e.Parameter.Length < 3)
+ {
+ return;
+ }
+ e.Cancel = true;
+ ViewModel.BuscarBanco(ValidationHelper.RemoveDiacritics(e.Parameter.Trim())).ContinueWith(delegate(Task<List<Banco>> 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 AutoCompleteBoxVendedor_Populating(object sender, PopulatingEventArgs e)
+ {
+ e.Cancel = true;
+ ViewModel.Filtrar(ValidationHelper.RemoveDiacritics(e.Parameter.Trim())).ContinueWith(delegate(Task<List<Vendedor>> 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.FiltrarVendedor("");
+ }
+ }
+
+ private async void AbrirAquivoDigital_Click(object sender, RoutedEventArgs e)
+ {
+ if (!new PermissaoArquivoDigitalServico().BuscarPermissao(Recursos.Usuario, (TipoArquivoDigital)6).Consultar)
+ {
+ await ViewModel.ShowMessage("VOCÊ NÃO POSSUI PERMISSÃO PARA ACESSAR\nARQUIVO DIGITAL DE " + EnumHelper.GetDescription<TipoArquivoDigital>((TipoArquivoDigital)6) + ".");
+ return;
+ }
+ FiltroArquivoDigital filtro = new FiltroArquivoDigital
+ {
+ Id = ((DomainBase)ViewModel.SelectedVendedor).Id,
+ Tipo = (TipoArquivoDigital)6,
+ Parente = ViewModel.SelectedVendedor
+ };
+ ViewModel.ShowDrawer(new ArquivoDigitalDrawer(filtro), 0, close: false);
+ }
+
+ private void AbrirLog_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.AbrirLog((TipoTela)15, ((DomainBase)ViewModel.SelectedVendedor).Id);
+ }
+
+ private void AbrirLogEmail_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.AbrirLogEmail((TipoTela)15, ((DomainBase)ViewModel.SelectedVendedor).Id);
+ }
+
+ private async void IncluirVinculo_OnClick(object sender, RoutedEventArgs e)
+ {
+ Button btn = (Button)sender;
+ if (((btn != null) ? ((FrameworkElement)btn).DataContext : null) == null)
+ {
+ return;
+ }
+ ViewModel.Loading(isLoading: true);
+ List<Repasse> repasses = await new VendedorServico().BuscaRepasses();
+ Repasse repasse = (Repasse)((FrameworkElement)btn).DataContext;
+ VinculoRepasse vinculo = new VinculoRepasse
+ {
+ IdRepasse = ((DomainBase)repasse).Id
+ };
+ if (!repasse.Ativo)
+ {
+ await ViewModel.ShowMessage("POR FAVOR, ATIVE O REPASSE PARA VINCULÁ-LO");
+ ViewModel.Loading(isLoading: false);
+ return;
+ }
+ VinculoRepasse response = await ViewModel.ShowVinculoDialog(vinculo, repasses, repasse);
+ if (response == null)
+ {
+ ViewModel.Loading(isLoading: false);
+ return;
+ }
+ List<KeyValuePair<string, string>> list = response.Validate(repasse.Vinculo, repasse);
+ while (list != null && list.Count > 0)
+ {
+ await ViewModel.ShowMessage(list, "OS CAMPOS ABAIXO ESTÃO INVÁLIDOS.", "OK");
+ response = await ViewModel.ShowVinculoDialog(response, repasses, repasse);
+ if (response == null)
+ {
+ ViewModel.Loading(isLoading: false);
+ return;
+ }
+ list = response.Validate(repasse.Vinculo, repasse);
+ }
+ await ViewModel.SalvarVinculo(response);
+ ViewModel.Loading(isLoading: false);
+ }
+
+ private async void ExcluirVinculo_OnClick(object sender, RoutedEventArgs e)
+ {
+ Button val = (Button)sender;
+ if (val != null && ((FrameworkElement)val).DataContext != null)
+ {
+ VinculoRepasse vinculo = (VinculoRepasse)((FrameworkElement)val).DataContext;
+ ViewModel.Loading(isLoading: true);
+ await ViewModel.ExcluirVinculo(vinculo);
+ ViewModel.Loading(isLoading: false);
+ }
+ }
+
+ private void AbrirLogRepasse_OnClick(object sender, RoutedEventArgs e)
+ {
+ //IL_0001: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0007: Expected O, but got Unknown
+ //IL_0019: Unknown result type (might be due to invalid IL or missing references)
+ //IL_001f: Expected O, but got Unknown
+ Button val = (Button)sender;
+ if (val != null && ((FrameworkElement)val).DataContext != null)
+ {
+ Repasse val2 = (Repasse)((FrameworkElement)val).DataContext;
+ ViewModel.AbrirLog((TipoTela)54, ((DomainBase)val2).Id);
+ }
+ }
+
+ private void DocumentoPrincipalBox_LostFocus(object sender, RoutedEventArgs e)
+ {
+ //IL_0001: Unknown result type (might be due to invalid IL or missing references)
+ if (!((TextBoxBase)(TextBox)sender).IsReadOnly)
+ {
+ string text = ValidationHelper.Clear(DocumentoPrincipalBox.Text);
+ if (!string.IsNullOrEmpty(text))
+ {
+ DocumentoPrincipalBox.Text = ((text.Length == 11) ? ValidationHelper.FormatDocument(text.PadLeft(11, '0').Substring(0, 11)) : ValidationHelper.FormatDocument(text.PadLeft(14, '0').Substring(0, 14)));
+ }
+ }
+ }
+
+ private void AutoCompleteBanco_OnLostKeyboardFocus(object sender, KeyboardFocusChangedEventArgs 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)
+ //IL_002e: Expected O, but got Unknown
+ AutoCompleteBox val = (AutoCompleteBox)sender;
+ SetValid(val, string.IsNullOrWhiteSpace(val.Text) || ViewModel.SelectedVendedor.Banco != null);
+ }
+
+ private static void SetValid(AutoCompleteBox autocomplete, bool valid)
+ {
+ ViewHelper.SetInvalid((Control)(object)autocomplete, "BANCO INVÁLIDO", valid);
+ }
+
+ private void ValidarTela()
+ {
+ if (ViewModel.SelectedVendedor != null)
+ {
+ List<KeyValuePair<string, string>> list = ViewModel.SelectedVendedor.Validate();
+ List<VendedorTelefone> telefones = ViewModel.SelectedVendedor.Telefones;
+ object obj;
+ if (telefones == null)
+ {
+ obj = null;
+ }
+ else
+ {
+ VendedorTelefone? obj2 = telefones.FirstOrDefault();
+ obj = ((obj2 != null) ? obj2.Validate() : null);
+ }
+ if (obj == null)
+ {
+ obj = new List<KeyValuePair<string, string>>();
+ }
+ list.AddRange((IEnumerable<KeyValuePair<string, string>>)obj);
+ ObservableCollection<Repasse> repasses = ViewModel.Repasses;
+ object obj3;
+ if (repasses == null)
+ {
+ obj3 = null;
+ }
+ else
+ {
+ Repasse? obj4 = repasses.FirstOrDefault();
+ obj3 = ((obj4 != null) ? obj4.Validate() : null);
+ }
+ if (obj3 == null)
+ {
+ obj3 = new List<KeyValuePair<string, string>>();
+ }
+ list.AddRange((IEnumerable<KeyValuePair<string, string>>)obj3);
+ ((DependencyObject)(object)this).ValidateFields(list, focusField: false);
+ }
+ }
+
+ private void VendedorView_SizeChanged(object sender, SizeChangedEventArgs 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)
+ //IL_005b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0028: Unknown result type (might be due to invalid IL or missing references)
+ Size newSize = e.NewSize;
+ if (((Size)(ref newSize)).Width > 1260.0)
+ {
+ ViewModel.GridHeight2 = new GridLength(0.0);
+ Grid.SetRow((UIElement)(object)GridContatos, 0);
+ Grid.SetColumn((UIElement)(object)GridContatos, 1);
+ }
+ else
+ {
+ ViewModel.GridHeight2 = new GridLength(1.0, (GridUnitType)2);
+ Grid.SetRow((UIElement)(object)GridContatos, 1);
+ Grid.SetColumn((UIElement)(object)GridContatos, 0);
+ }
+ }
+
+ private async void AtivarInativarVendedor_OnClick(object sender, RoutedEventArgs e)
+ {
+ if (ViewModel.SelectedVendedor != null)
+ {
+ if (ViewModel.SelectedVendedor.Corretora)
+ {
+ await ViewModel.ShowMessage("NÃO É POSSÍVEL ALTERAR O VENDEDOR PRÓPRIA CORRETORA.");
+ }
+ else if (!(await BuscaVinculo(ViewModel.SelectedVendedor)))
+ {
+ ViewModel.Loading(isLoading: true);
+ await ViewModel.AtivarInativarVendedor(ViewModel.SelectedVendedor);
+ ScrollVendedor();
+ ViewModel.Loading(isLoading: false);
+ }
+ }
+ }
+
+ private async void AtivarInativarRepasse_OnClick(object sender, RoutedEventArgs e)
+ {
+ if (ViewModel.SelectedVendedor.Corretora)
+ {
+ await ViewModel.ShowMessage("NÃO É POSSÍVEL ALTERAR O VENDEDOR PRÓPRIA CORRETORA.");
+ return;
+ }
+ Repasse val = (Repasse)((FrameworkElement)(Button)sender).DataContext;
+ if (val != null)
+ {
+ ViewModel.Loading(isLoading: true);
+ await ViewModel.AtivarInativarRepasse(val);
+ ScrollVendedor();
+ ViewModel.Loading(isLoading: false);
+ }
+ }
+
+ private void ScrollVendedor()
+ {
+ if (!UpdatingScroll && ((Selector)VendedorGrid).SelectedItem != null)
+ {
+ VendedorGrid.ScrollIntoView(((Selector)VendedorGrid).SelectedItem);
+ }
+ UpdatingScroll = false;
+ }
+
+ public void AlterarPropriaCorretora(bool habilitar = false)
+ {
+ if (habilitar)
+ {
+ ((TextBoxBase)NomeBox).IsReadOnly = false;
+ ((TextBoxBase)DocumentoPrincipalBox).IsReadOnly = false;
+ ((UIElement)AlterarButton).IsEnabled = false;
+ ((UIElement)SalvarButton).IsEnabled = true;
+ ((UIElement)CancelarButton).IsEnabled = true;
+ ((UIElement)IncluirButton).IsEnabled = false;
+ }
+ else
+ {
+ ((TextBoxBase)NomeBox).IsReadOnly = true;
+ ((TextBoxBase)DocumentoPrincipalBox).IsReadOnly = true;
+ ((UIElement)AlterarButton).IsEnabled = true;
+ ((UIElement)SalvarButton).IsEnabled = false;
+ ((UIElement)CancelarButton).IsEnabled = false;
+ ((UIElement)IncluirButton).IsEnabled = false;
+ }
+ }
+
+ [DebuggerNonUserCode]
+ [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
+ public void InitializeComponent()
+ {
+ if (!_contentLoaded)
+ {
+ _contentLoaded = true;
+ Uri uri = new Uri("/Gestor.Application;component/views/ferramentas/vendedorview.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_0096: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00a2: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00ac: Expected O, but got Unknown
+ //IL_00ad: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00b9: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00c3: Expected O, but got Unknown
+ //IL_00c6: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00d0: Expected O, but got Unknown
+ //IL_00d3: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00dd: Expected O, but got Unknown
+ //IL_00ea: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00f4: Expected O, but got Unknown
+ //IL_00f7: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0101: Expected O, but got Unknown
+ //IL_010e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0118: Expected O, but got Unknown
+ //IL_011b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0125: 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
+ //IL_013f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0149: Expected O, but got Unknown
+ //IL_0156: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0160: Expected O, but got Unknown
+ //IL_0162: Unknown result type (might be due to invalid IL or missing references)
+ //IL_016e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0178: Expected O, but got Unknown
+ //IL_017a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0186: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0190: Expected O, but got Unknown
+ //IL_0192: Unknown result type (might be due to invalid IL or missing references)
+ //IL_019e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01a8: Expected O, but got Unknown
+ //IL_01ab: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01b5: Expected O, but got Unknown
+ //IL_01b7: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01c3: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01cd: Expected O, but got Unknown
+ //IL_01cf: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01db: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01e5: Expected O, but got Unknown
+ //IL_01e8: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01f2: Expected O, but got Unknown
+ //IL_01f5: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01ff: Expected O, but got Unknown
+ //IL_0202: Unknown result type (might be due to invalid IL or missing references)
+ //IL_020c: Expected O, but got Unknown
+ //IL_020f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0219: Expected O, but got Unknown
+ //IL_0227: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0231: Expected O, but got Unknown
+ //IL_023e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0248: Expected O, but got Unknown
+ //IL_024b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0255: Expected O, but got Unknown
+ //IL_0262: Unknown result type (might be due to invalid IL or missing references)
+ //IL_026c: Expected O, but got Unknown
+ //IL_0279: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0283: Expected O, but got Unknown
+ //IL_0286: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0290: Expected O, but got Unknown
+ //IL_0293: Unknown result type (might be due to invalid IL or missing references)
+ //IL_029d: Expected O, but got Unknown
+ //IL_02a0: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02aa: Expected O, but got Unknown
+ //IL_02ad: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02b7: Expected O, but got Unknown
+ //IL_02ba: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02c4: Expected O, but got Unknown
+ //IL_02d2: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02dc: Expected O, but got Unknown
+ //IL_02df: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02e9: Expected O, but got Unknown
+ //IL_02ec: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02f6: Expected O, but got Unknown
+ //IL_02f8: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0304: Unknown result type (might be due to invalid IL or missing references)
+ //IL_030e: Expected O, but got Unknown
+ //IL_0310: Unknown result type (might be due to invalid IL or missing references)
+ //IL_031c: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0326: Expected O, but got Unknown
+ //IL_0329: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0333: Expected O, but got Unknown
+ //IL_0335: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0341: Unknown result type (might be due to invalid IL or missing references)
+ //IL_034b: Expected O, but got Unknown
+ switch (connectionId)
+ {
+ case 1:
+ ((AutoCompleteBox)target).Populating += new PopulatingEventHandler(AutoCompleteBoxVendedor_Populating);
+ ((AutoCompleteBox)target).TextChanged += new RoutedEventHandler(AutoCompleteBox_OnTextChanged);
+ break;
+ case 2:
+ VendedorGrid = (DataGrid)target;
+ break;
+ case 3:
+ IncluirButton = (MenuItem)target;
+ IncluirButton.Click += new RoutedEventHandler(Incluir_OnClick);
+ break;
+ case 4:
+ AlterarButton = (MenuItem)target;
+ AlterarButton.Click += new RoutedEventHandler(Alterar_OnClick);
+ break;
+ case 5:
+ SalvarButton = (MenuItem)target;
+ SalvarButton.Click += new RoutedEventHandler(Salvar_OnClick);
+ break;
+ case 6:
+ CancelarButton = (MenuItem)target;
+ CancelarButton.Click += new RoutedEventHandler(Cancelar_OnClick);
+ break;
+ case 7:
+ ((MenuItem)target).Click += new RoutedEventHandler(Adiantamento_Click);
+ break;
+ case 8:
+ ((MenuItem)target).Click += new RoutedEventHandler(Button_Click);
+ break;
+ case 9:
+ ((MenuItem)target).Click += new RoutedEventHandler(AbrirAquivoDigital_Click);
+ break;
+ case 10:
+ MaisOpcoesButton = (MenuItem)target;
+ break;
+ case 11:
+ ((MenuItem)target).Click += new RoutedEventHandler(AbrirLog_OnClick);
+ break;
+ case 12:
+ ((MenuItem)target).Click += new RoutedEventHandler(AbrirLogEmail_OnClick);
+ break;
+ case 13:
+ EmpresaBox = (TextBox)target;
+ break;
+ case 14:
+ IdBox = (TextBox)target;
+ break;
+ case 15:
+ NomeBox = (TextBox)target;
+ break;
+ case 16:
+ DocumentoPrincipalBox = (TextBox)target;
+ ((UIElement)DocumentoPrincipalBox).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ ((UIElement)DocumentoPrincipalBox).LostFocus += new RoutedEventHandler(DocumentoPrincipalBox_LostFocus);
+ break;
+ case 17:
+ AutoCompleteBanco = (AutoCompleteBox)target;
+ AutoCompleteBanco.Populating += new PopulatingEventHandler(AutoCompleteBancoBox_Populating);
+ ((UIElement)AutoCompleteBanco).LostKeyboardFocus += new KeyboardFocusChangedEventHandler(AutoCompleteBanco_OnLostKeyboardFocus);
+ break;
+ case 18:
+ AgenciaBox = (TextBox)target;
+ break;
+ case 19:
+ TipoBox = (ComboBox)target;
+ break;
+ case 20:
+ ContaBox = (TextBox)target;
+ break;
+ case 21:
+ TitularBox = (TextBox)target;
+ break;
+ case 22:
+ TitularDocBox = (TextBox)target;
+ ((UIElement)TitularDocBox).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 23:
+ TipoIncidenciaDescontoBox = (ComboBox)target;
+ break;
+ case 24:
+ AtivoBox = (ToggleButton)target;
+ break;
+ case 25:
+ ((ButtonBase)(Button)target).Click += new RoutedEventHandler(AtivarInativarVendedor_OnClick);
+ break;
+ case 26:
+ ((MenuItem)target).Click += new RoutedEventHandler(IncluirRepasse_OnClick);
+ break;
+ case 33:
+ GridContatos = (Grid)target;
+ break;
+ case 34:
+ ((MenuItem)target).Click += new RoutedEventHandler(IncluirTelefone_OnClick);
+ break;
+ default:
+ _contentLoaded = true;
+ break;
+ }
+ }
+
+ [DebuggerNonUserCode]
+ [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ void IStyleConnector.Connect(int connectionId, object target)
+ {
+ //IL_0037: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0043: Unknown result type (might be due to invalid IL or missing references)
+ //IL_004d: Expected O, but got Unknown
+ //IL_004f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_005b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0065: Expected O, but got Unknown
+ //IL_0067: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0073: Unknown result type (might be due to invalid IL or missing references)
+ //IL_007d: Expected O, but got Unknown
+ //IL_007f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_008b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0095: Expected O, but got Unknown
+ //IL_0097: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00a3: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00ad: Expected O, but got Unknown
+ //IL_00af: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00bb: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00c5: Expected O, but got Unknown
+ //IL_00c7: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00d3: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00dd: Expected O, but got Unknown
+ //IL_00df: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00ec: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00f6: Expected O, but got Unknown
+ //IL_00f8: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0105: Unknown result type (might be due to invalid IL or missing references)
+ //IL_010f: Expected O, but got Unknown
+ //IL_0110: Unknown result type (might be due to invalid IL or missing references)
+ //IL_011d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0127: Expected O, but got Unknown
+ switch (connectionId)
+ {
+ case 27:
+ ((ButtonBase)(Button)target).Click += new RoutedEventHandler(IncluirVinculo_OnClick);
+ break;
+ case 28:
+ ((ButtonBase)(Button)target).Click += new RoutedEventHandler(AbrirLogRepasse_OnClick);
+ break;
+ case 29:
+ ((Selector)(ComboBox)target).SelectionChanged += new SelectionChangedEventHandler(TipoBox_OnSelectionChanged);
+ break;
+ case 30:
+ ((Selector)(ComboBox)target).SelectionChanged += new SelectionChangedEventHandler(FormaPagtoBox_OnSelectionChanged);
+ break;
+ case 31:
+ ((ButtonBase)(Button)target).Click += new RoutedEventHandler(AtivarInativarRepasse_OnClick);
+ break;
+ case 32:
+ ((ButtonBase)(Button)target).Click += new RoutedEventHandler(ExcluirVinculo_OnClick);
+ break;
+ case 35:
+ ((ButtonBase)(Button)target).Click += new RoutedEventHandler(ExcluirTelefone_OnClick);
+ break;
+ case 36:
+ ((UIElement)(TextBox)target).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 37:
+ ((UIElement)(TextBox)target).LostFocus += new RoutedEventHandler(FormatarTelefone);
+ ((UIElement)(TextBox)target).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 33:
+ case 34:
+ break;
+ }
+ }
+}