summaryrefslogtreecommitdiff
path: root/Decompiler/Gestor.Application.Views.Seguros.Itens/AeronauticoView.cs
diff options
context:
space:
mode:
authorLucas Faria Mendes <lucas.fariamo08@gmail.com>2026-03-30 15:29:41 +0000
committerLucas Faria Mendes <lucas.fariamo08@gmail.com>2026-03-30 15:29:41 +0000
commit225aa1499e37faf9d38257caabbadc68d78b427e (patch)
tree102bb7a40c58595348ae9d3c7076201759fe0720 /Decompiler/Gestor.Application.Views.Seguros.Itens/AeronauticoView.cs
parent1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1 (diff)
downloadgestor-225aa1499e37faf9d38257caabbadc68d78b427e.tar.gz
gestor-225aa1499e37faf9d38257caabbadc68d78b427e.zip
decompiler.com
Diffstat (limited to 'Decompiler/Gestor.Application.Views.Seguros.Itens/AeronauticoView.cs')
-rw-r--r--Decompiler/Gestor.Application.Views.Seguros.Itens/AeronauticoView.cs373
1 files changed, 373 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;
+ }
+ }
+}