summaryrefslogtreecommitdiff
path: root/Decompiler/Gestor.Application.Drawers/ExtratosDrawer.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Decompiler/Gestor.Application.Drawers/ExtratosDrawer.cs')
-rw-r--r--Decompiler/Gestor.Application.Drawers/ExtratosDrawer.cs246
1 files changed, 246 insertions, 0 deletions
diff --git a/Decompiler/Gestor.Application.Drawers/ExtratosDrawer.cs b/Decompiler/Gestor.Application.Drawers/ExtratosDrawer.cs
new file mode 100644
index 0000000..1dd3f48
--- /dev/null
+++ b/Decompiler/Gestor.Application.Drawers/ExtratosDrawer.cs
@@ -0,0 +1,246 @@
+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 Gestor.Application.ViewModels.Drawer;
+using Gestor.Application.Views.Generic;
+using Gestor.Model.Common;
+using Gestor.Model.Domain.Relatorios.ClientesAtivosInativos;
+using Gestor.Model.Domain.Seguros;
+using MaterialDesignThemes.Wpf;
+
+namespace Gestor.Application.Drawers;
+
+public class ExtratosDrawer : BaseUserControl, IComponentConnector
+{
+ internal ProgressBar ProgressBar;
+
+ internal StackPanel Tipo;
+
+ internal StackPanel Cliente;
+
+ internal ToggleButton ClienteToggle;
+
+ internal StackPanel Documento;
+
+ internal StackPanel Endosso;
+
+ internal StackPanel Item;
+
+ internal StackPanel Perfil;
+
+ internal Snackbar Snackbar;
+
+ private bool _contentLoaded;
+
+ public ExtratosViewModel ViewModel { get; set; }
+
+ private static List<Documento> Documentos { get; set; }
+
+ private static List<Prospeccao> Prospeccoes { get; set; }
+
+ private static List<long> Selecionados { get; set; }
+
+ private static List<long> SelecionadosPros { get; set; }
+
+ private static List<ClientesAtivosInativos> Clientes { get; set; }
+
+ private static Relatorio? TipoRelatorio { get; set; }
+
+ public ExtratosDrawer(List<ClientesAtivosInativos> clientes = null, List<Documento> documentos = null, Relatorio? tipoRelatorio = null, List<long> selecionados = null, List<long> selecionadosPros = null, List<Prospeccao> prospeccaos = null)
+ {
+ //IL_004a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_004f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0050: Unknown result type (might be due to invalid IL or missing references)
+ //IL_006a: Expected I4, but got Unknown
+ //IL_0108: Unknown result type (might be due to invalid IL or missing references)
+ Documentos = documentos;
+ Prospeccoes = prospeccaos;
+ Selecionados = selecionados;
+ Clientes = clientes;
+ TipoRelatorio = tipoRelatorio;
+ SelecionadosPros = selecionadosPros;
+ ViewModel = new ExtratosViewModel
+ {
+ TipoDeRelatorio = tipoRelatorio
+ };
+ switch (tipoRelatorio)
+ {
+ case 2L:
+ case 4L:
+ ViewModel.TipoExtratoEnabled = false;
+ ViewModel.SelectedTipoExtrato = (TipoExtrato)1;
+ ViewModel.ClientePorPaginaVisibility = (Visibility)0;
+ ViewModel.SelecionarItensVisibility = (Visibility)2;
+ break;
+ case null:
+ ViewModel.TipoExtratoEnabled = true;
+ ViewModel.ClientePorPaginaVisibility = (Visibility)2;
+ break;
+ case 0L:
+ ViewModel.TipoExtratoEnabled = false;
+ ViewModel.SelectedTipoExtrato = (TipoExtrato)0;
+ ViewModel.SelecionarItensVisibility = (Visibility)2;
+ break;
+ default:
+ ViewModel.SelectedTipoExtrato = (TipoExtrato)1;
+ ViewModel.SelecionarItensVisibility = (Visibility)2;
+ ViewModel.SelecionarItensVisibility = (Visibility)2;
+ break;
+ }
+ if ((int)ViewModel.SelectedTipoExtrato == 0)
+ {
+ ViewModel.EsconderResumido = true;
+ ViewModel.ClienteVisibility = true;
+ }
+ ((FrameworkElement)this).DataContext = ViewModel;
+ InitializeComponent();
+ }
+
+ private async void Gerar_OnClick(object sender, RoutedEventArgs e)
+ {
+ if (Clientes != null)
+ {
+ await ViewModel.PrepararExtrato(Clientes, null, null, TipoRelatorio);
+ }
+ else if (Documentos != null || Prospeccoes != null)
+ {
+ await ViewModel.PrepararExtrato(null, Documentos, Prospeccoes, TipoRelatorio, Selecionados, SelecionadosPros);
+ }
+ }
+
+ private async void GerarPDF_OnClick(object sender, RoutedEventArgs e)
+ {
+ if (Clientes != null)
+ {
+ await ViewModel.PrepararExtrato(Clientes, null, null, TipoRelatorio, null, null, pdf: true);
+ }
+ else if (Documentos != null || Prospeccoes != null)
+ {
+ await ViewModel.PrepararExtrato(null, Documentos, Prospeccoes, TipoRelatorio, Selecionados, SelecionadosPros, pdf: true);
+ }
+ }
+
+ private void Fechar_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.CloseDrawer();
+ }
+
+ private void SnackbarMessage_ActionClick(object sender, RoutedEventArgs e)
+ {
+ Snackbar.IsActive = false;
+ }
+
+ [DebuggerNonUserCode]
+ [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
+ public void InitializeComponent()
+ {
+ if (!_contentLoaded)
+ {
+ _contentLoaded = true;
+ Uri uri = new Uri("/Gestor.Application;component/drawers/extratosdrawer.xaml", UriKind.Relative);
+ Application.LoadComponent((object)this, uri);
+ }
+ }
+
+ [DebuggerNonUserCode]
+ [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
+ internal Delegate _CreateDelegate(Type delegateType, string handler)
+ {
+ return Delegate.CreateDelegate(delegateType, this, handler);
+ }
+
+ [DebuggerNonUserCode]
+ [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ void IComponentConnector.Connect(int connectionId, object target)
+ {
+ //IL_0046: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0052: Unknown result type (might be due to invalid IL or missing references)
+ //IL_005c: Expected O, but got Unknown
+ //IL_005f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0069: Expected O, but got Unknown
+ //IL_006b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0077: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0081: Expected O, but got Unknown
+ //IL_0084: Unknown result type (might be due to invalid IL or missing references)
+ //IL_008e: Expected O, but got Unknown
+ //IL_0091: Unknown result type (might be due to invalid IL or missing references)
+ //IL_009b: Expected O, but got Unknown
+ //IL_009e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00a8: Expected O, but got Unknown
+ //IL_00ab: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00b5: Expected O, but got Unknown
+ //IL_00b8: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00c2: Expected O, but got Unknown
+ //IL_00c5: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00cf: Expected O, but got Unknown
+ //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_010f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0119: Expected O, but got Unknown
+ //IL_011b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0127: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0131: Expected O, but got Unknown
+ switch (connectionId)
+ {
+ case 1:
+ ((UIElement)(ScrollViewer)target).PreviewMouseWheel += new MouseWheelEventHandler(base.ScrollViewer_PreviewMouseWheel);
+ break;
+ case 2:
+ ProgressBar = (ProgressBar)target;
+ break;
+ case 3:
+ ((ButtonBase)(Button)target).Click += new RoutedEventHandler(Fechar_OnClick);
+ break;
+ case 4:
+ Tipo = (StackPanel)target;
+ break;
+ case 5:
+ Cliente = (StackPanel)target;
+ break;
+ case 6:
+ ClienteToggle = (ToggleButton)target;
+ break;
+ case 7:
+ Documento = (StackPanel)target;
+ break;
+ case 8:
+ Endosso = (StackPanel)target;
+ break;
+ case 9:
+ Item = (StackPanel)target;
+ break;
+ case 10:
+ Perfil = (StackPanel)target;
+ break;
+ case 11:
+ ((MenuItem)target).Click += new RoutedEventHandler(Gerar_OnClick);
+ break;
+ case 12:
+ ((MenuItem)target).Click += new RoutedEventHandler(GerarPDF_OnClick);
+ break;
+ case 13:
+ Snackbar = (Snackbar)target;
+ break;
+ case 14:
+ ((SnackbarMessage)target).ActionClick += new RoutedEventHandler(SnackbarMessage_ActionClick);
+ break;
+ default:
+ _contentLoaded = true;
+ break;
+ }
+ }
+}