summaryrefslogtreecommitdiff
path: root/Decompiler/Gestor.Application.Views.Ferramentas/IncluirSeguradoraView.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.Ferramentas/IncluirSeguradoraView.cs
parent1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1 (diff)
downloadgestor-225aa1499e37faf9d38257caabbadc68d78b427e.tar.gz
gestor-225aa1499e37faf9d38257caabbadc68d78b427e.zip
decompiler.com
Diffstat (limited to 'Decompiler/Gestor.Application.Views.Ferramentas/IncluirSeguradoraView.cs')
-rw-r--r--Decompiler/Gestor.Application.Views.Ferramentas/IncluirSeguradoraView.cs137
1 files changed, 137 insertions, 0 deletions
diff --git a/Decompiler/Gestor.Application.Views.Ferramentas/IncluirSeguradoraView.cs b/Decompiler/Gestor.Application.Views.Ferramentas/IncluirSeguradoraView.cs
new file mode 100644
index 0000000..90c0bd8
--- /dev/null
+++ b/Decompiler/Gestor.Application.Views.Ferramentas/IncluirSeguradoraView.cs
@@ -0,0 +1,137 @@
+using System;
+using System.CodeDom.Compiler;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Diagnostics;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Controls.Primitives;
+using System.Windows.Input;
+using System.Windows.Markup;
+using System.Windows.Threading;
+using Gestor.Application.Actions;
+using Gestor.Application.ViewModels.Ferramentas;
+using Gestor.Application.Views.Generic;
+using Gestor.Model.Domain.Seguros;
+
+namespace Gestor.Application.Views.Ferramentas;
+
+public class IncluirSeguradoraView : BaseUserControl, IComponentConnector
+{
+ public IncluirSeguradoraViewModel ViewModel;
+
+ internal DataGrid SeguradoraGrid;
+
+ private bool _contentLoaded;
+
+ public IncluirSeguradoraView(List<Seguradora> seguradoras)
+ {
+ ViewModel = new IncluirSeguradoraViewModel(seguradoras);
+ ((FrameworkElement)this).DataContext = ViewModel;
+ InitializeComponent();
+ Dispatcher dispatcher = ((DispatcherObject)this).Dispatcher;
+ if (dispatcher != null)
+ {
+ dispatcher.BeginInvoke((DispatcherPriority)7, (Delegate)new Action(ContentLoad));
+ }
+ }
+
+ private void ContentLoad()
+ {
+ //IL_000d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0017: Expected O, but got Unknown
+ ((Selector)SeguradoraGrid).SelectionChanged += new SelectionChangedEventHandler(SeguradoraGrid_OnSelectionChanged);
+ }
+
+ private void SeguradoraGrid_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ //IL_0001: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0007: Expected O, but got Unknown
+ //IL_0031: Unknown result type (might be due to invalid IL or missing references)
+ //IL_003b: Expected O, but got Unknown
+ DataGrid val = (DataGrid)sender;
+ if (val == null || ((Selector)val).SelectedIndex >= 0)
+ {
+ ViewModel.SelectedSeguradora = (Seguradora)((val != null) ? ((ItemsControl)val).Items[((Selector)val).SelectedIndex] : null);
+ }
+ }
+
+ private void Pesquisar_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.Pesquisar();
+ }
+
+ private void Incluir_OnClick(object sender, RoutedEventArgs e)
+ {
+ if (ViewModel.SelectedSeguradora != null)
+ {
+ ViewModel.AdicionarSeguradora = ViewModel.SelectedSeguradora;
+ Gestor.Application.Actions.Actions.CloseHoster?.Invoke();
+ }
+ }
+
+ private void Pesquisar_OnPreviewKeyDown(object sender, KeyEventArgs e)
+ {
+ //IL_0001: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0007: Invalid comparison between Unknown and I4
+ if ((int)e.Key == 6)
+ {
+ ViewModel.Pesquisar();
+ }
+ }
+
+ [DebuggerNonUserCode]
+ [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
+ public void InitializeComponent()
+ {
+ if (!_contentLoaded)
+ {
+ _contentLoaded = true;
+ Uri uri = new Uri("/Gestor.Application;component/views/ferramentas/incluirseguradoraview.xaml", UriKind.Relative);
+ Application.LoadComponent((object)this, uri);
+ }
+ }
+
+ [DebuggerNonUserCode]
+ [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
+ internal Delegate _CreateDelegate(Type delegateType, string handler)
+ {
+ return Delegate.CreateDelegate(delegateType, this, handler);
+ }
+
+ [DebuggerNonUserCode]
+ [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ void IComponentConnector.Connect(int connectionId, object target)
+ {
+ //IL_001b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0027: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0031: Expected O, but got Unknown
+ //IL_0033: Unknown result type (might be due to invalid IL or missing references)
+ //IL_003f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0049: Expected O, but got Unknown
+ //IL_004c: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0056: Expected O, but got Unknown
+ //IL_0058: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0064: Unknown result type (might be due to invalid IL or missing references)
+ //IL_006e: Expected O, but got Unknown
+ switch (connectionId)
+ {
+ case 1:
+ ((UIElement)(TextBox)target).PreviewKeyDown += new KeyEventHandler(Pesquisar_OnPreviewKeyDown);
+ break;
+ case 2:
+ ((ButtonBase)(Button)target).Click += new RoutedEventHandler(Pesquisar_OnClick);
+ break;
+ case 3:
+ SeguradoraGrid = (DataGrid)target;
+ break;
+ case 4:
+ ((ButtonBase)(Button)target).Click += new RoutedEventHandler(Incluir_OnClick);
+ break;
+ default:
+ _contentLoaded = true;
+ break;
+ }
+ }
+}