summaryrefslogtreecommitdiff
path: root/Decompiler/Gestor.Application.Drawers/ExtratosDrawer.cs
blob: 1dd3f48d4a0f94df45564928c5f645b6e5b2b075 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
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;
		}
	}
}