summaryrefslogtreecommitdiff
path: root/Decompiler/Gestor.Application.Drawers.Relatorios
diff options
context:
space:
mode:
Diffstat (limited to 'Decompiler/Gestor.Application.Drawers.Relatorios')
-rw-r--r--Decompiler/Gestor.Application.Drawers.Relatorios/ConfiguracaoRelatorio.cs324
-rw-r--r--Decompiler/Gestor.Application.Drawers.Relatorios/FiltroRelatorio.cs155
2 files changed, 479 insertions, 0 deletions
diff --git a/Decompiler/Gestor.Application.Drawers.Relatorios/ConfiguracaoRelatorio.cs b/Decompiler/Gestor.Application.Drawers.Relatorios/ConfiguracaoRelatorio.cs
new file mode 100644
index 0000000..afe9d1c
--- /dev/null
+++ b/Decompiler/Gestor.Application.Drawers.Relatorios/ConfiguracaoRelatorio.cs
@@ -0,0 +1,324 @@
+using System;
+using System.CodeDom.Compiler;
+using System.ComponentModel;
+using System.Diagnostics;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Controls.Primitives;
+using System.Windows.Markup;
+using System.Windows.Threading;
+using Gestor.Application.ViewModels.Relatorios;
+using Gestor.Model.Domain.Relatorios;
+using MaterialDesignThemes.Wpf;
+
+namespace Gestor.Application.Drawers.Relatorios;
+
+public class ConfiguracaoRelatorio : UserControl, IComponentConnector, IStyleConnector
+{
+ internal ProgressBar ProgressBar;
+
+ internal RadioButton CampoButton;
+
+ internal RadioButton TotalizacaoButton;
+
+ internal ComboBox CampoComboBox;
+
+ internal ComboBox TotalizacaoComboBox;
+
+ internal DataGrid ParametrosGrid;
+
+ internal DataGrid TotalizacaoGrid;
+
+ internal Snackbar SnackbarArquivoDigital;
+
+ private bool _contentLoaded;
+
+ public RelatorioViewModel ViewModel { get; set; }
+
+ public ConfiguracaoRelatorio(RelatorioViewModel viewModel)
+ {
+ ViewModel = viewModel;
+ ((FrameworkElement)this).DataContext = ViewModel;
+ InitializeComponent();
+ Dispatcher dispatcher = ((DispatcherObject)this).Dispatcher;
+ if (dispatcher != null)
+ {
+ dispatcher.BeginInvoke((DispatcherPriority)7, (Delegate)new Action(ContentLoad));
+ }
+ }
+
+ private async void ContentLoad()
+ {
+ ((ToggleButton)CampoButton).IsChecked = ViewModel.IsCampo;
+ ((ToggleButton)TotalizacaoButton).IsChecked = !ViewModel.IsCampo;
+ ((ToggleButton)CampoButton).Checked += new RoutedEventHandler(Campo_OnChecked);
+ ((ToggleButton)TotalizacaoButton).Checked += new RoutedEventHandler(Totalizacao_OnChecked);
+ ViewModel.IsEnabled = false;
+ await ViewModel.CarregarConfiguracoes();
+ ViewModel.IsEnabled = true;
+ }
+
+ private void Campo_OnChecked(object sender, RoutedEventArgs e)
+ {
+ ViewModel.IsCampo = true;
+ }
+
+ private void Totalizacao_OnChecked(object sender, RoutedEventArgs e)
+ {
+ ViewModel.IsCampo = false;
+ }
+
+ private void Fechar_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.CloseDrawer();
+ }
+
+ private async void Salvar_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.IsEnabled = false;
+ bool num = await ViewModel.SalvarParametros();
+ ViewModel.IsEnabled = true;
+ if (num)
+ {
+ Toggle("CONFIGURAÇÕES SALVAS.");
+ }
+ }
+
+ private void SnackbarMessage_ActionClick(object sender, RoutedEventArgs e)
+ {
+ SnackbarArquivoDigital.IsActive = false;
+ }
+
+ public void Toggle(string message, bool active = true)
+ {
+ ((ContentControl)SnackbarArquivoDigital.Message).Content = message;
+ SnackbarArquivoDigital.IsActive = active;
+ if (active)
+ {
+ Task.Factory.StartNew(CloseSlackBar);
+ }
+ }
+
+ private void CloseSlackBar()
+ {
+ Thread.Sleep(5000);
+ Dispatcher dispatcher = ((DispatcherObject)App.ProgressRing).Dispatcher;
+ if (dispatcher != null)
+ {
+ dispatcher.BeginInvoke((DispatcherPriority)4, (Delegate)(Action)delegate
+ {
+ Toggle("", active: false);
+ });
+ }
+ }
+
+ private void AdicionarParametro_OnClick(object sender, RoutedEventArgs e)
+ {
+ //IL_0028: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0032: Expected O, but got Unknown
+ RelatorioViewModel viewModel = ViewModel;
+ ComboBox campoComboBox = CampoComboBox;
+ viewModel.AdicionarParametro((ParametrosRelatorio)((campoComboBox != null) ? ((ItemsControl)campoComboBox).Items[((Selector)CampoComboBox).SelectedIndex] : null));
+ }
+
+ private void ExcluirParametro_OnClick(object sender, RoutedEventArgs e)
+ {
+ //IL_0040: Unknown result type (might be due to invalid IL or missing references)
+ //IL_004a: Expected O, but got Unknown
+ DataGrid parametrosGrid = ParametrosGrid;
+ if (parametrosGrid == null || ((Selector)parametrosGrid).SelectedIndex >= 0)
+ {
+ RelatorioViewModel viewModel = ViewModel;
+ DataGrid parametrosGrid2 = ParametrosGrid;
+ viewModel.ExcluirParametro((ParametrosRelatorio)((parametrosGrid2 != null) ? ((ItemsControl)parametrosGrid2).Items[((Selector)ParametrosGrid).SelectedIndex] : null));
+ }
+ }
+
+ private void SubirParametro_OnClick(object sender, RoutedEventArgs e)
+ {
+ //IL_0040: Unknown result type (might be due to invalid IL or missing references)
+ //IL_004a: Expected O, but got Unknown
+ DataGrid parametrosGrid = ParametrosGrid;
+ if (parametrosGrid == null || ((Selector)parametrosGrid).SelectedIndex >= 0)
+ {
+ RelatorioViewModel viewModel = ViewModel;
+ DataGrid parametrosGrid2 = ParametrosGrid;
+ viewModel.SubirParametro((ParametrosRelatorio)((parametrosGrid2 != null) ? ((ItemsControl)parametrosGrid2).Items[((Selector)ParametrosGrid).SelectedIndex] : null));
+ }
+ }
+
+ private void DescerParametro_OnClick(object sender, RoutedEventArgs e)
+ {
+ //IL_0040: Unknown result type (might be due to invalid IL or missing references)
+ //IL_004a: Expected O, but got Unknown
+ DataGrid parametrosGrid = ParametrosGrid;
+ if (parametrosGrid == null || ((Selector)parametrosGrid).SelectedIndex >= 0)
+ {
+ RelatorioViewModel viewModel = ViewModel;
+ DataGrid parametrosGrid2 = ParametrosGrid;
+ viewModel.DescerParametro((ParametrosRelatorio)((parametrosGrid2 != null) ? ((ItemsControl)parametrosGrid2).Items[((Selector)ParametrosGrid).SelectedIndex] : null));
+ }
+ }
+
+ private void AdicionarTotalizacao_OnClick(object sender, RoutedEventArgs e)
+ {
+ //IL_0028: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0032: Expected O, but got Unknown
+ RelatorioViewModel viewModel = ViewModel;
+ ComboBox totalizacaoComboBox = TotalizacaoComboBox;
+ viewModel.AdicionarTotalizacao((ParametrosTotalizacao)((totalizacaoComboBox != null) ? ((ItemsControl)totalizacaoComboBox).Items[((Selector)TotalizacaoComboBox).SelectedIndex] : null));
+ }
+
+ private void ExcluirTotalizacao_OnClick(object sender, RoutedEventArgs e)
+ {
+ //IL_0040: Unknown result type (might be due to invalid IL or missing references)
+ //IL_004a: Expected O, but got Unknown
+ DataGrid totalizacaoGrid = TotalizacaoGrid;
+ if (totalizacaoGrid == null || ((Selector)totalizacaoGrid).SelectedIndex >= 0)
+ {
+ RelatorioViewModel viewModel = ViewModel;
+ DataGrid totalizacaoGrid2 = TotalizacaoGrid;
+ viewModel.ExcluirTotalizacao((ParametrosTotalizacao)((totalizacaoGrid2 != null) ? ((ItemsControl)totalizacaoGrid2).Items[((Selector)TotalizacaoGrid).SelectedIndex] : null));
+ }
+ }
+
+ [DebuggerNonUserCode]
+ [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
+ public void InitializeComponent()
+ {
+ if (!_contentLoaded)
+ {
+ _contentLoaded = true;
+ Uri uri = new Uri("/Gestor.Application;component/drawers/relatorios/configuracaorelatorio.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_0052: Unknown result type (might be due to invalid IL or missing references)
+ //IL_005e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0068: Expected O, but got Unknown
+ //IL_006b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0075: Expected O, but got Unknown
+ //IL_0078: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0082: Expected O, but got Unknown
+ //IL_0085: Unknown result type (might be due to invalid IL or missing references)
+ //IL_008f: Expected O, but got Unknown
+ //IL_0092: Unknown result type (might be due to invalid IL or missing references)
+ //IL_009c: Expected O, but got Unknown
+ //IL_009e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00aa: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00b4: Expected O, but got Unknown
+ //IL_00b7: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00c1: Expected O, but got Unknown
+ //IL_00c3: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00cf: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00d9: Expected O, but got Unknown
+ //IL_00dc: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00e6: Expected O, but got Unknown
+ //IL_00e9: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00f3: Expected O, but got Unknown
+ //IL_00f5: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0101: Unknown result type (might be due to invalid IL or missing references)
+ //IL_010b: Expected O, but got Unknown
+ //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
+ switch (connectionId)
+ {
+ case 1:
+ ((ButtonBase)(Button)target).Click += new RoutedEventHandler(Fechar_OnClick);
+ break;
+ case 2:
+ ProgressBar = (ProgressBar)target;
+ break;
+ case 3:
+ CampoButton = (RadioButton)target;
+ break;
+ case 4:
+ TotalizacaoButton = (RadioButton)target;
+ break;
+ case 5:
+ CampoComboBox = (ComboBox)target;
+ break;
+ case 6:
+ ((MenuItem)target).Click += new RoutedEventHandler(AdicionarParametro_OnClick);
+ break;
+ case 7:
+ TotalizacaoComboBox = (ComboBox)target;
+ break;
+ case 8:
+ ((MenuItem)target).Click += new RoutedEventHandler(AdicionarTotalizacao_OnClick);
+ break;
+ case 9:
+ ParametrosGrid = (DataGrid)target;
+ break;
+ case 13:
+ TotalizacaoGrid = (DataGrid)target;
+ break;
+ case 15:
+ ((MenuItem)target).Click += new RoutedEventHandler(Salvar_OnClick);
+ break;
+ case 16:
+ SnackbarArquivoDigital = (Snackbar)target;
+ break;
+ case 17:
+ ((SnackbarMessage)target).ActionClick += new RoutedEventHandler(SnackbarMessage_ActionClick);
+ break;
+ default:
+ _contentLoaded = true;
+ break;
+ }
+ }
+
+ [DebuggerNonUserCode]
+ [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ void IStyleConnector.Connect(int connectionId, object target)
+ {
+ //IL_001f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_002b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0035: Expected O, but got Unknown
+ //IL_0037: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0043: Unknown result type (might be due to invalid IL or missing references)
+ //IL_004d: Expected O, but got Unknown
+ //IL_004f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_005b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0065: Expected O, but got Unknown
+ //IL_0067: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0073: Unknown result type (might be due to invalid IL or missing references)
+ //IL_007d: Expected O, but got Unknown
+ switch (connectionId)
+ {
+ case 10:
+ ((ButtonBase)(Button)target).Click += new RoutedEventHandler(SubirParametro_OnClick);
+ break;
+ case 11:
+ ((ButtonBase)(Button)target).Click += new RoutedEventHandler(DescerParametro_OnClick);
+ break;
+ case 12:
+ ((ButtonBase)(Button)target).Click += new RoutedEventHandler(ExcluirParametro_OnClick);
+ break;
+ case 14:
+ ((ButtonBase)(Button)target).Click += new RoutedEventHandler(ExcluirTotalizacao_OnClick);
+ break;
+ case 13:
+ break;
+ }
+ }
+}
diff --git a/Decompiler/Gestor.Application.Drawers.Relatorios/FiltroRelatorio.cs b/Decompiler/Gestor.Application.Drawers.Relatorios/FiltroRelatorio.cs
new file mode 100644
index 0000000..72c0994
--- /dev/null
+++ b/Decompiler/Gestor.Application.Drawers.Relatorios/FiltroRelatorio.cs
@@ -0,0 +1,155 @@
+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.Markup;
+using Gestor.Application.ViewModels.Relatorios;
+using Gestor.Model.Common;
+using MaterialDesignThemes.Wpf;
+
+namespace Gestor.Application.Drawers.Relatorios;
+
+public class FiltroRelatorio : UserControl, IComponentConnector
+{
+ private RelatorioViewModel ViewModel;
+
+ internal MaterialDataGridTextColumn IdField;
+
+ internal MaterialDataGridTextColumn NomeField;
+
+ internal MaterialDataGridTextColumn ApelidoField;
+
+ internal DataGrid RamosGrid;
+
+ internal DataGrid VendedorGrid;
+
+ internal DataGrid TipoSeguroGrid;
+
+ internal DataGrid TipoVendedorGrid;
+
+ internal DataGrid NegocioGrid;
+
+ internal DataGrid ProdutoGrid;
+
+ internal DataGrid EstipulanteGrid;
+
+ private bool _contentLoaded;
+
+ public FiltroRelatorio(RelatorioViewModel viewModel, Relatorio relatorio)
+ {
+ //IL_00d0: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00d3: Invalid comparison between Unknown and I4
+ ViewModel = viewModel;
+ ((FrameworkElement)this).DataContext = ViewModel;
+ InitializeComponent();
+ viewModel.ReloadVendedores();
+ ((UIElement)VendedorGrid).Visibility = (Visibility)((viewModel.Vendedores.Count <= 0) ? 2 : 0);
+ ((UIElement)EstipulanteGrid).Visibility = (Visibility)((viewModel.Estipulantes.Count <= 0) ? 2 : 0);
+ ((UIElement)ProdutoGrid).Visibility = (Visibility)((viewModel.Produtos.Count <= 0) ? 2 : 0);
+ ((DataGridColumn)IdField).Visibility = (Visibility)(ViewModel.Apelido ? 2 : 0);
+ ((DataGridColumn)NomeField).Visibility = (Visibility)(ViewModel.Apelido ? 2 : 0);
+ ((DataGridColumn)ApelidoField).Visibility = (Visibility)((!ViewModel.Apelido) ? 2 : 0);
+ if ((int)relatorio == 19)
+ {
+ ((UIElement)RamosGrid).Visibility = (Visibility)2;
+ ((UIElement)TipoSeguroGrid).Visibility = (Visibility)2;
+ ((UIElement)VendedorGrid).Visibility = (Visibility)2;
+ ((UIElement)EstipulanteGrid).Visibility = (Visibility)2;
+ ((UIElement)ProdutoGrid).Visibility = (Visibility)2;
+ ((UIElement)TipoVendedorGrid).Visibility = (Visibility)2;
+ ((UIElement)NegocioGrid).Visibility = (Visibility)2;
+ }
+ ViewModel.EnableMenu = true;
+ }
+
+ private void Fechar_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.Filtro = "";
+ ViewModel.AdicionarFiltros();
+ ViewModel.CloseDrawer();
+ }
+
+ [DebuggerNonUserCode]
+ [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
+ public void InitializeComponent()
+ {
+ if (!_contentLoaded)
+ {
+ _contentLoaded = true;
+ Uri uri = new Uri("/Gestor.Application;component/drawers/relatorios/filtrorelatorio.xaml", UriKind.Relative);
+ Application.LoadComponent((object)this, uri);
+ }
+ }
+
+ [DebuggerNonUserCode]
+ [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ void IComponentConnector.Connect(int connectionId, object target)
+ {
+ //IL_003a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0046: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0050: Expected O, but got Unknown
+ //IL_0053: Unknown result type (might be due to invalid IL or missing references)
+ //IL_005d: Expected O, but got Unknown
+ //IL_0060: Unknown result type (might be due to invalid IL or missing references)
+ //IL_006a: Expected O, but got Unknown
+ //IL_006d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0077: Expected O, but got Unknown
+ //IL_007a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0084: Expected O, but got Unknown
+ //IL_0087: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0091: Expected O, but got Unknown
+ //IL_0094: Unknown result type (might be due to invalid IL or missing references)
+ //IL_009e: Expected O, but got Unknown
+ //IL_00a1: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00ab: 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_00bb: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00c5: Expected O, but got Unknown
+ //IL_00c8: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00d2: Expected O, but got Unknown
+ switch (connectionId)
+ {
+ case 1:
+ ((ButtonBase)(Button)target).Click += new RoutedEventHandler(Fechar_OnClick);
+ break;
+ case 2:
+ IdField = (MaterialDataGridTextColumn)target;
+ break;
+ case 3:
+ NomeField = (MaterialDataGridTextColumn)target;
+ break;
+ case 4:
+ ApelidoField = (MaterialDataGridTextColumn)target;
+ break;
+ case 5:
+ RamosGrid = (DataGrid)target;
+ break;
+ case 6:
+ VendedorGrid = (DataGrid)target;
+ break;
+ case 7:
+ TipoSeguroGrid = (DataGrid)target;
+ break;
+ case 8:
+ TipoVendedorGrid = (DataGrid)target;
+ break;
+ case 9:
+ NegocioGrid = (DataGrid)target;
+ break;
+ case 10:
+ ProdutoGrid = (DataGrid)target;
+ break;
+ case 11:
+ EstipulanteGrid = (DataGrid)target;
+ break;
+ default:
+ _contentLoaded = true;
+ break;
+ }
+ }
+}