summaryrefslogtreecommitdiff
path: root/Decompiler/Gestor.Application.Componentes/DialogExtratoComissao.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Decompiler/Gestor.Application.Componentes/DialogExtratoComissao.cs')
-rw-r--r--Decompiler/Gestor.Application.Componentes/DialogExtratoComissao.cs210
1 files changed, 210 insertions, 0 deletions
diff --git a/Decompiler/Gestor.Application.Componentes/DialogExtratoComissao.cs b/Decompiler/Gestor.Application.Componentes/DialogExtratoComissao.cs
new file mode 100644
index 0000000..5d07bf8
--- /dev/null
+++ b/Decompiler/Gestor.Application.Componentes/DialogExtratoComissao.cs
@@ -0,0 +1,210 @@
+using System;
+using System.CodeDom.Compiler;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Diagnostics;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Controls.Primitives;
+using System.Windows.Input;
+using System.Windows.Markup;
+using System.Windows.Threading;
+using Gestor.Application.ViewModels.Generic;
+using Gestor.Application.Views.Generic;
+using Gestor.Model.Domain.Seguros;
+using MaterialDesignThemes.Wpf;
+
+namespace Gestor.Application.Componentes;
+
+public class DialogExtratoComissao : BaseUserControl, IComponentConnector, IStyleConnector
+{
+ public ExtratoComissaoViewModel ViewModel;
+
+ internal ComboBox SeguradoraBox;
+
+ internal ComboBox SeguradoraSocialBox;
+
+ internal DatePicker InicioBox;
+
+ internal DatePicker FimBox;
+
+ internal ProgressBar ProgressBar;
+
+ internal DataGrid ExtratoGrid;
+
+ internal Button ImportarButton;
+
+ internal Button FecharButton;
+
+ private bool _contentLoaded;
+
+ public DialogExtratoComissao(List<Seguradora> seguradoras)
+ {
+ InitializeComponent();
+ ViewModel = new ExtratoComissaoViewModel(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_003b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0045: Expected O, but got Unknown
+ //IL_0052: Unknown result type (might be due to invalid IL or missing references)
+ //IL_005c: Expected O, but got Unknown
+ InicioBox.SelectedDateChanged += DataBox_SelectedDateChanged;
+ FimBox.SelectedDateChanged += DataBox_SelectedDateChanged;
+ ((Selector)SeguradoraBox).SelectionChanged += new SelectionChangedEventHandler(SeguradoraBox_SelectionChanged);
+ ((Selector)SeguradoraSocialBox).SelectionChanged += new SelectionChangedEventHandler(SeguradoraSicialBox_SelectionChanged);
+ }
+
+ private void SeguradoraSicialBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ ((Selector)SeguradoraBox).SelectedItem = ((Selector)SeguradoraSocialBox).SelectedItem;
+ CarregarExtratos();
+ }
+
+ private void SeguradoraBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ CarregarExtratos();
+ }
+
+ private void Importar_OnClick(object sender, RoutedEventArgs e)
+ {
+ DialogHost.CloseDialogCommand.Execute((object)ViewModel.Selecionar(), (IInputElement)(object)ImportarButton);
+ }
+
+ private void Fechar_OnClick(object sender, RoutedEventArgs e)
+ {
+ DialogHost.CloseDialogCommand.Execute((object)null, (IInputElement)(object)FecharButton);
+ }
+
+ private void DataBox_SelectedDateChanged(object sender, SelectionChangedEventArgs e)
+ {
+ CarregarExtratos();
+ }
+
+ private async void CarregarExtratos()
+ {
+ if (((Selector)SeguradoraBox).SelectedItem != null && InicioBox.SelectedDate.HasValue && FimBox.SelectedDate.HasValue)
+ {
+ ViewModel.IsEnabled = false;
+ ((UIElement)ProgressBar).Visibility = (Visibility)0;
+ await ViewModel.CarregarExtratos((Seguradora)((Selector)SeguradoraBox).SelectedItem, InicioBox.SelectedDate.Value, FimBox.SelectedDate.Value);
+ ((UIElement)ProgressBar).Visibility = (Visibility)2;
+ ViewModel.IsEnabled = true;
+ }
+ }
+
+ private void CheckBox_Checked(object sender, RoutedEventArgs e)
+ {
+ ViewModel.SelecionarTudo();
+ }
+
+ [DebuggerNonUserCode]
+ [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
+ public void InitializeComponent()
+ {
+ if (!_contentLoaded)
+ {
+ _contentLoaded = true;
+ Uri uri = new Uri("/Gestor.Application;component/componentes/dialogextratocomissao.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_0033: Unknown result type (might be due to invalid IL or missing references)
+ //IL_003d: Expected O, but got Unknown
+ //IL_0040: Unknown result type (might be due to invalid IL or missing references)
+ //IL_004a: Expected O, but got Unknown
+ //IL_004d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0057: Expected O, but got Unknown
+ //IL_0064: Unknown result type (might be due to invalid IL or missing references)
+ //IL_006e: Expected O, but got Unknown
+ //IL_0071: Unknown result type (might be due to invalid IL or missing references)
+ //IL_007b: Expected O, but got Unknown
+ //IL_0088: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0092: Expected O, but got Unknown
+ //IL_0095: Unknown result type (might be due to invalid IL or missing references)
+ //IL_009f: Expected O, but got Unknown
+ //IL_00a2: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00ac: Expected O, but got Unknown
+ //IL_00af: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00b9: Expected O, but got Unknown
+ //IL_00c6: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00d0: Expected O, but got Unknown
+ //IL_00d3: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00dd: Expected O, but got Unknown
+ //IL_00ea: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00f4: Expected O, but got Unknown
+ switch (connectionId)
+ {
+ case 1:
+ SeguradoraBox = (ComboBox)target;
+ break;
+ case 2:
+ SeguradoraSocialBox = (ComboBox)target;
+ break;
+ case 3:
+ InicioBox = (DatePicker)target;
+ ((UIElement)InicioBox).LostKeyboardFocus += new KeyboardFocusChangedEventHandler(base.DatePicker_OnLostKeyboardFocus);
+ break;
+ case 4:
+ FimBox = (DatePicker)target;
+ ((UIElement)FimBox).LostKeyboardFocus += new KeyboardFocusChangedEventHandler(base.DatePicker_OnLostKeyboardFocus);
+ break;
+ case 5:
+ ProgressBar = (ProgressBar)target;
+ break;
+ case 6:
+ ExtratoGrid = (DataGrid)target;
+ break;
+ case 8:
+ ImportarButton = (Button)target;
+ ((ButtonBase)ImportarButton).Click += new RoutedEventHandler(Importar_OnClick);
+ break;
+ case 9:
+ FecharButton = (Button)target;
+ ((ButtonBase)FecharButton).Click += new RoutedEventHandler(Fechar_OnClick);
+ break;
+ default:
+ _contentLoaded = true;
+ break;
+ }
+ }
+
+ [DebuggerNonUserCode]
+ [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ void IStyleConnector.Connect(int connectionId, object target)
+ {
+ //IL_0005: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0011: Unknown result type (might be due to invalid IL or missing references)
+ //IL_001b: Expected O, but got Unknown
+ //IL_001c: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0028: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0032: Expected O, but got Unknown
+ if (connectionId == 7)
+ {
+ ((ToggleButton)(CheckBox)target).Checked += new RoutedEventHandler(CheckBox_Checked);
+ ((ToggleButton)(CheckBox)target).Unchecked += new RoutedEventHandler(CheckBox_Checked);
+ }
+ }
+}