summaryrefslogtreecommitdiff
path: root/Decompiler/Gestor.Application.Views.Seguros.Itens
diff options
context:
space:
mode:
Diffstat (limited to 'Decompiler/Gestor.Application.Views.Seguros.Itens')
-rw-r--r--Decompiler/Gestor.Application.Views.Seguros.Itens/AeronauticoView.cs373
-rw-r--r--Decompiler/Gestor.Application.Views.Seguros.Itens/AutoView.cs660
-rw-r--r--Decompiler/Gestor.Application.Views.Seguros.Itens/BuscarModeloView.cs83
-rw-r--r--Decompiler/Gestor.Application.Views.Seguros.Itens/ConsorcioView.cs312
-rw-r--r--Decompiler/Gestor.Application.Views.Seguros.Itens/GranizoView.cs378
-rw-r--r--Decompiler/Gestor.Application.Views.Seguros.Itens/PatrimonialView.cs480
-rw-r--r--Decompiler/Gestor.Application.Views.Seguros.Itens/RiscosDiversosView.cs670
-rw-r--r--Decompiler/Gestor.Application.Views.Seguros.Itens/VidaView.cs690
8 files changed, 3646 insertions, 0 deletions
diff --git a/Decompiler/Gestor.Application.Views.Seguros.Itens/AeronauticoView.cs b/Decompiler/Gestor.Application.Views.Seguros.Itens/AeronauticoView.cs
new file mode 100644
index 0000000..b4314ea
--- /dev/null
+++ b/Decompiler/Gestor.Application.Views.Seguros.Itens/AeronauticoView.cs
@@ -0,0 +1,373 @@
+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.Input;
+using System.Windows.Markup;
+using System.Windows.Threading;
+using Gestor.Application.Componentes;
+using Gestor.Application.Drawers;
+using Gestor.Application.Helpers;
+using Gestor.Application.Servicos;
+using Gestor.Application.ViewModels;
+using Gestor.Application.ViewModels.Seguros;
+using Gestor.Application.ViewModels.Seguros.Itens;
+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.Seguros.Itens;
+
+public class AeronauticoView : BaseUserControl, IComponentConnector
+{
+ public AeronauticoViewModel ViewModel;
+
+ private readonly MenuItemViewModel _menuItemViewModel;
+
+ private string _lastCategory = "";
+
+ internal MenuItem IncluirItemButton;
+
+ internal MenuItem SinistroButton;
+
+ internal RadioButton CoberturasRadioButton;
+
+ internal RadioButton MaisInformacoesRadioButton;
+
+ internal ContentControl ContentControl;
+
+ internal CustomItemValidation MaisInformacoes;
+
+ private bool _contentLoaded;
+
+ public AeronauticoView(MenuItemViewModel menuItemViewModel, bool lockInsert = false, bool substituir = false, ManutencaoItem manutencao = null, Item itemSelecionado = null, Ramo ramo = null, bool endossoRenovacao = false)
+ {
+ _menuItemViewModel = menuItemViewModel;
+ ViewModel = new AeronauticoViewModel(substituir, manutencao, itemSelecionado, ramo, endossoRenovacao);
+ ((FrameworkElement)this).DataContext = ViewModel;
+ InitializeComponent();
+ Dispatcher dispatcher = ((DispatcherObject)this).Dispatcher;
+ if (dispatcher != null)
+ {
+ dispatcher.BeginInvoke((DispatcherPriority)7, (Delegate)new Action(ContentLoad));
+ }
+ if (lockInsert)
+ {
+ ((UIElement)IncluirItemButton).IsEnabled = false;
+ ((UIElement)SinistroButton).Visibility = (Visibility)2;
+ }
+ }
+
+ public async Task Selecionar(Item item)
+ {
+ await ViewModel.SelecionaItem(item);
+ }
+
+ public void Manter(ManutencaoItem manutencao)
+ {
+ ViewModel.Manter(ConsultaViewModel.ItemSelecionado, manutencao);
+ }
+
+ public void Substituir()
+ {
+ ViewModel.Substituir(ConsultaViewModel.ItemSelecionado);
+ }
+
+ 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
+ ((ToggleButton)CoberturasRadioButton).Checked += new RoutedEventHandler(Documento_OnChecked);
+ ((ToggleButton)MaisInformacoesRadioButton).Checked += new RoutedEventHandler(Documento_OnChecked);
+ }
+
+ private void Documento_OnChecked(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
+ RadioButton val = (RadioButton)sender;
+ if (!string.IsNullOrEmpty(val.GroupName))
+ {
+ ViewModel.Descarregar();
+ ((UIElement)ContentControl).Visibility = (Visibility)2;
+ ((UIElement)MaisInformacoes).Visibility = (Visibility)2;
+ ((DependencyObject)(object)MaisInformacoes).ClearInvalid();
+ ((DependencyObject)(object)ContentControl).ClearInvalid();
+ if (!(((FrameworkElement)val).Name == "MaisInformacoesRadioButton"))
+ {
+ ((UIElement)ContentControl).Visibility = (Visibility)0;
+ ViewModel.CarregaCobertura();
+ }
+ else
+ {
+ ((UIElement)MaisInformacoes).Visibility = (Visibility)0;
+ }
+ }
+ }
+
+ private async void Incluir_OnClick(object sender, RoutedEventArgs e)
+ {
+ await ViewModel.Incluir();
+ List<KeyValuePair<string, string>> errorMessages = ViewModel.SelectedItem.Validate();
+ ((DependencyObject)(object)this).ValidateFields(errorMessages);
+ }
+
+ private async void Excluir_OnClick(object sender, RoutedEventArgs e)
+ {
+ await ViewModel.Excluir();
+ _menuItemViewModel?.RecarregarItens(null);
+ }
+
+ private void Cancelar_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.CancelarAlteracao();
+ }
+
+ public 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)
+ {
+ if (((DomainBase)ViewModel.SelectedItem).Id > 0)
+ {
+ _menuItemViewModel?.RecarregarItens(ViewModel.SelectedItem);
+ }
+ }
+ else
+ {
+ await ViewModel.ShowMessage(list, ViewModel.ErroCamposInvalidos, "OK");
+ }
+ }
+
+ private void Tipo_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ //IL_0001: Unknown result type (might be due to invalid IL or missing references)
+ //IL_000f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0019: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0047: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0051: Unknown result type (might be due to invalid IL or missing references)
+ //IL_008e: Unknown result type (might be due to invalid IL or missing references)
+ if (((Selector)(ComboBox)sender).SelectedItem != null && !(ValidationHelper.GetCategory((Enum)(object)(TipoAeronautico)((Selector)(ComboBox)sender).SelectedItem) == _lastCategory))
+ {
+ ViewModel.SelectedItem.Aeronautico.Tipo = (TipoAeronautico)((Selector)(ComboBox)sender).SelectedItem;
+ ViewModel.UpdateAero();
+ ((DependencyObject)(object)this).ValidateFields(ViewModel.SelectedItem.Validate());
+ _lastCategory = ValidationHelper.GetCategory((Enum)(object)ViewModel.SelectedItem.Aeronautico.Tipo);
+ }
+ }
+
+ private void Alterar_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.Alterar(alterar: true);
+ }
+
+ private async void AbrirAquivoDigital_Click(object sender, RoutedEventArgs e)
+ {
+ if (!new PermissaoArquivoDigitalServico().BuscarPermissao(Recursos.Usuario, (TipoArquivoDigital)4).Consultar)
+ {
+ await ViewModel.ShowMessage("VOCÊ NÃO POSSUI PERMISSÃO PARA ACESSAR\nARQUIVO DIGITAL DE " + ValidationHelper.GetDescription((Enum)(object)(TipoArquivoDigital)4) + ".");
+ return;
+ }
+ FiltroArquivoDigital filtro = new FiltroArquivoDigital
+ {
+ Id = ((DomainBase)ViewModel.SelectedItem).Id,
+ IdApolice = ((DomainBase)ViewModel.SelectedItem.Documento).Id,
+ Tipo = (TipoArquivoDigital)4,
+ Parente = ViewModel.SelectedItem
+ };
+ ViewModel.ShowDrawer(new ArquivoDigitalDrawer(filtro), 0, close: false);
+ }
+
+ private void AbrirLog_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.AbrirLog((TipoTela)3, ((DomainBase)ViewModel.SelectedItem).Id);
+ }
+
+ private void AbrirLogEmail_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.AbrirLogEmail((TipoTela)3, ((DomainBase)ViewModel.SelectedItem).Id);
+ }
+
+ private void MenuItem_OnClick(object sender, RoutedEventArgs e)
+ {
+ ((Window)new HosterWindow((ContentControl)(object)new SinistroView(ViewModel.SelectedItem, attached: false), "CADASTRO DE SINISTROS - " + ViewModel.SelectedItem.Descricao)).ShowDialog();
+ _menuItemViewModel?.RecarregarItens(ViewModel.SelectedItem);
+ }
+
+ private void CopyCodItem(object sender, MouseButtonEventArgs e)
+ {
+ ViewModel.CodigoItem.CopyToClipboard();
+ ViewModel.ToggleSnackBar("COPIADO - " + ViewModel.CodigoItem);
+ }
+
+ [DebuggerNonUserCode]
+ [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
+ public void InitializeComponent()
+ {
+ if (!_contentLoaded)
+ {
+ _contentLoaded = true;
+ Uri uri = new Uri("/Gestor.Application;component/views/seguros/itens/aeronauticoview.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_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_0082: Unknown result type (might be due to invalid IL or missing references)
+ //IL_008e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0098: Expected O, but got Unknown
+ //IL_009a: Unknown result type (might be due to invalid IL or missing references)
+ //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
+ //IL_00ca: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00d6: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00e0: Expected O, but got Unknown
+ //IL_00e2: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00ee: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00f8: Expected O, but got Unknown
+ //IL_00fa: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0106: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0110: Expected O, but got Unknown
+ //IL_0113: Unknown result type (might be due to invalid IL or missing references)
+ //IL_011d: Expected O, but got Unknown
+ //IL_012a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0134: Expected O, but got Unknown
+ //IL_0136: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0142: Unknown result type (might be due to invalid IL or missing references)
+ //IL_014c: Expected O, but got Unknown
+ //IL_014e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_015a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0164: Expected O, but got Unknown
+ //IL_0166: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0172: Unknown result type (might be due to invalid IL or missing references)
+ //IL_017c: Expected O, but got Unknown
+ //IL_017e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_018b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0195: Expected O, but got Unknown
+ //IL_0197: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01a4: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01ae: Expected O, but got Unknown
+ //IL_01b0: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01bd: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01c7: Expected O, but got Unknown
+ //IL_01c9: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01d6: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01e0: Expected O, but got Unknown
+ //IL_01e2: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01ee: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01f8: Expected O, but got Unknown
+ //IL_01f9: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0205: Unknown result type (might be due to invalid IL or missing references)
+ //IL_020f: Expected O, but got Unknown
+ //IL_0210: Unknown result type (might be due to invalid IL or missing references)
+ //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_0236: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0240: Expected O, but got Unknown
+ //IL_0243: Unknown result type (might be due to invalid IL or missing references)
+ //IL_024d: Expected O, but got Unknown
+ switch (connectionId)
+ {
+ case 1:
+ IncluirItemButton = (MenuItem)target;
+ IncluirItemButton.Click += new RoutedEventHandler(Incluir_OnClick);
+ break;
+ case 2:
+ ((MenuItem)target).Click += new RoutedEventHandler(Alterar_OnClick);
+ break;
+ case 3:
+ ((MenuItem)target).Click += new RoutedEventHandler(Salvar_OnClick);
+ break;
+ case 4:
+ ((MenuItem)target).Click += new RoutedEventHandler(Cancelar_OnClick);
+ break;
+ case 5:
+ ((MenuItem)target).Click += new RoutedEventHandler(Excluir_OnClick);
+ break;
+ case 6:
+ ((Control)(TextBox)target).MouseDoubleClick += new MouseButtonEventHandler(CopyCodItem);
+ break;
+ case 7:
+ ((MenuItem)target).Click += new RoutedEventHandler(AbrirAquivoDigital_Click);
+ break;
+ case 8:
+ SinistroButton = (MenuItem)target;
+ SinistroButton.Click += new RoutedEventHandler(MenuItem_OnClick);
+ break;
+ case 9:
+ ((MenuItem)target).Click += new RoutedEventHandler(AbrirLog_OnClick);
+ break;
+ case 10:
+ ((MenuItem)target).Click += new RoutedEventHandler(AbrirLogEmail_OnClick);
+ break;
+ case 11:
+ ((Selector)(ComboBox)target).SelectionChanged += new SelectionChangedEventHandler(Tipo_OnSelectionChanged);
+ break;
+ case 12:
+ ((UIElement)(TextBox)target).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 13:
+ ((UIElement)(TextBox)target).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 14:
+ ((UIElement)(TextBox)target).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 15:
+ ((UIElement)(TextBox)target).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 16:
+ ((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 17:
+ CoberturasRadioButton = (RadioButton)target;
+ break;
+ case 18:
+ MaisInformacoesRadioButton = (RadioButton)target;
+ break;
+ case 19:
+ ContentControl = (ContentControl)target;
+ break;
+ case 20:
+ MaisInformacoes = (CustomItemValidation)target;
+ break;
+ default:
+ _contentLoaded = true;
+ break;
+ }
+ }
+}
diff --git a/Decompiler/Gestor.Application.Views.Seguros.Itens/AutoView.cs b/Decompiler/Gestor.Application.Views.Seguros.Itens/AutoView.cs
new file mode 100644
index 0000000..f5a5284
--- /dev/null
+++ b/Decompiler/Gestor.Application.Views.Seguros.Itens/AutoView.cs
@@ -0,0 +1,660 @@
+using System;
+using System.CodeDom.Compiler;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Diagnostics;
+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.Actions;
+using Gestor.Application.Componentes;
+using Gestor.Application.Drawers;
+using Gestor.Application.Helpers;
+using Gestor.Application.Servicos;
+using Gestor.Application.ViewModels;
+using Gestor.Application.ViewModels.Seguros;
+using Gestor.Application.ViewModels.Seguros.Itens;
+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.Helper;
+
+namespace Gestor.Application.Views.Seguros.Itens;
+
+public class AutoView : BaseUserControl, IComponentConnector
+{
+ public AutoViewModel ViewModel;
+
+ private readonly MenuItemViewModel _menuItemViewModel;
+
+ internal MenuItem IncluirItemButton;
+
+ internal MenuItem SinistroButton;
+
+ internal WrapPanel PainelDadosAuto;
+
+ internal TextBox FipeBox;
+
+ internal AutoCompleteBox AutoCompleteFabricacao;
+
+ internal TextBox ModeloBox;
+
+ internal TextBox AnoModeloBox;
+
+ internal TextBox CepCirculacaoBox;
+
+ internal TextBox CepPernoiteBox;
+
+ internal ComboBox ComboBoxTipoCorrecao;
+
+ internal RadioButton CoberturasRadioButton;
+
+ internal RadioButton MaisInformacoesRadioButton;
+
+ internal ContentControl ContentControl;
+
+ internal CustomItemValidation MaisInformacoes;
+
+ private bool _contentLoaded;
+
+ public AutoView(MenuItemViewModel menuItemViewModel, bool lockInsert = false, bool substituir = false, ManutencaoItem manutencao = null, Item itemSelecionado = null, Ramo ramo = null, bool endossoRenovacao = false)
+ {
+ _menuItemViewModel = menuItemViewModel;
+ ViewModel = new AutoViewModel(substituir, manutencao, itemSelecionado, ramo, endossoRenovacao);
+ ((FrameworkElement)this).DataContext = ViewModel;
+ InitializeComponent();
+ Dispatcher dispatcher = ((DispatcherObject)this).Dispatcher;
+ if (dispatcher != null)
+ {
+ dispatcher.BeginInvoke((DispatcherPriority)7, (Delegate)new Action(ContentLoad));
+ }
+ if (lockInsert)
+ {
+ ((UIElement)IncluirItemButton).IsEnabled = false;
+ ((UIElement)SinistroButton).Visibility = (Visibility)2;
+ }
+ }
+
+ public async Task Selecionar(Item item)
+ {
+ await ViewModel.SelecionaItem(item);
+ }
+
+ public void Manter(ManutencaoItem manutencao)
+ {
+ ViewModel.Manter(ConsultaViewModel.ItemSelecionado, manutencao);
+ }
+
+ public void Substituir()
+ {
+ ViewModel.Substituir(ConsultaViewModel.ItemSelecionado);
+ }
+
+ 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
+ ((ToggleButton)CoberturasRadioButton).Checked += new RoutedEventHandler(Documento_OnChecked);
+ ((ToggleButton)MaisInformacoesRadioButton).Checked += new RoutedEventHandler(Documento_OnChecked);
+ }
+
+ private void Documento_OnChecked(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
+ RadioButton val = (RadioButton)sender;
+ if (!string.IsNullOrEmpty(val.GroupName))
+ {
+ ViewModel.Descarregar();
+ ((UIElement)ContentControl).Visibility = (Visibility)2;
+ ((UIElement)MaisInformacoes).Visibility = (Visibility)2;
+ ((DependencyObject)(object)MaisInformacoes).ClearInvalid();
+ ((DependencyObject)(object)ContentControl).ClearInvalid();
+ if (!(((FrameworkElement)val).Name == "MaisInformacoesRadioButton"))
+ {
+ ((UIElement)ContentControl).Visibility = (Visibility)0;
+ ViewModel.CarregaCobertura();
+ }
+ else
+ {
+ ((UIElement)MaisInformacoes).Visibility = (Visibility)0;
+ }
+ }
+ }
+
+ private async void Incluir_OnClick(object sender, RoutedEventArgs e)
+ {
+ await ViewModel.Incluir();
+ List<KeyValuePair<string, string>> errorMessages = ViewModel.SelectedItem.Validate(Recursos.Configuracoes.Any((ConfiguracaoSistema x) => (int)x.Configuracao == 18), Recursos.Configuracoes.Any((ConfiguracaoSistema x) => (int)x.Configuracao == 27));
+ ((DependencyObject)(object)this).ValidateFields(errorMessages);
+ }
+
+ private async void Excluir_OnClick(object sender, RoutedEventArgs e)
+ {
+ if (await ViewModel.Excluir())
+ {
+ _menuItemViewModel?.RecarregarItens(null);
+ }
+ }
+
+ private void Cancelar_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.CancelarAlteracao();
+ }
+
+ public async void Salvar_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.Loading(isLoading: true);
+ ((UIElement)FipeBox).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)
+ {
+ if (((DomainBase)ViewModel.SelectedItem).Id > 0)
+ {
+ _menuItemViewModel?.RecarregarItens(ViewModel.SelectedItem);
+ }
+ }
+ else
+ {
+ await ViewModel.ShowMessage(list, ViewModel.ErroCamposInvalidos, "OK");
+ }
+ }
+
+ private void Alterar_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.Alterar(alterar: true);
+ }
+
+ private async void AbrirAquivoDigital_Click(object sender, RoutedEventArgs e)
+ {
+ if (!new PermissaoArquivoDigitalServico().BuscarPermissao(Recursos.Usuario, (TipoArquivoDigital)4).Consultar)
+ {
+ await ViewModel.ShowMessage("VOCÊ NÃO POSSUI PERMISSÃO PARA ACESSAR\nARQUIVO DIGITAL DE " + ValidationHelper.GetDescription((Enum)(object)(TipoArquivoDigital)4) + ".");
+ return;
+ }
+ FiltroArquivoDigital filtro = new FiltroArquivoDigital
+ {
+ Id = ((DomainBase)ViewModel.SelectedItem).Id,
+ IdApolice = ((DomainBase)ViewModel.SelectedItem.Documento).Id,
+ Tipo = (TipoArquivoDigital)4,
+ Parente = ViewModel.SelectedItem
+ };
+ ViewModel.ShowDrawer(new ArquivoDigitalDrawer(filtro), 0, close: false);
+ }
+
+ private void Cep_OnLostFocus(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
+ TextBox val = (TextBox)sender;
+ Item selectedItem = ViewModel.SelectedItem;
+ if (((selectedItem != null) ? selectedItem.Auto : null) != null && !string.IsNullOrWhiteSpace(val.Text) && ((!(((FrameworkElement)val).Name == "CepCirculacaoBox") && !(((FrameworkElement)val).Name == "CepPernoiteBox")) || !ValidationHelper.ValidaCep(val.Text)) && ValidationHelper.ValidacaoCep(ValidationHelper.FormatPostCode(val.Text)))
+ {
+ val.Text = ValidationHelper.FormatPostCode(val.Text);
+ }
+ }
+
+ private void AutoCompleteFabricanteBox_Populating(object sender, PopulatingEventArgs e)
+ {
+ if (e.Parameter.Length < 3)
+ {
+ return;
+ }
+ e.Cancel = true;
+ ViewModel.BuscaFabricante(ValidationHelper.RemoveDiacritics(e.Parameter.Trim())).ContinueWith(delegate(Task<List<Fabricante>> 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 Fipe_LostFocus(object sender, RoutedEventArgs e)
+ {
+ TextBox box = (TextBox)sender;
+ Item selectedItem = ViewModel.SelectedItem;
+ if (((selectedItem != null) ? selectedItem.Auto : null) == null || string.IsNullOrWhiteSpace(box.Text))
+ {
+ return;
+ }
+ string text = ValidationHelper.FormataFipe(box.Text.Replace("-", ""));
+ if (!ValidationHelper.ValidaFipe(text))
+ {
+ return;
+ }
+ box.Text = text;
+ if (int.TryParse(ValidationHelper.OnlyNumber(text), out var result) && result == 0)
+ {
+ return;
+ }
+ Fipe modelo = await ViewModel.BuscaModelo(box.Text);
+ if (modelo == null)
+ {
+ ViewModel.ToggleSnackBar("MODELO NÃO ENCONTRADO PARA O CÓDIGO FIPE " + box.Text);
+ return;
+ }
+ ModeloBox.Text = modelo.Modelo;
+ AutoCompleteFabricacao.SelectedItem = ViewModel.Fabricantes?.FirstOrDefault((Func<Fabricante, bool>)((Fabricante x) => x.Descricao == modelo.Marca));
+ }
+
+ private async void BuscarModelo_OnClick(object sender, RoutedEventArgs e)
+ {
+ Fipe fipe = await ViewModel.ShowBuscaModeloDialog(ModeloBox.Text, AnoModeloBox.Text);
+ if (fipe != null)
+ {
+ FipeBox.Text = fipe.Codigo;
+ ModeloBox.Text = fipe.Modelo;
+ AutoCompleteFabricacao.Text = fipe.Marca;
+ ViewModel.SelectedItem.Auto.Fabricante = ((IEnumerable<Fabricante>)ViewModel.Fabricantes).FirstOrDefault((Func<Fabricante, bool>)((Fabricante x) => x.Descricao == fipe.Marca));
+ }
+ }
+
+ private void AbrirLog_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.AbrirLog((TipoTela)3, ((DomainBase)ViewModel.SelectedItem).Id);
+ }
+
+ private void AbrirLogEmail_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.AbrirLogEmail((TipoTela)3, ((DomainBase)ViewModel.SelectedItem).Id);
+ }
+
+ private void ZeroKmToggleButton_Changed(object sender, RoutedEventArgs e)
+ {
+ if (ViewModel.SelectedItem != null)
+ {
+ List<KeyValuePair<string, string>> errorMessages = ViewModel.SelectedItem.Validate();
+ ((DependencyObject)(object)this).ValidateFields(errorMessages);
+ }
+ }
+
+ private void ComboBoxTipoCorrecao_SelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ if (((Selector)ComboBoxTipoCorrecao).SelectedItem != null)
+ {
+ ViewModel.Atualiza(((Selector)ComboBoxTipoCorrecao).SelectedItem.ToString().ToUpper());
+ }
+ }
+
+ private async void ImportarXls_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.Loading(isLoading: true);
+ Gestor.Application.Actions.Actions.EnablePesquisarClientes?.Invoke(obj: false);
+ Gestor.Application.Actions.Actions.EnableMenu?.Invoke(obj: false);
+ Gestor.Application.Actions.Actions.EnableMainMenu?.Invoke(obj: false);
+ List<KeyValuePair<string, string>> list = await ViewModel.ImportarXls();
+ bool num = list == null || list.Count == 0;
+ Gestor.Application.Actions.Actions.EnablePesquisarClientes?.Invoke(obj: true);
+ Gestor.Application.Actions.Actions.EnableMenu?.Invoke(obj: true);
+ Gestor.Application.Actions.Actions.EnableMainMenu?.Invoke(obj: true);
+ ViewModel.Loading(isLoading: false);
+ if (num)
+ {
+ if (((DomainBase)ViewModel.SelectedItem).Id > 0)
+ {
+ _menuItemViewModel?.RecarregarItens(ViewModel.SelectedItem);
+ }
+ }
+ else
+ {
+ await ViewModel.ShowMessage(list, ViewModel.ErroCamposInvalidos, "OK");
+ }
+ }
+
+ private void BaixarXls_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.BaixarXls();
+ }
+
+ private void MenuItem_OnClick(object sender, RoutedEventArgs e)
+ {
+ ((Window)new HosterWindow((ContentControl)(object)new SinistroView(ViewModel.SelectedItem, attached: false), "CADASTRO DE SINISTROS - " + ViewModel.SelectedItem.Descricao)).ShowDialog();
+ _menuItemViewModel?.RecarregarItens(ViewModel.SelectedItem);
+ }
+
+ private void Renavam_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;
+ string text = ValidationHelper.FormatRenavam(val.Text);
+ val.Text = text;
+ }
+
+ private void Ci_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;
+ string text = ValidationHelper.FormatCi(val.Text);
+ val.Text = text;
+ }
+
+ private void CopyCodItem(object sender, MouseButtonEventArgs e)
+ {
+ ViewModel.CodigoItem.CopyToClipboard();
+ ViewModel.ToggleSnackBar("COPIADO - " + ViewModel.CodigoItem);
+ }
+
+ private void SelecionaUsoVeiculo(object sender, SelectionChangedEventArgs e)
+ {
+ //IL_000e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0014: Invalid comparison between Unknown and I4
+ //IL_0024: Unknown result type (might be due to invalid IL or missing references)
+ //IL_002a: Invalid comparison between Unknown and I4
+ if ((int)ViewModel.UsoVeiculo.GetValueOrDefault() == 2 || (int)ViewModel.UsoVeiculo.GetValueOrDefault() == 3)
+ {
+ ViewModel.SelectedItem.Auto.Categoria = (Categoria)3;
+ }
+ }
+
+ private void KeyUpBase_OnKeyUp(object sender, KeyEventArgs e)
+ {
+ //IL_0001: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0007: Expected O, but got Unknown
+ TextBox val = (TextBox)sender;
+ if (!Regex.IsMatch(val.Text.Replace(".", ""), "^[0-9.]{11}$"))
+ {
+ val.Text = Regex.Replace(val.Text, "[^\\d]*", "");
+ }
+ }
+
+ private void Placa(object sender, KeyEventArgs e)
+ {
+ //IL_0001: Unknown result type (might be due to invalid IL or missing references)
+ ValidationHelper.FormataPlaca(((TextBox)sender).Text);
+ }
+
+ [DebuggerNonUserCode]
+ [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
+ public void InitializeComponent()
+ {
+ if (!_contentLoaded)
+ {
+ _contentLoaded = true;
+ Uri uri = new Uri("/Gestor.Application;component/views/seguros/itens/autoview.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_0097: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00a1: Expected O, but got Unknown
+ //IL_00ae: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00b8: Expected O, but got Unknown
+ //IL_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_00ea: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00f6: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0100: Expected O, but got Unknown
+ //IL_0102: Unknown result type (might be due to invalid IL or missing references)
+ //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_0132: Unknown result type (might be due to invalid IL or missing references)
+ //IL_013e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0148: Expected O, but got Unknown
+ //IL_014b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0155: Expected O, but got Unknown
+ //IL_0162: Unknown result type (might be due to invalid IL or missing references)
+ //IL_016c: Expected O, but got Unknown
+ //IL_016e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_017a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0184: Expected O, but got Unknown
+ //IL_0186: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0192: Unknown result type (might be due to invalid IL or missing references)
+ //IL_019c: Expected O, but got Unknown
+ //IL_019e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01aa: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01b4: Expected O, but got Unknown
+ //IL_01b6: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01c2: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01cc: Expected O, but got Unknown
+ //IL_01cf: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01d9: Expected O, but got Unknown
+ //IL_01dc: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01e6: Expected O, but got Unknown
+ //IL_01f4: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01fe: 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_0217: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0224: Unknown result type (might be due to invalid IL or missing references)
+ //IL_022e: Expected O, but got Unknown
+ //IL_022f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_023b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0245: 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_025f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0269: Expected O, but got Unknown
+ //IL_026c: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0276: Expected O, but got Unknown
+ //IL_0278: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0284: Unknown result type (might be due to invalid IL or missing references)
+ //IL_028e: Expected O, but got Unknown
+ //IL_0290: Unknown result type (might be due to invalid IL or missing references)
+ //IL_029c: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02a6: Expected O, but got Unknown
+ //IL_02a8: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02b5: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02bf: Expected O, but got Unknown
+ //IL_02c0: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02cc: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02d6: Expected O, but got Unknown
+ //IL_02d7: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02e3: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02ed: Expected O, but got Unknown
+ //IL_02ef: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02fb: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0305: Expected O, but got Unknown
+ //IL_0306: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0312: Unknown result type (might be due to invalid IL or missing references)
+ //IL_031c: Expected O, but got Unknown
+ //IL_031e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_032b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0335: Expected O, but got Unknown
+ //IL_0338: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0342: Expected O, but got Unknown
+ //IL_0350: Unknown result type (might be due to invalid IL or missing references)
+ //IL_035a: Expected O, but got Unknown
+ //IL_035c: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0369: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0373: Expected O, but got Unknown
+ //IL_0375: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0382: Unknown result type (might be due to invalid IL or missing references)
+ //IL_038c: Expected O, but got Unknown
+ //IL_038f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0399: Expected O, but got Unknown
+ //IL_03a6: Unknown result type (might be due to invalid IL or missing references)
+ //IL_03b0: Expected O, but got Unknown
+ //IL_03be: Unknown result type (might be due to invalid IL or missing references)
+ //IL_03c8: Expected O, but got Unknown
+ //IL_03cb: Unknown result type (might be due to invalid IL or missing references)
+ //IL_03d5: Expected O, but got Unknown
+ //IL_03e2: Unknown result type (might be due to invalid IL or missing references)
+ //IL_03ec: Expected O, but got Unknown
+ //IL_03fa: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0404: Expected O, but got Unknown
+ //IL_0407: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0411: Expected O, but got Unknown
+ //IL_041e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0428: Expected O, but got Unknown
+ //IL_042a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0436: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0440: Expected O, but got Unknown
+ //IL_0441: Unknown result type (might be due to invalid IL or missing references)
+ //IL_044e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0458: Expected O, but got Unknown
+ //IL_045a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0467: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0471: Expected O, but got Unknown
+ //IL_0474: Unknown result type (might be due to invalid IL or missing references)
+ //IL_047e: Expected O, but got Unknown
+ //IL_0481: Unknown result type (might be due to invalid IL or missing references)
+ //IL_048b: Expected O, but got Unknown
+ //IL_048e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0498: Expected O, but got Unknown
+ switch (connectionId)
+ {
+ case 1:
+ IncluirItemButton = (MenuItem)target;
+ IncluirItemButton.Click += new RoutedEventHandler(Incluir_OnClick);
+ break;
+ case 2:
+ ((MenuItem)target).Click += new RoutedEventHandler(Alterar_OnClick);
+ break;
+ case 3:
+ ((MenuItem)target).Click += new RoutedEventHandler(Salvar_OnClick);
+ break;
+ case 4:
+ ((MenuItem)target).Click += new RoutedEventHandler(Cancelar_OnClick);
+ break;
+ case 5:
+ ((MenuItem)target).Click += new RoutedEventHandler(Excluir_OnClick);
+ break;
+ case 6:
+ ((Control)(TextBox)target).MouseDoubleClick += new MouseButtonEventHandler(CopyCodItem);
+ break;
+ case 7:
+ ((MenuItem)target).Click += new RoutedEventHandler(AbrirAquivoDigital_Click);
+ break;
+ case 8:
+ SinistroButton = (MenuItem)target;
+ SinistroButton.Click += new RoutedEventHandler(MenuItem_OnClick);
+ break;
+ case 9:
+ ((MenuItem)target).Click += new RoutedEventHandler(AbrirLog_OnClick);
+ break;
+ case 10:
+ ((MenuItem)target).Click += new RoutedEventHandler(AbrirLogEmail_OnClick);
+ break;
+ case 11:
+ ((MenuItem)target).Click += new RoutedEventHandler(ImportarXls_OnClick);
+ break;
+ case 12:
+ ((MenuItem)target).Click += new RoutedEventHandler(BaixarXls_OnClick);
+ break;
+ case 13:
+ PainelDadosAuto = (WrapPanel)target;
+ break;
+ case 14:
+ FipeBox = (TextBox)target;
+ ((UIElement)FipeBox).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ ((UIElement)FipeBox).LostFocus += new RoutedEventHandler(Fipe_LostFocus);
+ break;
+ case 15:
+ ((UIElement)(TextBox)target).PreviewTextInput += new TextCompositionEventHandler(((BaseUserControl)this).Placa);
+ ((UIElement)(TextBox)target).PreviewKeyDown += new KeyEventHandler(Placa);
+ break;
+ case 16:
+ AutoCompleteFabricacao = (AutoCompleteBox)target;
+ AutoCompleteFabricacao.Populating += new PopulatingEventHandler(AutoCompleteFabricanteBox_Populating);
+ break;
+ case 17:
+ ModeloBox = (TextBox)target;
+ break;
+ case 18:
+ ((ButtonBase)(Button)target).Click += new RoutedEventHandler(BuscarModelo_OnClick);
+ break;
+ case 19:
+ ((Selector)(ComboBox)target).SelectionChanged += new SelectionChangedEventHandler(SelecionaUsoVeiculo);
+ break;
+ case 20:
+ ((UIElement)(TextBox)target).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ ((UIElement)(TextBox)target).LostFocus += new RoutedEventHandler(Renavam_OnLostFocus);
+ ((UIElement)(TextBox)target).PreviewKeyUp += new KeyEventHandler(KeyUpBase_OnKeyUp);
+ break;
+ case 21:
+ ((ToggleButton)target).Checked += new RoutedEventHandler(ZeroKmToggleButton_Changed);
+ ((ToggleButton)target).Unchecked += new RoutedEventHandler(ZeroKmToggleButton_Changed);
+ break;
+ case 22:
+ ((UIElement)(TextBox)target).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 23:
+ AnoModeloBox = (TextBox)target;
+ ((UIElement)AnoModeloBox).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 24:
+ ((UIElement)(TextBox)target).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 25:
+ ((UIElement)(TextBox)target).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 26:
+ CepCirculacaoBox = (TextBox)target;
+ ((UIElement)CepCirculacaoBox).LostFocus += new RoutedEventHandler(Cep_OnLostFocus);
+ ((UIElement)CepCirculacaoBox).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 27:
+ CepPernoiteBox = (TextBox)target;
+ ((UIElement)CepPernoiteBox).LostFocus += new RoutedEventHandler(Cep_OnLostFocus);
+ ((UIElement)CepPernoiteBox).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 28:
+ ComboBoxTipoCorrecao = (ComboBox)target;
+ ((Selector)ComboBoxTipoCorrecao).SelectionChanged += new SelectionChangedEventHandler(ComboBoxTipoCorrecao_SelectionChanged);
+ break;
+ case 29:
+ ((UIElement)(TextBox)target).LostFocus += new RoutedEventHandler(Ci_OnLostFocus);
+ ((UIElement)(TextBox)target).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 30:
+ ((UIElement)(TextBox)target).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 31:
+ CoberturasRadioButton = (RadioButton)target;
+ break;
+ case 32:
+ MaisInformacoesRadioButton = (RadioButton)target;
+ break;
+ case 33:
+ ContentControl = (ContentControl)target;
+ break;
+ case 34:
+ MaisInformacoes = (CustomItemValidation)target;
+ break;
+ default:
+ _contentLoaded = true;
+ break;
+ }
+ }
+}
diff --git a/Decompiler/Gestor.Application.Views.Seguros.Itens/BuscarModeloView.cs b/Decompiler/Gestor.Application.Views.Seguros.Itens/BuscarModeloView.cs
new file mode 100644
index 0000000..387c028
--- /dev/null
+++ b/Decompiler/Gestor.Application.Views.Seguros.Itens/BuscarModeloView.cs
@@ -0,0 +1,83 @@
+using System;
+using System.CodeDom.Compiler;
+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 Gestor.Application.ViewModels.Seguros.Itens;
+using Gestor.Application.Views.Generic;
+
+namespace Gestor.Application.Views.Seguros.Itens;
+
+public class BuscarModeloView : BaseUserControl, IComponentConnector
+{
+ internal DataGrid BuscaModeloGrid;
+
+ private bool _contentLoaded;
+
+ public BuscarModeloViewModel ViewModel { get; set; }
+
+ public BuscarModeloView(BuscarModeloViewModel viewModel)
+ {
+ ViewModel = viewModel;
+ ((FrameworkElement)this).DataContext = ViewModel;
+ InitializeComponent();
+ }
+
+ private void Pesquisar_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.Pesquisar();
+ }
+
+ [DebuggerNonUserCode]
+ [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
+ public void InitializeComponent()
+ {
+ if (!_contentLoaded)
+ {
+ _contentLoaded = true;
+ Uri uri = new Uri("/Gestor.Application;component/views/seguros/itens/buscarmodeloview.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_0017: 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_002e: Expected O, but got Unknown
+ //IL_0030: Unknown result type (might be due to invalid IL or missing references)
+ //IL_003c: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0046: Expected O, but got Unknown
+ //IL_0049: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0053: Expected O, but got Unknown
+ switch (connectionId)
+ {
+ case 1:
+ ((UIElement)(TextBox)target).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 2:
+ ((ButtonBase)(Button)target).Click += new RoutedEventHandler(Pesquisar_OnClick);
+ break;
+ case 3:
+ BuscaModeloGrid = (DataGrid)target;
+ break;
+ default:
+ _contentLoaded = true;
+ break;
+ }
+ }
+}
diff --git a/Decompiler/Gestor.Application.Views.Seguros.Itens/ConsorcioView.cs b/Decompiler/Gestor.Application.Views.Seguros.Itens/ConsorcioView.cs
new file mode 100644
index 0000000..4c3b910
--- /dev/null
+++ b/Decompiler/Gestor.Application.Views.Seguros.Itens/ConsorcioView.cs
@@ -0,0 +1,312 @@
+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.Input;
+using System.Windows.Markup;
+using System.Windows.Threading;
+using Gestor.Application.Componentes;
+using Gestor.Application.Drawers;
+using Gestor.Application.Helpers;
+using Gestor.Application.Servicos;
+using Gestor.Application.ViewModels;
+using Gestor.Application.ViewModels.Seguros;
+using Gestor.Application.ViewModels.Seguros.Itens;
+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.Seguros.Itens;
+
+public class ConsorcioView : BaseUserControl, IComponentConnector
+{
+ public ConsorcioViewModel ViewModel;
+
+ private readonly MenuItemViewModel _menuItemViewModel;
+
+ private bool _salvando;
+
+ internal MenuItem IncluirItemButton;
+
+ internal MenuItem SinistroButton;
+
+ internal RadioButton CoberturasRadioButton;
+
+ internal RadioButton MaisInformacoesRadioButton;
+
+ internal ContentControl ContentControl;
+
+ internal CustomItemValidation MaisInformacoes;
+
+ private bool _contentLoaded;
+
+ public ConsorcioView(MenuItemViewModel menuItemViewModel, bool lockInsert = false, bool substituir = false, ManutencaoItem manutencao = null, Item itemSelecionado = null, Ramo ramo = null, bool endossoRenovacao = false)
+ {
+ _menuItemViewModel = menuItemViewModel;
+ ViewModel = new ConsorcioViewModel(substituir, manutencao, itemSelecionado, ramo, endossoRenovacao);
+ ((FrameworkElement)this).DataContext = ViewModel;
+ InitializeComponent();
+ Dispatcher dispatcher = ((DispatcherObject)this).Dispatcher;
+ if (dispatcher != null)
+ {
+ dispatcher.BeginInvoke((DispatcherPriority)7, (Delegate)new Action(ContentLoad));
+ }
+ if (lockInsert)
+ {
+ ((UIElement)IncluirItemButton).IsEnabled = false;
+ ((UIElement)SinistroButton).Visibility = (Visibility)2;
+ }
+ }
+
+ public async Task Selecionar(Item item)
+ {
+ await ViewModel.SelecionaItem(item);
+ }
+
+ public void Manter(ManutencaoItem manutencao)
+ {
+ ViewModel.Manter(ConsultaViewModel.ItemSelecionado, manutencao);
+ }
+
+ public void Substituir()
+ {
+ ViewModel.Substituir(ConsultaViewModel.ItemSelecionado);
+ }
+
+ 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
+ ((ToggleButton)CoberturasRadioButton).Checked += new RoutedEventHandler(Documento_OnChecked);
+ ((ToggleButton)MaisInformacoesRadioButton).Checked += new RoutedEventHandler(Documento_OnChecked);
+ }
+
+ private void Documento_OnChecked(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
+ RadioButton val = (RadioButton)sender;
+ if (!string.IsNullOrEmpty(val.GroupName))
+ {
+ ViewModel.Descarregar();
+ ((UIElement)ContentControl).Visibility = (Visibility)2;
+ ((UIElement)MaisInformacoes).Visibility = (Visibility)2;
+ ((DependencyObject)(object)MaisInformacoes).ClearInvalid();
+ ((DependencyObject)(object)ContentControl).ClearInvalid();
+ if (!(((FrameworkElement)val).Name == "MaisInformacoesRadioButton"))
+ {
+ ((UIElement)ContentControl).Visibility = (Visibility)0;
+ ViewModel.CarregaCobertura();
+ }
+ else
+ {
+ ((UIElement)MaisInformacoes).Visibility = (Visibility)0;
+ }
+ }
+ }
+
+ private async void Incluir_OnClick(object sender, RoutedEventArgs e)
+ {
+ await ViewModel.Incluir();
+ List<KeyValuePair<string, string>> errorMessages = ViewModel.SelectedItem.Validate();
+ ((DependencyObject)(object)this).ValidateFields(errorMessages);
+ }
+
+ private async void Excluir_OnClick(object sender, RoutedEventArgs e)
+ {
+ await ViewModel.Excluir();
+ _menuItemViewModel?.RecarregarItens(null);
+ }
+
+ private void Cancelar_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.CancelarAlteracao();
+ }
+
+ public 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)
+ {
+ if (((DomainBase)ViewModel.SelectedItem).Id > 0)
+ {
+ _menuItemViewModel?.RecarregarItens(ViewModel.SelectedItem);
+ }
+ }
+ else
+ {
+ await ViewModel.ShowMessage(list, ViewModel.ErroCamposInvalidos, "OK");
+ }
+ }
+
+ private void Alterar_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.Alterar(alterar: true);
+ }
+
+ private async void AbrirAquivoDigital_Click(object sender, RoutedEventArgs e)
+ {
+ if (!new PermissaoArquivoDigitalServico().BuscarPermissao(Recursos.Usuario, (TipoArquivoDigital)4).Consultar)
+ {
+ await ViewModel.ShowMessage("VOCÊ NÃO POSSUI PERMISSÃO PARA ACESSAR\nARQUIVO DIGITAL DE " + ValidationHelper.GetDescription((Enum)(object)(TipoArquivoDigital)4) + ".");
+ return;
+ }
+ FiltroArquivoDigital filtro = new FiltroArquivoDigital
+ {
+ Id = ((DomainBase)ViewModel.SelectedItem).Id,
+ IdApolice = ((DomainBase)ViewModel.SelectedItem.Documento).Id,
+ Tipo = (TipoArquivoDigital)4,
+ Parente = ViewModel.SelectedItem
+ };
+ ViewModel.ShowDrawer(new ArquivoDigitalDrawer(filtro), 0, close: false);
+ }
+
+ private void AbrirLog_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.AbrirLog((TipoTela)3, ((DomainBase)ViewModel.SelectedItem).Id);
+ }
+
+ private void AbrirLogEmail_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.AbrirLogEmail((TipoTela)3, ((DomainBase)ViewModel.SelectedItem).Id);
+ }
+
+ private void MenuItem_OnClick(object sender, RoutedEventArgs e)
+ {
+ ((Window)new HosterWindow((ContentControl)(object)new SinistroView(ViewModel.SelectedItem, attached: false), "CADASTRO DE SINISTROS - " + ViewModel.SelectedItem.Descricao)).ShowDialog();
+ _menuItemViewModel?.RecarregarItens(ViewModel.SelectedItem);
+ }
+
+ private void CopyCodItem(object sender, MouseButtonEventArgs e)
+ {
+ ViewModel.CodigoItem.CopyToClipboard();
+ ViewModel.ToggleSnackBar("COPIADO - " + ViewModel.CodigoItem);
+ }
+
+ [DebuggerNonUserCode]
+ [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
+ public void InitializeComponent()
+ {
+ if (!_contentLoaded)
+ {
+ _contentLoaded = true;
+ Uri uri = new Uri("/Gestor.Application;component/views/seguros/itens/consorcioview.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_0047: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0051: Expected O, but got Unknown
+ //IL_005e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0068: Expected O, but got Unknown
+ //IL_006a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0076: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0080: Expected O, but got Unknown
+ //IL_0082: Unknown result type (might be due to invalid IL or missing references)
+ //IL_008e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0098: Expected O, but got Unknown
+ //IL_009a: Unknown result type (might be due to invalid IL or missing references)
+ //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
+ //IL_00ca: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00d6: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00e0: Expected O, but got Unknown
+ //IL_00e2: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00ee: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00f8: Expected O, but got Unknown
+ //IL_00fb: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0105: Expected O, but got Unknown
+ //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_0136: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0142: Unknown result type (might be due to invalid IL or missing references)
+ //IL_014c: Expected O, but got Unknown
+ //IL_014f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0159: Expected O, but got Unknown
+ //IL_015c: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0166: Expected O, but got Unknown
+ //IL_0169: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0173: Expected O, but got Unknown
+ switch (connectionId)
+ {
+ case 1:
+ IncluirItemButton = (MenuItem)target;
+ IncluirItemButton.Click += new RoutedEventHandler(Incluir_OnClick);
+ break;
+ case 2:
+ ((MenuItem)target).Click += new RoutedEventHandler(Alterar_OnClick);
+ break;
+ case 3:
+ ((MenuItem)target).Click += new RoutedEventHandler(Salvar_OnClick);
+ break;
+ case 4:
+ ((MenuItem)target).Click += new RoutedEventHandler(Cancelar_OnClick);
+ break;
+ case 5:
+ ((MenuItem)target).Click += new RoutedEventHandler(Excluir_OnClick);
+ break;
+ case 6:
+ ((Control)(TextBox)target).MouseDoubleClick += new MouseButtonEventHandler(CopyCodItem);
+ break;
+ case 7:
+ ((MenuItem)target).Click += new RoutedEventHandler(AbrirAquivoDigital_Click);
+ break;
+ case 8:
+ SinistroButton = (MenuItem)target;
+ SinistroButton.Click += new RoutedEventHandler(MenuItem_OnClick);
+ break;
+ case 9:
+ ((MenuItem)target).Click += new RoutedEventHandler(AbrirLog_OnClick);
+ break;
+ case 10:
+ ((MenuItem)target).Click += new RoutedEventHandler(AbrirLogEmail_OnClick);
+ break;
+ case 11:
+ CoberturasRadioButton = (RadioButton)target;
+ break;
+ case 12:
+ MaisInformacoesRadioButton = (RadioButton)target;
+ break;
+ case 13:
+ ContentControl = (ContentControl)target;
+ break;
+ case 14:
+ MaisInformacoes = (CustomItemValidation)target;
+ break;
+ default:
+ _contentLoaded = true;
+ break;
+ }
+ }
+}
diff --git a/Decompiler/Gestor.Application.Views.Seguros.Itens/GranizoView.cs b/Decompiler/Gestor.Application.Views.Seguros.Itens/GranizoView.cs
new file mode 100644
index 0000000..4754b35
--- /dev/null
+++ b/Decompiler/Gestor.Application.Views.Seguros.Itens/GranizoView.cs
@@ -0,0 +1,378 @@
+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.Input;
+using System.Windows.Markup;
+using System.Windows.Threading;
+using Gestor.Application.Componentes;
+using Gestor.Application.Drawers;
+using Gestor.Application.Helpers;
+using Gestor.Application.Servicos;
+using Gestor.Application.ViewModels;
+using Gestor.Application.ViewModels.Seguros;
+using Gestor.Application.ViewModels.Seguros.Itens;
+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.Seguros.Itens;
+
+public class GranizoView : BaseUserControl, IComponentConnector
+{
+ public GranizoViewModel ViewModel;
+
+ private readonly MenuItemViewModel _menuItemViewModel;
+
+ internal MenuItem IncluirItemButton;
+
+ internal MenuItem SinistroButton;
+
+ internal TextBox CepBox;
+
+ internal TextBox EnderecoBox;
+
+ internal TextBox BairroBox;
+
+ internal TextBox CidadeBox;
+
+ internal TextBox EstadoBox;
+
+ internal RadioButton CoberturasRadioButton;
+
+ internal RadioButton MaisInformacoesRadioButton;
+
+ internal ContentControl ContentControl;
+
+ internal CustomItemValidation MaisInformacoes;
+
+ private bool _contentLoaded;
+
+ public GranizoView(MenuItemViewModel menuItemViewModel, bool lockInsert = false, bool substituir = false, ManutencaoItem manutencao = null, Item itemSelecionado = null, Ramo ramo = null, bool endossoRenovacao = false)
+ {
+ _menuItemViewModel = menuItemViewModel;
+ ViewModel = new GranizoViewModel(substituir, manutencao, itemSelecionado, ramo, endossoRenovacao);
+ ((FrameworkElement)this).DataContext = ViewModel;
+ InitializeComponent();
+ Dispatcher dispatcher = ((DispatcherObject)this).Dispatcher;
+ if (dispatcher != null)
+ {
+ dispatcher.BeginInvoke((DispatcherPriority)7, (Delegate)new Action(ContentLoad));
+ }
+ if (lockInsert)
+ {
+ ((UIElement)IncluirItemButton).IsEnabled = false;
+ ((UIElement)SinistroButton).Visibility = (Visibility)2;
+ }
+ }
+
+ public async Task Selecionar(Item item)
+ {
+ await ViewModel.SelecionaItem(item);
+ }
+
+ public void Manter(ManutencaoItem manutencao)
+ {
+ ViewModel.Manter(ConsultaViewModel.ItemSelecionado, manutencao);
+ }
+
+ public void Substituir()
+ {
+ ViewModel.Substituir(ConsultaViewModel.ItemSelecionado);
+ }
+
+ 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
+ ((ToggleButton)CoberturasRadioButton).Checked += new RoutedEventHandler(Documento_OnChecked);
+ ((ToggleButton)MaisInformacoesRadioButton).Checked += new RoutedEventHandler(Documento_OnChecked);
+ }
+
+ private void Documento_OnChecked(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
+ RadioButton val = (RadioButton)sender;
+ if (!string.IsNullOrEmpty(val.GroupName))
+ {
+ ViewModel.Descarregar();
+ ((UIElement)ContentControl).Visibility = (Visibility)2;
+ ((UIElement)MaisInformacoes).Visibility = (Visibility)2;
+ ((DependencyObject)(object)MaisInformacoes).ClearInvalid();
+ ((DependencyObject)(object)ContentControl).ClearInvalid();
+ if (!(((FrameworkElement)val).Name == "MaisInformacoesRadioButton"))
+ {
+ ((UIElement)ContentControl).Visibility = (Visibility)0;
+ ViewModel.CarregaCobertura();
+ }
+ else
+ {
+ ((UIElement)MaisInformacoes).Visibility = (Visibility)0;
+ }
+ }
+ }
+
+ private async void Incluir_OnClick(object sender, RoutedEventArgs e)
+ {
+ await ViewModel.IncluirItem();
+ List<KeyValuePair<string, string>> errorMessages = ViewModel.SelectedItem.Validate();
+ ((DependencyObject)(object)this).ValidateFields(errorMessages);
+ }
+
+ private async void Excluir_OnClick(object sender, RoutedEventArgs e)
+ {
+ if (await ViewModel.Excluir())
+ {
+ _menuItemViewModel?.RecarregarItens(null);
+ }
+ }
+
+ private void Cancelar_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.CancelarAlteracao();
+ }
+
+ public 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)
+ {
+ if (((DomainBase)ViewModel.SelectedItem).Id > 0)
+ {
+ _menuItemViewModel?.RecarregarItens(ViewModel.SelectedItem);
+ }
+ }
+ else
+ {
+ await ViewModel.ShowMessage(list, ViewModel.ErroCamposInvalidos, "OK");
+ }
+ }
+
+ private void Alterar_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.Alterar(alterar: true);
+ }
+
+ private async void AbrirAquivoDigital_Click(object sender, RoutedEventArgs e)
+ {
+ if (!new PermissaoArquivoDigitalServico().BuscarPermissao(Recursos.Usuario, (TipoArquivoDigital)4).Consultar)
+ {
+ await ViewModel.ShowMessage("VOCÊ NÃO POSSUI PERMISSÃO PARA ACESSAR\nARQUIVO DIGITAL DE " + ValidationHelper.GetDescription((Enum)(object)(TipoArquivoDigital)4) + ".");
+ return;
+ }
+ FiltroArquivoDigital filtro = new FiltroArquivoDigital
+ {
+ Id = ((DomainBase)ViewModel.SelectedItem).Id,
+ IdApolice = ((DomainBase)ViewModel.SelectedItem.Documento).Id,
+ Tipo = (TipoArquivoDigital)4,
+ Parente = ViewModel.SelectedItem
+ };
+ ViewModel.ShowDrawer(new ArquivoDigitalDrawer(filtro), 0, close: false);
+ }
+
+ private async void PostcodeBox_OnLostFocus(object sender, RoutedEventArgs e)
+ {
+ TextBox val = (TextBox)sender;
+ if (string.IsNullOrWhiteSpace(val.Text))
+ {
+ return;
+ }
+ string text = ValidationHelper.FormatPostCode(val.Text);
+ CepBox.Text = text;
+ if (ValidationHelper.ValidatePostCode(text))
+ {
+ EnderecoBase val2 = await ViewModel.BuscaCep(text);
+ if (val2 != null)
+ {
+ EnderecoBox.Text = val2.Endereco;
+ CidadeBox.Text = val2.Cidade;
+ EstadoBox.Text = val2.Estado;
+ BairroBox.Text = val2.Bairro;
+ }
+ }
+ }
+
+ private void AbrirLog_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.AbrirLog((TipoTela)3, ((DomainBase)ViewModel.SelectedItem).Id);
+ }
+
+ private void AbrirLogEmail_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.AbrirLogEmail((TipoTela)3, ((DomainBase)ViewModel.SelectedItem).Id);
+ }
+
+ private void MenuItem_OnClick(object sender, RoutedEventArgs e)
+ {
+ ((Window)new HosterWindow((ContentControl)(object)new SinistroView(ViewModel.SelectedItem, attached: false), "CADASTRO DE SINISTROS - " + ViewModel.SelectedItem.Descricao)).ShowDialog();
+ _menuItemViewModel?.RecarregarItens(ViewModel.SelectedItem);
+ }
+
+ private void CopyCodItem(object sender, MouseButtonEventArgs e)
+ {
+ ViewModel.CodigoItem.CopyToClipboard();
+ ViewModel.ToggleSnackBar("COPIADO - " + ViewModel.CodigoItem);
+ }
+
+ [DebuggerNonUserCode]
+ [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
+ public void InitializeComponent()
+ {
+ if (!_contentLoaded)
+ {
+ _contentLoaded = true;
+ Uri uri = new Uri("/Gestor.Application;component/views/seguros/itens/granizoview.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_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_0082: Unknown result type (might be due to invalid IL or missing references)
+ //IL_008e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0098: Expected O, but got Unknown
+ //IL_009a: Unknown result type (might be due to invalid IL or missing references)
+ //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
+ //IL_00ca: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00d6: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00e0: Expected O, but got Unknown
+ //IL_00e2: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00ee: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00f8: Expected O, but got Unknown
+ //IL_00fa: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0106: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0110: Expected O, but got Unknown
+ //IL_0113: Unknown result type (might be due to invalid IL or missing references)
+ //IL_011d: Expected O, but got Unknown
+ //IL_012a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0134: Expected O, but got Unknown
+ //IL_0136: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0142: Unknown result type (might be due to invalid IL or missing references)
+ //IL_014c: Expected O, but got Unknown
+ //IL_014e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_015a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0164: Expected O, but got Unknown
+ //IL_0167: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0171: 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_018b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0195: Expected O, but got Unknown
+ //IL_0197: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01a4: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01ae: Expected O, but got Unknown
+ //IL_01b1: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01bb: Expected O, but got Unknown
+ //IL_01be: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01c8: Expected O, but got Unknown
+ //IL_01cb: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01d5: Expected O, but got Unknown
+ //IL_01d8: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01e2: Expected O, but got Unknown
+ //IL_01e5: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01ef: Expected O, but got Unknown
+ //IL_01f2: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01fc: Expected O, but got Unknown
+ switch (connectionId)
+ {
+ case 1:
+ IncluirItemButton = (MenuItem)target;
+ IncluirItemButton.Click += new RoutedEventHandler(Incluir_OnClick);
+ break;
+ case 2:
+ ((MenuItem)target).Click += new RoutedEventHandler(Alterar_OnClick);
+ break;
+ case 3:
+ ((MenuItem)target).Click += new RoutedEventHandler(Salvar_OnClick);
+ break;
+ case 4:
+ ((MenuItem)target).Click += new RoutedEventHandler(Cancelar_OnClick);
+ break;
+ case 5:
+ ((MenuItem)target).Click += new RoutedEventHandler(Excluir_OnClick);
+ break;
+ case 6:
+ ((Control)(TextBox)target).MouseDoubleClick += new MouseButtonEventHandler(CopyCodItem);
+ break;
+ case 7:
+ ((MenuItem)target).Click += new RoutedEventHandler(AbrirAquivoDigital_Click);
+ break;
+ case 8:
+ SinistroButton = (MenuItem)target;
+ SinistroButton.Click += new RoutedEventHandler(MenuItem_OnClick);
+ break;
+ case 9:
+ ((MenuItem)target).Click += new RoutedEventHandler(AbrirLog_OnClick);
+ break;
+ case 10:
+ ((MenuItem)target).Click += new RoutedEventHandler(AbrirLogEmail_OnClick);
+ break;
+ case 11:
+ CepBox = (TextBox)target;
+ ((UIElement)CepBox).LostFocus += new RoutedEventHandler(PostcodeBox_OnLostFocus);
+ break;
+ case 12:
+ EnderecoBox = (TextBox)target;
+ break;
+ case 13:
+ ((UIElement)(TextBox)target).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 14:
+ BairroBox = (TextBox)target;
+ break;
+ case 15:
+ CidadeBox = (TextBox)target;
+ break;
+ case 16:
+ EstadoBox = (TextBox)target;
+ break;
+ case 17:
+ CoberturasRadioButton = (RadioButton)target;
+ break;
+ case 18:
+ MaisInformacoesRadioButton = (RadioButton)target;
+ break;
+ case 19:
+ ContentControl = (ContentControl)target;
+ break;
+ case 20:
+ MaisInformacoes = (CustomItemValidation)target;
+ break;
+ default:
+ _contentLoaded = true;
+ break;
+ }
+ }
+}
diff --git a/Decompiler/Gestor.Application.Views.Seguros.Itens/PatrimonialView.cs b/Decompiler/Gestor.Application.Views.Seguros.Itens/PatrimonialView.cs
new file mode 100644
index 0000000..682228f
--- /dev/null
+++ b/Decompiler/Gestor.Application.Views.Seguros.Itens/PatrimonialView.cs
@@ -0,0 +1,480 @@
+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.Input;
+using System.Windows.Markup;
+using System.Windows.Threading;
+using Gestor.Application.Componentes;
+using Gestor.Application.Drawers;
+using Gestor.Application.Helpers;
+using Gestor.Application.Servicos;
+using Gestor.Application.ViewModels;
+using Gestor.Application.ViewModels.Seguros;
+using Gestor.Application.ViewModels.Seguros.Itens;
+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.Seguros.Itens;
+
+public class PatrimonialView : BaseUserControl, IComponentConnector
+{
+ public PatrimonialViewModel ViewModel;
+
+ private readonly MenuItemViewModel _menuItemViewModel;
+
+ internal MenuItem IncluirItemButton;
+
+ internal MenuItem SinistroButton;
+
+ internal TextBox CepBox;
+
+ internal TextBox EnderecoBox;
+
+ internal TextBox BairroBox;
+
+ internal TextBox CidadeBox;
+
+ internal TextBox EstadoBox;
+
+ internal RadioButton CoberturasRadioButton;
+
+ internal RadioButton MaisInformacoesRadioButton;
+
+ internal ContentControl ContentControl;
+
+ internal CustomItemValidation MaisInformacoes;
+
+ private bool _contentLoaded;
+
+ public PatrimonialView(MenuItemViewModel menuItemViewModel, bool lockInsert = false, bool substituir = false, ManutencaoItem manutencao = null, Item itemSelecionado = null, Ramo ramo = null, bool endossoRenovacao = false)
+ {
+ _menuItemViewModel = menuItemViewModel;
+ ViewModel = new PatrimonialViewModel(substituir, manutencao, itemSelecionado, ramo, endossoRenovacao);
+ ((FrameworkElement)this).DataContext = ViewModel;
+ InitializeComponent();
+ Dispatcher dispatcher = ((DispatcherObject)this).Dispatcher;
+ if (dispatcher != null)
+ {
+ dispatcher.BeginInvoke((DispatcherPriority)7, (Delegate)new Action(ContentLoad));
+ }
+ if (lockInsert)
+ {
+ ((UIElement)IncluirItemButton).IsEnabled = false;
+ ((UIElement)SinistroButton).Visibility = (Visibility)2;
+ }
+ }
+
+ public async Task Selecionar(Item item)
+ {
+ await ViewModel.SelecionaItem(item);
+ }
+
+ public void Manter(ManutencaoItem manutencao)
+ {
+ ViewModel.Manter(ConsultaViewModel.ItemSelecionado, manutencao);
+ }
+
+ public void Substituir()
+ {
+ ViewModel.Substituir(ConsultaViewModel.ItemSelecionado);
+ }
+
+ 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
+ ((ToggleButton)CoberturasRadioButton).Checked += new RoutedEventHandler(Documento_OnChecked);
+ ((ToggleButton)MaisInformacoesRadioButton).Checked += new RoutedEventHandler(Documento_OnChecked);
+ }
+
+ private void Documento_OnChecked(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
+ RadioButton val = (RadioButton)sender;
+ if (!string.IsNullOrEmpty(val.GroupName))
+ {
+ ViewModel.Descarregar();
+ ((UIElement)ContentControl).Visibility = (Visibility)2;
+ ((UIElement)MaisInformacoes).Visibility = (Visibility)2;
+ ((DependencyObject)(object)MaisInformacoes).ClearInvalid();
+ ((DependencyObject)(object)ContentControl).ClearInvalid();
+ if (!(((FrameworkElement)val).Name == "MaisInformacoesRadioButton"))
+ {
+ ((UIElement)ContentControl).Visibility = (Visibility)0;
+ ViewModel.CarregaCobertura();
+ }
+ else
+ {
+ ((UIElement)MaisInformacoes).Visibility = (Visibility)0;
+ }
+ }
+ }
+
+ private async void Incluir_OnClick(object sender, RoutedEventArgs e)
+ {
+ await ViewModel.Incluir();
+ List<KeyValuePair<string, string>> errorMessages = ViewModel.SelectedItem.Validate();
+ ((DependencyObject)(object)this).ValidateFields(errorMessages);
+ }
+
+ private async void Excluir_OnClick(object sender, RoutedEventArgs e)
+ {
+ if (await ViewModel.Excluir())
+ {
+ _menuItemViewModel?.RecarregarItens(null);
+ }
+ }
+
+ private void Cancelar_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.CancelarAlteracao();
+ }
+
+ public 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)
+ {
+ if (((DomainBase)ViewModel.SelectedItem).Id > 0)
+ {
+ _menuItemViewModel?.RecarregarItens(ViewModel.SelectedItem);
+ }
+ }
+ else
+ {
+ await ViewModel.ShowMessage(list, ViewModel.ErroCamposInvalidos, "OK");
+ }
+ }
+
+ private void Alterar_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.Alterar(alterar: true);
+ }
+
+ private async void AbrirAquivoDigital_Click(object sender, RoutedEventArgs e)
+ {
+ if (!new PermissaoArquivoDigitalServico().BuscarPermissao(Recursos.Usuario, (TipoArquivoDigital)4).Consultar)
+ {
+ await ViewModel.ShowMessage("VOCÊ NÃO POSSUI PERMISSÃO PARA ACESSAR\nARQUIVO DIGITAL DE " + ValidationHelper.GetDescription((Enum)(object)(TipoArquivoDigital)4) + ".");
+ return;
+ }
+ FiltroArquivoDigital filtro = new FiltroArquivoDigital
+ {
+ Id = ((DomainBase)ViewModel.SelectedItem).Id,
+ IdApolice = ((DomainBase)ViewModel.SelectedItem.Documento).Id,
+ Tipo = (TipoArquivoDigital)4,
+ Parente = ViewModel.SelectedItem
+ };
+ ViewModel.ShowDrawer(new ArquivoDigitalDrawer(filtro), 0, close: false);
+ }
+
+ private async void PostcodeBox_OnLostFocus(object sender, RoutedEventArgs e)
+ {
+ TextBox val = (TextBox)sender;
+ if (string.IsNullOrWhiteSpace(val.Text))
+ {
+ return;
+ }
+ string text = ValidationHelper.FormatPostCode(val.Text);
+ if (ValidationHelper.ValidatePostCode(text))
+ {
+ CepBox.Text = text;
+ EnderecoBase val2 = await ViewModel.BuscaCep(text);
+ if (val2 != null)
+ {
+ EnderecoBox.Text = val2.Endereco;
+ CidadeBox.Text = val2.Cidade;
+ EstadoBox.Text = val2.Estado;
+ BairroBox.Text = val2.Bairro;
+ }
+ }
+ }
+
+ private void AbrirLog_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.AbrirLog((TipoTela)3, ((DomainBase)ViewModel.SelectedItem).Id);
+ }
+
+ 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 void AbrirLogEmail_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.AbrirLogEmail((TipoTela)3, ((DomainBase)ViewModel.SelectedItem).Id);
+ }
+
+ private void MenuItem_OnClick(object sender, RoutedEventArgs e)
+ {
+ ((Window)new HosterWindow((ContentControl)(object)new SinistroView(ViewModel.SelectedItem, attached: false), "CADASTRO DE SINISTROS - " + ViewModel.SelectedItem.Descricao)).ShowDialog();
+ _menuItemViewModel?.RecarregarItens(ViewModel.SelectedItem);
+ }
+
+ private void CopyCodItem(object sender, MouseButtonEventArgs e)
+ {
+ ViewModel.CodigoItem.CopyToClipboard();
+ ViewModel.ToggleSnackBar("COPIADO - " + ViewModel.CodigoItem);
+ }
+
+ [DebuggerNonUserCode]
+ [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
+ public void InitializeComponent()
+ {
+ if (!_contentLoaded)
+ {
+ _contentLoaded = true;
+ Uri uri = new Uri("/Gestor.Application;component/views/seguros/itens/patrimonialview.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_008b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0095: 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_0126: Unknown result type (might be due to invalid IL or missing references)
+ //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_0193: Unknown result type (might be due to invalid IL or missing references)
+ //IL_019d: Expected O, but got Unknown
+ //IL_01aa: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01b4: Expected O, but got Unknown
+ //IL_01b7: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01c1: Expected O, but got Unknown
+ //IL_01c3: 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_01dd: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01e7: Expected O, but got Unknown
+ //IL_01ea: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01f4: Expected O, but got Unknown
+ //IL_01f7: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0201: Expected O, but got Unknown
+ //IL_0203: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0210: Unknown result type (might be due to invalid IL or missing references)
+ //IL_021a: Expected O, but got Unknown
+ //IL_021c: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0229: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0233: Expected O, but got Unknown
+ //IL_0234: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0241: Unknown result type (might be due to invalid IL or missing references)
+ //IL_024b: Expected O, but got Unknown
+ //IL_024d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_025a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0264: Expected O, but got Unknown
+ //IL_0265: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0271: Unknown result type (might be due to invalid IL or missing references)
+ //IL_027b: Expected O, but got Unknown
+ //IL_027d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_028a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0294: Expected O, but got Unknown
+ //IL_0296: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02a3: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02ad: Expected O, but got Unknown
+ //IL_02ae: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02bb: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02c5: Expected O, but got Unknown
+ //IL_02c7: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02d4: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02de: Expected O, but got Unknown
+ //IL_02df: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02eb: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02f5: Expected O, but got Unknown
+ //IL_02f7: 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_031d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0327: Expected O, but got Unknown
+ //IL_0328: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0335: Unknown result type (might be due to invalid IL or missing references)
+ //IL_033f: Expected O, but got Unknown
+ //IL_0341: Unknown result type (might be due to invalid IL or missing references)
+ //IL_034e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0358: Expected O, but got Unknown
+ //IL_0359: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0365: Unknown result type (might be due to invalid IL or missing references)
+ //IL_036f: Expected O, but got Unknown
+ //IL_0371: Unknown result type (might be due to invalid IL or missing references)
+ //IL_037e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0388: Expected O, but got Unknown
+ //IL_038a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0397: Unknown result type (might be due to invalid IL or missing references)
+ //IL_03a1: Expected O, but got Unknown
+ //IL_03a2: Unknown result type (might be due to invalid IL or missing references)
+ //IL_03af: Unknown result type (might be due to invalid IL or missing references)
+ //IL_03b9: Expected O, but got Unknown
+ //IL_03bc: Unknown result type (might be due to invalid IL or missing references)
+ //IL_03c6: Expected O, but got Unknown
+ //IL_03c9: Unknown result type (might be due to invalid IL or missing references)
+ //IL_03d3: Expected O, but got Unknown
+ //IL_03d6: Unknown result type (might be due to invalid IL or missing references)
+ //IL_03e0: Expected O, but got Unknown
+ switch (connectionId)
+ {
+ case 1:
+ IncluirItemButton = (MenuItem)target;
+ IncluirItemButton.Click += new RoutedEventHandler(Incluir_OnClick);
+ break;
+ case 2:
+ ((MenuItem)target).Click += new RoutedEventHandler(Alterar_OnClick);
+ break;
+ case 3:
+ ((MenuItem)target).Click += new RoutedEventHandler(Salvar_OnClick);
+ break;
+ case 4:
+ ((MenuItem)target).Click += new RoutedEventHandler(Cancelar_OnClick);
+ break;
+ case 5:
+ ((MenuItem)target).Click += new RoutedEventHandler(Excluir_OnClick);
+ break;
+ case 6:
+ ((Control)(TextBox)target).MouseDoubleClick += new MouseButtonEventHandler(CopyCodItem);
+ break;
+ case 7:
+ ((MenuItem)target).Click += new RoutedEventHandler(AbrirAquivoDigital_Click);
+ break;
+ case 8:
+ SinistroButton = (MenuItem)target;
+ SinistroButton.Click += new RoutedEventHandler(MenuItem_OnClick);
+ break;
+ case 9:
+ ((MenuItem)target).Click += new RoutedEventHandler(AbrirLog_OnClick);
+ break;
+ case 10:
+ ((MenuItem)target).Click += new RoutedEventHandler(AbrirLogEmail_OnClick);
+ break;
+ case 11:
+ CepBox = (TextBox)target;
+ ((UIElement)CepBox).LostFocus += new RoutedEventHandler(PostcodeBox_OnLostFocus);
+ break;
+ case 12:
+ EnderecoBox = (TextBox)target;
+ break;
+ case 13:
+ ((UIElement)(TextBox)target).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 14:
+ BairroBox = (TextBox)target;
+ break;
+ case 15:
+ CidadeBox = (TextBox)target;
+ break;
+ case 16:
+ EstadoBox = (TextBox)target;
+ break;
+ case 17:
+ ((UIElement)(TextBox)target).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 18:
+ ((UIElement)(TextBox)target).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ ((UIElement)(TextBox)target).LostFocus += new RoutedEventHandler(FormatarTelefone);
+ break;
+ case 19:
+ ((UIElement)(TextBox)target).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ ((UIElement)(TextBox)target).LostFocus += new RoutedEventHandler(CpfBox_OnLostFocus);
+ break;
+ case 20:
+ ((UIElement)(TextBox)target).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 21:
+ ((UIElement)(TextBox)target).LostFocus += new RoutedEventHandler(FormatarTelefone);
+ ((UIElement)(TextBox)target).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 22:
+ ((UIElement)(TextBox)target).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ ((UIElement)(TextBox)target).LostFocus += new RoutedEventHandler(CpfBox_OnLostFocus);
+ break;
+ case 23:
+ ((UIElement)(TextBox)target).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 24:
+ ((UIElement)(TextBox)target).LostFocus += new RoutedEventHandler(FormatarTelefone);
+ ((UIElement)(TextBox)target).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 25:
+ ((UIElement)(TextBox)target).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ ((UIElement)(TextBox)target).LostFocus += new RoutedEventHandler(CpfBox_OnLostFocus);
+ 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:
+ CoberturasRadioButton = (RadioButton)target;
+ break;
+ case 29:
+ MaisInformacoesRadioButton = (RadioButton)target;
+ break;
+ case 30:
+ ContentControl = (ContentControl)target;
+ break;
+ case 31:
+ MaisInformacoes = (CustomItemValidation)target;
+ break;
+ default:
+ _contentLoaded = true;
+ break;
+ }
+ }
+}
diff --git a/Decompiler/Gestor.Application.Views.Seguros.Itens/RiscosDiversosView.cs b/Decompiler/Gestor.Application.Views.Seguros.Itens/RiscosDiversosView.cs
new file mode 100644
index 0000000..64e95ee
--- /dev/null
+++ b/Decompiler/Gestor.Application.Views.Seguros.Itens/RiscosDiversosView.cs
@@ -0,0 +1,670 @@
+using System;
+using System.CodeDom.Compiler;
+using System.Collections;
+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.Input;
+using System.Windows.Markup;
+using System.Windows.Media;
+using System.Windows.Threading;
+using Gestor.Application.Drawers;
+using Gestor.Application.Helpers;
+using Gestor.Application.Servicos;
+using Gestor.Application.ViewModels;
+using Gestor.Application.ViewModels.Seguros;
+using Gestor.Application.ViewModels.Seguros.Itens;
+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.Seguros.Itens;
+
+public class RiscosDiversosView : BaseUserControl, IComponentConnector, IStyleConnector
+{
+ public RiscosDiversosViewModel ViewModel;
+
+ private readonly MenuItemViewModel _menuItemViewModel;
+
+ private bool _salvando;
+
+ internal MenuItem IncluirItemButton;
+
+ internal MenuItem SinistroButton;
+
+ internal RadioButton CoberturasRadioButton;
+
+ internal RadioButton MaisInformacoesRadioButton;
+
+ internal Menu BotoesTitulares;
+
+ internal Separator SeparadorMaisInformacoes;
+
+ internal ContentControl ContentControl;
+
+ internal DataGrid DataGridTitulares;
+
+ private bool _contentLoaded;
+
+ public RiscosDiversosView(MenuItemViewModel menuItemViewModel, bool lockInsert = false, bool substituir = false, ManutencaoItem manutencao = null, Item itemSelecionado = null, Ramo ramo = null, bool endossoRenovacao = false)
+ {
+ _menuItemViewModel = menuItemViewModel;
+ ViewModel = new RiscosDiversosViewModel(substituir, manutencao, itemSelecionado, ramo, endossoRenovacao);
+ ((FrameworkElement)this).DataContext = ViewModel;
+ InitializeComponent();
+ Dispatcher dispatcher = ((DispatcherObject)this).Dispatcher;
+ if (dispatcher != null)
+ {
+ dispatcher.BeginInvoke((DispatcherPriority)7, (Delegate)new Action(ContentLoad));
+ }
+ if (lockInsert)
+ {
+ ((UIElement)IncluirItemButton).IsEnabled = false;
+ ((UIElement)SinistroButton).Visibility = (Visibility)2;
+ }
+ }
+
+ public async Task Selecionar(Item item)
+ {
+ await ViewModel.SelecionaItem(item);
+ }
+
+ public void Manter(ManutencaoItem manutencao)
+ {
+ ViewModel.Manter(ConsultaViewModel.ItemSelecionado, manutencao);
+ }
+
+ public void Substituir()
+ {
+ ViewModel.Substituir(ConsultaViewModel.ItemSelecionado);
+ }
+
+ 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
+ ((ToggleButton)CoberturasRadioButton).Checked += new RoutedEventHandler(Documento_OnChecked);
+ ((ToggleButton)MaisInformacoesRadioButton).Checked += new RoutedEventHandler(Documento_OnChecked);
+ }
+
+ private void AutoCompleteBox_Populating(object sender, PopulatingEventArgs e)
+ {
+ if (e.Parameter.Trim().Length < 3)
+ {
+ return;
+ }
+ e.Cancel = true;
+ ViewModel.BuscarTitulares(ValidationHelper.RemoveDiacritics(e.Parameter.Trim())).ContinueWith(delegate(Task<List<TitularesVida>> 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 Documento_OnChecked(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
+ RadioButton val = (RadioButton)sender;
+ if (!string.IsNullOrEmpty(val.GroupName))
+ {
+ ViewModel.Descarregar();
+ ((UIElement)ContentControl).Visibility = (Visibility)2;
+ ((UIElement)DataGridTitulares).Visibility = (Visibility)2;
+ ((UIElement)SeparadorMaisInformacoes).Visibility = (Visibility)2;
+ ((UIElement)BotoesTitulares).Visibility = (Visibility)2;
+ ((DependencyObject)(object)DataGridTitulares).ClearInvalid();
+ ((DependencyObject)(object)ContentControl).ClearInvalid();
+ if (!(((FrameworkElement)val).Name == "MaisInformacoesRadioButton"))
+ {
+ ((UIElement)ContentControl).Visibility = (Visibility)0;
+ ViewModel.CarregaCobertura();
+ }
+ else
+ {
+ ((UIElement)SeparadorMaisInformacoes).Visibility = (Visibility)0;
+ ((UIElement)DataGridTitulares).Visibility = (Visibility)0;
+ ((UIElement)BotoesTitulares).Visibility = (Visibility)0;
+ }
+ }
+ }
+
+ private async void Incluir_OnClick(object sender, RoutedEventArgs e)
+ {
+ await ViewModel.Incluir();
+ List<KeyValuePair<string, string>> errorMessages = ViewModel.SelectedItem.Validate();
+ ((DependencyObject)(object)this).ValidateFields(errorMessages);
+ }
+
+ private async void Excluir_OnClick(object sender, RoutedEventArgs e)
+ {
+ if (await ViewModel.Excluir())
+ {
+ _menuItemViewModel?.RecarregarItens(null);
+ }
+ }
+
+ private void Cancelar_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.CancelarAlteracao();
+ }
+
+ public async void Salvar_OnClick(object sender, RoutedEventArgs e)
+ {
+ _salvando = true;
+ ViewModel.Loading(isLoading: true);
+ ((UIElement)DataGridTitulares).Focus();
+ List<KeyValuePair<string, string>> list = await ViewModel.Salvar(((IEnumerable)((ItemsControl)DataGridTitulares).Items).Cast<TitularesVida>().ToList());
+ ((DependencyObject)(object)this).ValidateFields(list);
+ bool num = list == null || list.Count == 0;
+ ViewModel.Loading(isLoading: false);
+ _salvando = false;
+ if (num)
+ {
+ if (((DomainBase)ViewModel.SelectedItem).Id > 0)
+ {
+ _menuItemViewModel?.RecarregarItens(ViewModel.SelectedItem);
+ }
+ }
+ else
+ {
+ await ViewModel.ShowMessage(list, ViewModel.ErroCamposInvalidos, "OK");
+ }
+ }
+
+ private void Alterar_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.Alterar(alterar: true);
+ }
+
+ private async void AbrirAquivoDigital_Click(object sender, RoutedEventArgs e)
+ {
+ if (!new PermissaoArquivoDigitalServico().BuscarPermissao(Recursos.Usuario, (TipoArquivoDigital)4).Consultar)
+ {
+ await ViewModel.ShowMessage("VOCÊ NÃO POSSUI PERMISSÃO PARA ACESSAR\nARQUIVO DIGITAL DE " + ValidationHelper.GetDescription((Enum)(object)(TipoArquivoDigital)4) + ".");
+ return;
+ }
+ FiltroArquivoDigital filtro = new FiltroArquivoDigital
+ {
+ Id = ((DomainBase)ViewModel.SelectedItem).Id,
+ IdApolice = ((DomainBase)ViewModel.SelectedItem.Documento).Id,
+ Tipo = (TipoArquivoDigital)4,
+ Parente = ViewModel.SelectedItem
+ };
+ ViewModel.ShowDrawer(new ArquivoDigitalDrawer(filtro), 0, close: false);
+ }
+
+ private void AbrirLog_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.AbrirLog((TipoTela)3, ((DomainBase)ViewModel.SelectedItem).Id);
+ }
+
+ private void AbrirLogEmail_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.AbrirLogEmail((TipoTela)3, ((DomainBase)ViewModel.SelectedItem).Id);
+ }
+
+ private void MenuItem_OnClick(object sender, RoutedEventArgs e)
+ {
+ ((Window)new HosterWindow((ContentControl)(object)new SinistroView(ViewModel.SelectedItem, attached: false), "CADASTRO DE SINISTROS - " + ViewModel.SelectedItem.Descricao)).ShowDialog();
+ _menuItemViewModel?.RecarregarItens(ViewModel.SelectedItem);
+ }
+
+ private void BotoesTitulares_OnIsEnabledChanged(object sender, DependencyPropertyChangedEventArgs e)
+ {
+ //IL_0001: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0044: Unknown result type (might be due to invalid IL or missing references)
+ if (!((UIElement)(Menu)sender).IsEnabled)
+ {
+ ViewModel.AlteracaoTitularesVisibility = (Visibility)2;
+ }
+ DataGrid dataGridTitulares = DataGridTitulares;
+ if (((dataGridTitulares != null) ? dataGridTitulares.Columns.First() : null) != null)
+ {
+ DataGridTitulares.Columns.First().Visibility = (Visibility)((!((UIElement)(Menu)sender).IsEnabled) ? 2 : 0);
+ }
+ }
+
+ private void IncluirTitular_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.IncluirTitular();
+ UpdateAutocompleteDependente(((IEnumerable)((ItemsControl)DataGridTitulares).Items).Cast<TitularesVida>().First());
+ }
+
+ private void ExcluirTitular_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.ExcluirTitular();
+ }
+
+ private async void ImportarTitulares_OnClick(object sender, RoutedEventArgs e)
+ {
+ await ViewModel.ImportarTitulares();
+ }
+
+ private void UpdateAutocompleteDependente(TitularesVida item)
+ {
+ //IL_0057: Unknown result type (might be due to invalid IL or missing references)
+ //IL_005d: Expected O, but got Unknown
+ //IL_0073: 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_0087: Invalid comparison between Unknown and I4
+ DataGridTitulares.ScrollIntoView((object)item, DataGridTitulares.Columns.First((DataGridColumn x) => (string)x.Header == "TITULAR DEPENDENTE"));
+ ((UIElement)DataGridTitulares).UpdateLayout();
+ DataGridRow val = (DataGridRow)((ItemsControl)DataGridTitulares).ItemContainerGenerator.ContainerFromItem((object)item);
+ if (val != null)
+ {
+ ((UIElement)(DataGridCell)((ItemsControl)DataGridExtensions.GetVisualChild<DataGridCellsPresenter>((Visual)(object)val)).ItemContainerGenerator.ContainerFromIndex(12)).Visibility = (Visibility)(((int)item.Tipo.GetValueOrDefault() != 2) ? 2 : 0);
+ DataGridTitulares.ScrollIntoView((object)item, DataGridTitulares.Columns.First());
+ ((UIElement)DataGridTitulares).UpdateLayout();
+ }
+ }
+
+ private void Dependente_CellLoaded(object sender, RoutedEventArgs e)
+ {
+ //IL_0005: Unknown result type (might be due to invalid IL or missing references)
+ //IL_000b: 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)
+ //IL_0029: Unknown result type (might be due to invalid IL or missing references)
+ //IL_002f: Invalid comparison between Unknown and I4
+ if (sender != null)
+ {
+ DataGridCell val = (DataGridCell)sender;
+ TitularesVida val2 = (TitularesVida)((FrameworkElement)(DataGridCell)sender).DataContext;
+ ((UIElement)val).Visibility = (Visibility)(((int)val2 == 0 || (int)val2.Tipo.GetValueOrDefault() != 2) ? 2 : 0);
+ }
+ }
+
+ private void AlterarTitular_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.AlterarTitular();
+ }
+
+ private void AplicarTitular_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.AplicarTitular();
+ }
+
+ private void DataGridTitulares_OnCellEditEnding(object sender, DataGridCellEditEndingEventArgs e)
+ {
+ if (!(e.EditingElement is TextBox))
+ {
+ return;
+ }
+ FrameworkElement editingElement = e.EditingElement;
+ TextBox val = (TextBox)(object)((editingElement is TextBox) ? editingElement : null);
+ string stringFormat = e.Column.ClipboardContentBinding.StringFormat;
+ if (!(stringFormat == "d"))
+ {
+ if (!(stringFormat == "c"))
+ {
+ if (!string.IsNullOrEmpty((val != null) ? val.Text : null))
+ {
+ if (e.Column.SortMemberPath == "Cpf")
+ {
+ val.Text = ValidationHelper.FormatDocument(val.Text);
+ }
+ }
+ else if (val != null)
+ {
+ val.Text = null;
+ }
+ }
+ else if (!string.IsNullOrEmpty((val != null) ? val.Text : null))
+ {
+ val.Text = ValidationHelper.FormatCurrency(val.Text);
+ }
+ else if (val != null)
+ {
+ val.Text = null;
+ }
+ }
+ else if (!string.IsNullOrEmpty((val != null) ? val.Text : null))
+ {
+ val.Text = ValidationHelper.FormatDate(val.Text);
+ }
+ else if (val != null)
+ {
+ val.Text = null;
+ }
+ }
+
+ private async void TipoComboBoxSelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ ComboBox val = (ComboBox)sender;
+ if ((((int)val != 0) ? ((FrameworkElement)val).DataContext : null) != null)
+ {
+ if ((int)((TitularesVida)((FrameworkElement)(ComboBox)sender).DataContext).Tipo.GetValueOrDefault() == 2 && !_salvando && !ViewModel.Titulares.Any((TitularesVida x) => (int)x.Tipo.GetValueOrDefault() == 1 || x.Tipo == (TipoTitular?)0))
+ {
+ ((Selector)(ComboBox)sender).SelectedIndex = -1;
+ ((TitularesVida)((FrameworkElement)(ComboBox)sender).DataContext).Tipo = null;
+ await ViewModel.ShowMessage("É NECESSÁRIO ADICIONAR PELO MENOS UM TITULAR DO TIPO SÓCIO OU FUNCIONÁRIO\nANTES DE ADICIONAR UM DEPENDENTE.");
+ }
+ else
+ {
+ UpdateAutocompleteDependente((TitularesVida)((FrameworkElement)(ComboBox)sender).DataContext);
+ }
+ }
+ }
+
+ private void CopyCodItem(object sender, MouseButtonEventArgs e)
+ {
+ ViewModel.CodigoItem.CopyToClipboard();
+ ViewModel.ToggleSnackBar("COPIADO - " + ViewModel.CodigoItem);
+ }
+
+ [DebuggerNonUserCode]
+ [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
+ public void InitializeComponent()
+ {
+ if (!_contentLoaded)
+ {
+ _contentLoaded = true;
+ Uri uri = new Uri("/Gestor.Application;component/views/seguros/itens/riscosdiversosview.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_0073: Unknown result type (might be due to invalid IL or missing references)
+ //IL_007d: Expected O, but got Unknown
+ //IL_008a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0094: Expected O, but got Unknown
+ //IL_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_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_013e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0148: Expected O, but got Unknown
+ //IL_014a: Unknown result type (might be due to invalid IL or missing references)
+ //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_017b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0185: Expected O, but got Unknown
+ //IL_0188: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0192: Expected O, but got Unknown
+ //IL_0195: Unknown result type (might be due to invalid IL or missing references)
+ //IL_019f: Expected O, but got Unknown
+ //IL_01ac: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01b6: Expected O, but got Unknown
+ //IL_01b8: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01c4: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01ce: Expected O, but got Unknown
+ //IL_01d0: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01dc: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01e6: Expected O, but got Unknown
+ //IL_01e8: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01f4: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01fe: Expected O, but got Unknown
+ //IL_0200: Unknown result type (might be due to invalid IL or missing references)
+ //IL_020c: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0216: Expected O, but got Unknown
+ //IL_0219: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0223: Expected O, but got Unknown
+ //IL_0225: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0231: Unknown result type (might be due to invalid IL or missing references)
+ //IL_023b: Expected O, but got Unknown
+ //IL_023c: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0248: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0252: Expected O, but got Unknown
+ //IL_0253: Unknown result type (might be due to invalid IL or missing references)
+ //IL_025f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0269: Expected O, but got Unknown
+ //IL_026b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0277: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0281: Expected O, but got Unknown
+ //IL_0282: Unknown result type (might be due to invalid IL or missing references)
+ //IL_028e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0298: Expected O, but got Unknown
+ //IL_0299: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02a5: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02af: Expected O, but got Unknown
+ //IL_02b1: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02bd: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02c7: Expected O, but got Unknown
+ //IL_02c8: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02d4: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02de: Expected O, but got Unknown
+ //IL_02df: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02eb: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02f5: Expected O, but got Unknown
+ //IL_02f7: 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_030f: 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_0328: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0334: Unknown result type (might be due to invalid IL or missing references)
+ //IL_033e: Expected O, but got Unknown
+ //IL_0341: Unknown result type (might be due to invalid IL or missing references)
+ //IL_034b: Expected O, but got Unknown
+ //IL_034e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0358: Expected O, but got Unknown
+ switch (connectionId)
+ {
+ case 1:
+ IncluirItemButton = (MenuItem)target;
+ IncluirItemButton.Click += new RoutedEventHandler(Incluir_OnClick);
+ break;
+ case 2:
+ ((MenuItem)target).Click += new RoutedEventHandler(Alterar_OnClick);
+ break;
+ case 3:
+ ((MenuItem)target).Click += new RoutedEventHandler(Salvar_OnClick);
+ break;
+ case 4:
+ ((MenuItem)target).Click += new RoutedEventHandler(Cancelar_OnClick);
+ break;
+ case 5:
+ ((MenuItem)target).Click += new RoutedEventHandler(Excluir_OnClick);
+ break;
+ case 6:
+ ((Control)(TextBox)target).MouseDoubleClick += new MouseButtonEventHandler(CopyCodItem);
+ break;
+ case 7:
+ ((MenuItem)target).Click += new RoutedEventHandler(AbrirAquivoDigital_Click);
+ break;
+ case 8:
+ SinistroButton = (MenuItem)target;
+ SinistroButton.Click += new RoutedEventHandler(MenuItem_OnClick);
+ break;
+ case 9:
+ ((MenuItem)target).Click += new RoutedEventHandler(AbrirLog_OnClick);
+ break;
+ case 10:
+ ((MenuItem)target).Click += new RoutedEventHandler(AbrirLogEmail_OnClick);
+ break;
+ case 11:
+ CoberturasRadioButton = (RadioButton)target;
+ break;
+ case 12:
+ MaisInformacoesRadioButton = (RadioButton)target;
+ break;
+ case 13:
+ BotoesTitulares = (Menu)target;
+ ((UIElement)BotoesTitulares).IsEnabledChanged += new DependencyPropertyChangedEventHandler(BotoesTitulares_OnIsEnabledChanged);
+ break;
+ case 14:
+ ((MenuItem)target).Click += new RoutedEventHandler(IncluirTitular_OnClick);
+ break;
+ case 15:
+ ((MenuItem)target).Click += new RoutedEventHandler(AlterarTitular_OnClick);
+ break;
+ case 16:
+ ((MenuItem)target).Click += new RoutedEventHandler(ExcluirTitular_OnClick);
+ break;
+ case 17:
+ ((MenuItem)target).Click += new RoutedEventHandler(ImportarTitulares_OnClick);
+ break;
+ case 18:
+ SeparadorMaisInformacoes = (Separator)target;
+ break;
+ case 19:
+ ((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 20:
+ ((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 21:
+ ((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 22:
+ ((UIElement)(TextBox)target).LostFocus += new RoutedEventHandler(FormatarDocumento);
+ ((UIElement)(TextBox)target).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 23:
+ ((MenuItem)target).Click += new RoutedEventHandler(AplicarTitular_OnClick);
+ break;
+ case 24:
+ ContentControl = (ContentControl)target;
+ break;
+ case 25:
+ DataGridTitulares = (DataGrid)target;
+ DataGridTitulares.CellEditEnding += DataGridTitulares_OnCellEditEnding;
+ break;
+ default:
+ _contentLoaded = true;
+ break;
+ }
+ }
+
+ [DebuggerNonUserCode]
+ [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ void IStyleConnector.Connect(int connectionId, object target)
+ {
+ //IL_0027: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0033: Unknown result type (might be due to invalid IL or missing references)
+ //IL_003d: 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_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_006d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0079: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0083: Expected O, but got Unknown
+ //IL_0084: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0090: Unknown result type (might be due to invalid IL or missing references)
+ //IL_009a: 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_00ca: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00d6: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00e0: Expected O, but got Unknown
+ //IL_00e1: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00ed: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00f7: Expected O, but got Unknown
+ //IL_00f9: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0106: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0110: Expected O, but got Unknown
+ //IL_0111: Unknown result type (might be due to invalid IL or missing references)
+ //IL_011e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0128: Expected O, but got Unknown
+ //IL_012a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0136: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0140: Expected O, but got Unknown
+ //IL_0142: Unknown result type (might be due to invalid IL or missing references)
+ //IL_014e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0158: Expected O, but got Unknown
+ //IL_0159: Unknown result type (might be due to invalid IL or missing references)
+ //IL_015f: Expected O, but got Unknown
+ //IL_0172: Unknown result type (might be due to invalid IL or missing references)
+ //IL_017c: Expected O, but got Unknown
+ //IL_017d: Unknown result type (might be due to invalid IL or missing references)
+ switch (connectionId)
+ {
+ case 26:
+ ((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 27:
+ ((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 28:
+ ((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 29:
+ ((UIElement)(TextBox)target).LostFocus += new RoutedEventHandler(FormatarDocumento);
+ ((UIElement)(TextBox)target).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 30:
+ ((Selector)(ComboBox)target).SelectionChanged += new SelectionChangedEventHandler(TipoComboBoxSelectionChanged);
+ break;
+ case 31:
+ ((AutoCompleteBox)target).Populating += new PopulatingEventHandler(AutoCompleteBox_Populating);
+ break;
+ case 32:
+ {
+ EventSetter val = new EventSetter();
+ val.Event = FrameworkElement.LoadedEvent;
+ val.Handler = (Delegate)new RoutedEventHandler(Dependente_CellLoaded);
+ ((Collection<SetterBase>)(object)((Style)target).Setters).Add((SetterBase)(object)val);
+ break;
+ }
+ }
+ }
+}
diff --git a/Decompiler/Gestor.Application.Views.Seguros.Itens/VidaView.cs b/Decompiler/Gestor.Application.Views.Seguros.Itens/VidaView.cs
new file mode 100644
index 0000000..1bf66fe
--- /dev/null
+++ b/Decompiler/Gestor.Application.Views.Seguros.Itens/VidaView.cs
@@ -0,0 +1,690 @@
+using System;
+using System.CodeDom.Compiler;
+using System.Collections;
+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.Input;
+using System.Windows.Markup;
+using System.Windows.Media;
+using System.Windows.Threading;
+using Gestor.Application.Drawers;
+using Gestor.Application.Helpers;
+using Gestor.Application.Servicos;
+using Gestor.Application.ViewModels;
+using Gestor.Application.ViewModels.Seguros;
+using Gestor.Application.ViewModels.Seguros.Itens;
+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.Seguros.Itens;
+
+public class VidaView : BaseUserControl, IComponentConnector, IStyleConnector
+{
+ public VidaViewModel ViewModel;
+
+ private readonly MenuItemViewModel _menuItemViewModel;
+
+ private bool _salvando;
+
+ internal MenuItem IncluirItemButton;
+
+ internal MenuItem SinistroButton;
+
+ internal TextBox PlanoBox;
+
+ internal RadioButton CoberturasRadioButton;
+
+ internal RadioButton MaisInformacoesRadioButton;
+
+ internal Menu BotoesTitulares;
+
+ internal Separator SeparadorMaisInformacoes;
+
+ internal ContentControl ContentControl;
+
+ internal DataGrid DataGridTitulares;
+
+ private bool _contentLoaded;
+
+ public VidaView(MenuItemViewModel menuItemViewModel, bool lockInsert = false, bool substituir = false, ManutencaoItem manutencao = null, Item itemSelecionado = null, Ramo ramo = null, bool endossoRenovacao = false)
+ {
+ _menuItemViewModel = menuItemViewModel;
+ ViewModel = new VidaViewModel(substituir, manutencao, itemSelecionado, ramo, endossoRenovacao);
+ ((FrameworkElement)this).DataContext = ViewModel;
+ InitializeComponent();
+ Dispatcher dispatcher = ((DispatcherObject)this).Dispatcher;
+ if (dispatcher != null)
+ {
+ dispatcher.BeginInvoke((DispatcherPriority)7, (Delegate)new Action(ContentLoad));
+ }
+ if (lockInsert)
+ {
+ ((UIElement)IncluirItemButton).IsEnabled = false;
+ ((UIElement)SinistroButton).Visibility = (Visibility)2;
+ }
+ }
+
+ public async Task Selecionar(Item item)
+ {
+ await ViewModel.SelecionaItem(item);
+ }
+
+ public void Manter(ManutencaoItem manutencao)
+ {
+ ViewModel.Manter(ConsultaViewModel.ItemSelecionado, manutencao);
+ }
+
+ public void Substituir()
+ {
+ ViewModel.Substituir(ConsultaViewModel.ItemSelecionado);
+ }
+
+ 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
+ ((ToggleButton)CoberturasRadioButton).Checked += new RoutedEventHandler(Documento_OnChecked);
+ ((ToggleButton)MaisInformacoesRadioButton).Checked += new RoutedEventHandler(Documento_OnChecked);
+ }
+
+ private void Documento_OnChecked(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
+ RadioButton val = (RadioButton)sender;
+ if (!string.IsNullOrEmpty(val.GroupName))
+ {
+ ViewModel.Descarregar();
+ ((UIElement)ContentControl).Visibility = (Visibility)2;
+ ((UIElement)DataGridTitulares).Visibility = (Visibility)2;
+ ((UIElement)SeparadorMaisInformacoes).Visibility = (Visibility)2;
+ ((UIElement)BotoesTitulares).Visibility = (Visibility)2;
+ ((DependencyObject)(object)DataGridTitulares).ClearInvalid();
+ ((DependencyObject)(object)ContentControl).ClearInvalid();
+ if (!(((FrameworkElement)val).Name == "MaisInformacoesRadioButton"))
+ {
+ ((UIElement)ContentControl).Visibility = (Visibility)0;
+ ViewModel.CarregaCobertura();
+ }
+ else
+ {
+ ((UIElement)SeparadorMaisInformacoes).Visibility = (Visibility)0;
+ ((UIElement)DataGridTitulares).Visibility = (Visibility)0;
+ ((UIElement)BotoesTitulares).Visibility = (Visibility)0;
+ }
+ }
+ }
+
+ private async void Incluir_OnClick(object sender, RoutedEventArgs e)
+ {
+ await ViewModel.Incluir();
+ List<KeyValuePair<string, string>> errorMessages = ViewModel.SelectedItem.Validate();
+ ((DependencyObject)(object)this).ValidateFields(errorMessages);
+ }
+
+ private async void IncluirTitular_OnClick(object sender, RoutedEventArgs e)
+ {
+ TitularesVida val = ((IEnumerable)((ItemsControl)DataGridTitulares).Items).Cast<TitularesVida>().FirstOrDefault();
+ if (val != null && !val.Inicio.HasValue && !val.Fim.HasValue && val.Nome == null && val.Fatura == null && val.Cpf == null && !val.Tipo.HasValue && val.Observacao == null)
+ {
+ await ViewModel.ShowMessage("JÁ EXISTE UM CAMPO DE CADASTRO DE TITULAR CRIADO");
+ return;
+ }
+ ViewModel.IncluirTitular();
+ UpdateAutocompleteDependente(((IEnumerable)((ItemsControl)DataGridTitulares).Items).Cast<TitularesVida>().First(), scroll: false);
+ }
+
+ private void ExcluirTitular_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.ExcluirTitular();
+ }
+
+ private async void ImportarTitulares_OnClick(object sender, RoutedEventArgs e)
+ {
+ await ViewModel.ImportarTitulares();
+ }
+
+ private async void Excluir_OnClick(object sender, RoutedEventArgs e)
+ {
+ if (await ViewModel.Excluir())
+ {
+ _menuItemViewModel?.RecarregarItens(null);
+ }
+ }
+
+ private void Cancelar_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.CancelarAlteracao();
+ }
+
+ public async void Salvar_OnClick(object sender, RoutedEventArgs e)
+ {
+ _salvando = true;
+ ViewModel.Loading(isLoading: true);
+ ViewModel.SelectedItem.Vida.Plano = PlanoBox.Text;
+ ((UIElement)DataGridTitulares).Focus();
+ List<KeyValuePair<string, string>> list = await ViewModel.Salvar(((IEnumerable)((ItemsControl)DataGridTitulares).Items).Cast<TitularesVida>().ToList());
+ ((DependencyObject)(object)this).ValidateFields(list);
+ bool num = list == null || list.Count == 0;
+ ViewModel.Loading(isLoading: false);
+ _salvando = false;
+ if (num)
+ {
+ if (((DomainBase)ViewModel.SelectedItem).Id > 0)
+ {
+ _menuItemViewModel?.RecarregarItens(ViewModel.SelectedItem);
+ }
+ }
+ else
+ {
+ await ViewModel.ShowMessage(list, ViewModel.ErroCamposInvalidos, "OK");
+ }
+ }
+
+ private void Alterar_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.Alterar(alterar: true);
+ }
+
+ private async void AbrirAquivoDigital_Click(object sender, RoutedEventArgs e)
+ {
+ if (!new PermissaoArquivoDigitalServico().BuscarPermissao(Recursos.Usuario, (TipoArquivoDigital)4).Consultar)
+ {
+ await ViewModel.ShowMessage("VOCÊ NÃO POSSUI PERMISSÃO PARA ACESSAR\nARQUIVO DIGITAL DE " + ValidationHelper.GetDescription((Enum)(object)(TipoArquivoDigital)4) + ".");
+ return;
+ }
+ FiltroArquivoDigital filtro = new FiltroArquivoDigital
+ {
+ Id = ((DomainBase)ViewModel.SelectedItem).Id,
+ IdApolice = ((DomainBase)ViewModel.SelectedItem.Documento).Id,
+ Tipo = (TipoArquivoDigital)4,
+ Parente = ViewModel.SelectedItem
+ };
+ ViewModel.ShowDrawer(new ArquivoDigitalDrawer(filtro), 0, close: false);
+ }
+
+ private void AbrirLog_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.AbrirLog((TipoTela)3, ((DomainBase)ViewModel.SelectedItem).Id);
+ }
+
+ private void AbrirLogEmail_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.AbrirLogEmail((TipoTela)3, ((DomainBase)ViewModel.SelectedItem).Id);
+ }
+
+ private void BotoesTitulares_OnIsEnabledChanged(object sender, DependencyPropertyChangedEventArgs e)
+ {
+ //IL_0001: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0044: Unknown result type (might be due to invalid IL or missing references)
+ if (!((UIElement)(Menu)sender).IsEnabled)
+ {
+ ViewModel.AlteracaoTitularesVisibility = (Visibility)2;
+ }
+ DataGrid dataGridTitulares = DataGridTitulares;
+ if (((dataGridTitulares != null) ? dataGridTitulares.Columns.First() : null) != null)
+ {
+ DataGridTitulares.Columns.First().Visibility = (Visibility)((!((UIElement)(Menu)sender).IsEnabled) ? 2 : 0);
+ }
+ }
+
+ private void AlterarTitular_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.AlterarTitular();
+ }
+
+ private void AplicarTitular_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.AplicarTitular();
+ }
+
+ private void DataGridTitulares_OnCellEditEnding(object sender, DataGridCellEditEndingEventArgs e)
+ {
+ if (!(e.EditingElement is TextBox))
+ {
+ return;
+ }
+ FrameworkElement editingElement = e.EditingElement;
+ TextBox val = (TextBox)(object)((editingElement is TextBox) ? editingElement : null);
+ string stringFormat = e.Column.ClipboardContentBinding.StringFormat;
+ if (!(stringFormat == "d"))
+ {
+ if (!(stringFormat == "c"))
+ {
+ if (!string.IsNullOrEmpty((val != null) ? val.Text : null))
+ {
+ if (e.Column.SortMemberPath == "Cpf")
+ {
+ val.Text = ValidationHelper.FormatDocument(val.Text);
+ }
+ }
+ else if (val != null)
+ {
+ val.Text = null;
+ }
+ }
+ else if (!string.IsNullOrEmpty((val != null) ? val.Text : null))
+ {
+ val.Text = ValidationHelper.FormatCurrency(val.Text);
+ }
+ else if (val != null)
+ {
+ val.Text = null;
+ }
+ }
+ else if (!string.IsNullOrEmpty((val != null) ? val.Text : null))
+ {
+ val.Text = ValidationHelper.FormatDate(val.Text);
+ }
+ else if (val != null)
+ {
+ val.Text = null;
+ }
+ }
+
+ private void AutoCompleteBox_Populating(object sender, PopulatingEventArgs e)
+ {
+ if (e.Parameter.Trim().Length < 3)
+ {
+ return;
+ }
+ e.Cancel = true;
+ ViewModel.BuscarTitulares(ValidationHelper.RemoveDiacritics(e.Parameter.Trim())).ContinueWith(delegate(Task<List<TitularesVida>> 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 TipoComboBoxSelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ ComboBox val = (ComboBox)sender;
+ if ((((int)val != 0) ? ((FrameworkElement)val).DataContext : null) != null)
+ {
+ if ((int)((TitularesVida)((FrameworkElement)(ComboBox)sender).DataContext).Tipo.GetValueOrDefault() == 2 && !_salvando && ((DomainBase)ViewModel.SelectedItem.Documento.Controle.Ramo).Id != 6 && !ViewModel.Titulares.Any((TitularesVida x) => (int)x.Tipo.GetValueOrDefault() == 1 || x.Tipo == (TipoTitular?)0))
+ {
+ ((Selector)(ComboBox)sender).SelectedIndex = -1;
+ ((TitularesVida)((FrameworkElement)(ComboBox)sender).DataContext).Tipo = null;
+ await ViewModel.ShowMessage("É NECESSÁRIO ADICIONAR PELO MENOS UM TITULAR DO TIPO SÓCIO OU FUNCIONÁRIO\nANTES DE ADICIONAR UM DEPENDENTE.");
+ }
+ else
+ {
+ UpdateAutocompleteDependente((TitularesVida)((FrameworkElement)(ComboBox)sender).DataContext, scroll: false);
+ }
+ }
+ }
+
+ private void UpdateAutocompleteDependente(TitularesVida item, bool scroll = true)
+ {
+ //IL_005a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0060: Expected O, but got Unknown
+ //IL_0076: 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_008a: Invalid comparison between Unknown and I4
+ if (scroll)
+ {
+ DataGridTitulares.ScrollIntoView((object)item, DataGridTitulares.Columns.First((DataGridColumn x) => (string)x.Header == "TITULAR DEPENDENTE"));
+ }
+ ((UIElement)DataGridTitulares).UpdateLayout();
+ DataGridRow val = (DataGridRow)((ItemsControl)DataGridTitulares).ItemContainerGenerator.ContainerFromItem((object)item);
+ if (val != null)
+ {
+ ((UIElement)(DataGridCell)((ItemsControl)DataGridExtensions.GetVisualChild<DataGridCellsPresenter>((Visual)(object)val)).ItemContainerGenerator.ContainerFromIndex(12)).Visibility = (Visibility)(((int)item.Tipo.GetValueOrDefault() != 2) ? 2 : 0);
+ if (scroll)
+ {
+ DataGridTitulares.ScrollIntoView((object)item, DataGridTitulares.Columns.First());
+ }
+ ((UIElement)DataGridTitulares).UpdateLayout();
+ }
+ }
+
+ private void Dependente_CellLoaded(object sender, RoutedEventArgs e)
+ {
+ //IL_0005: Unknown result type (might be due to invalid IL or missing references)
+ //IL_000b: 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)
+ //IL_0029: Unknown result type (might be due to invalid IL or missing references)
+ //IL_002f: Invalid comparison between Unknown and I4
+ if (sender != null)
+ {
+ DataGridCell val = (DataGridCell)sender;
+ TitularesVida val2 = (TitularesVida)((FrameworkElement)(DataGridCell)sender).DataContext;
+ ((UIElement)val).Visibility = (Visibility)(((int)val2 == 0 || (int)val2.Tipo.GetValueOrDefault() != 2) ? 2 : 0);
+ }
+ }
+
+ private void MenuItem_OnClick(object sender, RoutedEventArgs e)
+ {
+ ((Window)new HosterWindow((ContentControl)(object)new SinistroView(ViewModel.SelectedItem, attached: false), "CADASTRO DE SINISTROS - " + ViewModel.SelectedItem.Descricao)).ShowDialog();
+ _menuItemViewModel?.RecarregarItens(ViewModel.SelectedItem);
+ }
+
+ private void CopyCodItem(object sender, MouseButtonEventArgs e)
+ {
+ ViewModel.CodigoItem.CopyToClipboard();
+ ViewModel.ToggleSnackBar("COPIADO - " + ViewModel.CodigoItem);
+ }
+
+ [DebuggerNonUserCode]
+ [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
+ public void InitializeComponent()
+ {
+ if (!_contentLoaded)
+ {
+ _contentLoaded = true;
+ Uri uri = new Uri("/Gestor.Application;component/views/seguros/itens/vidaview.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_0077: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0081: 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_009a: Unknown result type (might be due to invalid IL or missing references)
+ //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
+ //IL_00ca: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00d6: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00e0: Expected O, but got Unknown
+ //IL_00e2: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00ee: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00f8: Expected O, but got Unknown
+ //IL_00fa: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0106: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0110: Expected O, but got Unknown
+ //IL_0112: Unknown result type (might be due to invalid IL or missing references)
+ //IL_011e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0128: Expected O, but got Unknown
+ //IL_012b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0135: Expected O, but got Unknown
+ //IL_0142: Unknown result type (might be due to invalid IL or missing references)
+ //IL_014c: Expected O, but got Unknown
+ //IL_014e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_015a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0164: Expected O, but got Unknown
+ //IL_0166: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0172: Unknown result type (might be due to invalid IL or missing references)
+ //IL_017c: Expected O, but got Unknown
+ //IL_017f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0189: Expected O, but got Unknown
+ //IL_018c: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0196: 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_01a6: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01b0: Expected O, but got Unknown
+ //IL_01bd: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01c7: Expected O, but got Unknown
+ //IL_01c9: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01d5: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01df: Expected O, but got Unknown
+ //IL_01e1: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01ed: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01f7: Expected O, but got Unknown
+ //IL_01f9: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0205: Unknown result type (might be due to invalid IL or missing references)
+ //IL_020f: Expected O, but got Unknown
+ //IL_0211: Unknown result type (might be due to invalid IL or missing references)
+ //IL_021d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0227: Expected O, but got Unknown
+ //IL_022a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0234: Expected O, but got Unknown
+ //IL_0236: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0242: Unknown result type (might be due to invalid IL or missing references)
+ //IL_024c: Expected O, but got Unknown
+ //IL_024d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0259: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0263: Expected O, but got Unknown
+ //IL_0264: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0270: Unknown result type (might be due to invalid IL or missing references)
+ //IL_027a: Expected O, but got Unknown
+ //IL_027c: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0288: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0292: Expected O, but got Unknown
+ //IL_0293: Unknown result type (might be due to invalid IL or missing references)
+ //IL_029f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02a9: Expected O, but got Unknown
+ //IL_02aa: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02b6: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02c0: Expected O, but got Unknown
+ //IL_02c2: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02ce: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02d8: Expected O, but got Unknown
+ //IL_02d9: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02e5: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02ef: Expected O, but got Unknown
+ //IL_02f0: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02fc: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0306: Expected O, but got Unknown
+ //IL_0308: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0315: Unknown result type (might be due to invalid IL or missing references)
+ //IL_031f: Expected O, but got Unknown
+ //IL_0320: Unknown result type (might be due to invalid IL or missing references)
+ //IL_032d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0337: Expected O, but got Unknown
+ //IL_0339: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0345: Unknown result type (might be due to invalid IL or missing references)
+ //IL_034f: Expected O, but got Unknown
+ //IL_0352: Unknown result type (might be due to invalid IL or missing references)
+ //IL_035c: Expected O, but got Unknown
+ //IL_035f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0369: Expected O, but got Unknown
+ switch (connectionId)
+ {
+ case 1:
+ IncluirItemButton = (MenuItem)target;
+ IncluirItemButton.Click += new RoutedEventHandler(Incluir_OnClick);
+ break;
+ case 2:
+ ((MenuItem)target).Click += new RoutedEventHandler(Alterar_OnClick);
+ break;
+ case 3:
+ ((MenuItem)target).Click += new RoutedEventHandler(Salvar_OnClick);
+ break;
+ case 4:
+ ((MenuItem)target).Click += new RoutedEventHandler(Cancelar_OnClick);
+ break;
+ case 5:
+ ((MenuItem)target).Click += new RoutedEventHandler(Excluir_OnClick);
+ break;
+ case 6:
+ ((Control)(TextBox)target).MouseDoubleClick += new MouseButtonEventHandler(CopyCodItem);
+ break;
+ case 7:
+ ((MenuItem)target).Click += new RoutedEventHandler(AbrirAquivoDigital_Click);
+ break;
+ case 8:
+ SinistroButton = (MenuItem)target;
+ SinistroButton.Click += new RoutedEventHandler(MenuItem_OnClick);
+ break;
+ case 9:
+ ((MenuItem)target).Click += new RoutedEventHandler(AbrirLog_OnClick);
+ break;
+ case 10:
+ ((MenuItem)target).Click += new RoutedEventHandler(AbrirLogEmail_OnClick);
+ break;
+ case 11:
+ PlanoBox = (TextBox)target;
+ break;
+ case 12:
+ CoberturasRadioButton = (RadioButton)target;
+ break;
+ case 13:
+ MaisInformacoesRadioButton = (RadioButton)target;
+ break;
+ case 14:
+ BotoesTitulares = (Menu)target;
+ ((UIElement)BotoesTitulares).IsEnabledChanged += new DependencyPropertyChangedEventHandler(BotoesTitulares_OnIsEnabledChanged);
+ break;
+ case 15:
+ ((MenuItem)target).Click += new RoutedEventHandler(IncluirTitular_OnClick);
+ break;
+ case 16:
+ ((MenuItem)target).Click += new RoutedEventHandler(AlterarTitular_OnClick);
+ break;
+ case 17:
+ ((MenuItem)target).Click += new RoutedEventHandler(ExcluirTitular_OnClick);
+ break;
+ case 18:
+ ((MenuItem)target).Click += new RoutedEventHandler(ImportarTitulares_OnClick);
+ break;
+ case 19:
+ SeparadorMaisInformacoes = (Separator)target;
+ break;
+ case 20:
+ ((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 21:
+ ((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 22:
+ ((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 23:
+ ((UIElement)(TextBox)target).LostFocus += new RoutedEventHandler(FormatarDocumento);
+ ((UIElement)(TextBox)target).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 24:
+ ((MenuItem)target).Click += new RoutedEventHandler(AplicarTitular_OnClick);
+ break;
+ case 25:
+ ContentControl = (ContentControl)target;
+ break;
+ case 26:
+ DataGridTitulares = (DataGrid)target;
+ DataGridTitulares.CellEditEnding += DataGridTitulares_OnCellEditEnding;
+ break;
+ default:
+ _contentLoaded = true;
+ break;
+ }
+ }
+
+ [DebuggerNonUserCode]
+ [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ void IStyleConnector.Connect(int connectionId, object target)
+ {
+ //IL_0027: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0033: Unknown result type (might be due to invalid IL or missing references)
+ //IL_003d: 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_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_006d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0079: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0083: Expected O, but got Unknown
+ //IL_0084: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0090: Unknown result type (might be due to invalid IL or missing references)
+ //IL_009a: 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_00ca: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00d6: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00e0: Expected O, but got Unknown
+ //IL_00e1: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00ed: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00f7: Expected O, but got Unknown
+ //IL_00f9: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0106: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0110: Expected O, but got Unknown
+ //IL_0111: Unknown result type (might be due to invalid IL or missing references)
+ //IL_011e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0128: Expected O, but got Unknown
+ //IL_012a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0136: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0140: Expected O, but got Unknown
+ //IL_0142: Unknown result type (might be due to invalid IL or missing references)
+ //IL_014e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0158: Expected O, but got Unknown
+ //IL_0159: Unknown result type (might be due to invalid IL or missing references)
+ //IL_015f: Expected O, but got Unknown
+ //IL_0172: Unknown result type (might be due to invalid IL or missing references)
+ //IL_017c: Expected O, but got Unknown
+ //IL_017d: Unknown result type (might be due to invalid IL or missing references)
+ switch (connectionId)
+ {
+ case 27:
+ ((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 28:
+ ((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 29:
+ ((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 30:
+ ((UIElement)(TextBox)target).LostFocus += new RoutedEventHandler(FormatarDocumento);
+ ((UIElement)(TextBox)target).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 31:
+ ((Selector)(ComboBox)target).SelectionChanged += new SelectionChangedEventHandler(TipoComboBoxSelectionChanged);
+ break;
+ case 32:
+ ((AutoCompleteBox)target).Populating += new PopulatingEventHandler(AutoCompleteBox_Populating);
+ break;
+ case 33:
+ {
+ EventSetter val = new EventSetter();
+ val.Event = FrameworkElement.LoadedEvent;
+ val.Handler = (Delegate)new RoutedEventHandler(Dependente_CellLoaded);
+ ((Collection<SetterBase>)(object)((Style)target).Setters).Add((SetterBase)(object)val);
+ break;
+ }
+ }
+ }
+}