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
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
|
using Gestor.Application.Helpers;
using Gestor.Application.ViewModels.Generic;
using Gestor.Common.Validation;
using Gestor.Model.Common;
using Gestor.Model.Domain.Common;
using Gestor.Model.Domain.Generic;
using Gestor.Model.Domain.Relatorios;
using Gestor.Model.Domain.Seguros;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
namespace Gestor.Application.ViewModels.Drawer
{
public class LogAcaoViewModel : BaseViewModel
{
private RegistroAcao _log;
private string _obs;
public RegistroAcao Log
{
get
{
return this._log;
}
set
{
this._log = value;
base.OnPropertyChanged("Log");
}
}
public string Obs
{
get
{
return this._obs;
}
set
{
this._obs = value;
base.OnPropertyChanged("Obs");
}
}
private Gestor.Model.Common.Relatorio Relatorio
{
get;
set;
}
public LogAcaoViewModel(RegistroAcao registro, Gestor.Model.Common.Relatorio relatorio)
{
this.Relatorio = relatorio;
this.CarregarLog(registro);
}
private void CarregarLog(RegistroAcao registro)
{
string str;
string str1;
string str2;
string str3;
string str4;
string str5;
string str6;
string str7;
string str8;
string str9;
string str10;
if (registro.get_Tela().HasValue || string.IsNullOrEmpty(registro.get_Observacao()) || this.Relatorio == 25)
{
this.Log = registro;
this.Obs = registro.get_Observacao();
return;
}
this.Log = registro;
Filtros filtro = JsonConvert.DeserializeObject<Filtros>(registro.get_Observacao());
if (filtro.get_Seguradoras() == null || filtro.get_Seguradoras().Count == 0)
{
str = "";
}
else
{
string[] newLine = new string[] { "SEGURADORAS FILTRADAS: ", Environment.NewLine, null, null, null };
newLine[2] = string.Join(Environment.NewLine,
from x in Recursos.Seguradoras
where filtro.get_Seguradoras().Contains(x.get_Id())
select x.get_NomeSocial());
newLine[3] = Environment.NewLine;
newLine[4] = Environment.NewLine;
str = string.Concat(newLine);
}
string str11 = str;
if (filtro.get_Status() == null || filtro.get_Status().Count == 0)
{
str1 = "";
}
else
{
string[] strArrays = new string[] { "STATUS FILTRADOS: ", Environment.NewLine, null, null, null };
strArrays[2] = string.Join<TipoSeguro>(Environment.NewLine,
from x in filtro.get_Status()
select (int)x);
strArrays[3] = Environment.NewLine;
strArrays[4] = Environment.NewLine;
str1 = string.Concat(strArrays);
}
string str12 = str1;
if (filtro.get_Ramos() == null || filtro.get_Ramos().Count == 0)
{
str2 = "";
}
else
{
string[] newLine1 = new string[] { "RAMOS FILTRADOS: ", Environment.NewLine, null, null, null };
newLine1[2] = string.Join(Environment.NewLine,
from x in Recursos.Ramos
where filtro.get_Ramos().Contains(x.get_Id())
select x.get_Nome());
newLine1[3] = Environment.NewLine;
newLine1[4] = Environment.NewLine;
str2 = string.Concat(newLine1);
}
string str13 = str2;
if (filtro.get_Vendedores() == null || filtro.get_Vendedores().Count == 0)
{
str3 = "";
}
else
{
string[] strArrays1 = new string[] { "VENDEDORES FILTRADOS: ", Environment.NewLine, null, null, null };
strArrays1[2] = string.Join(Environment.NewLine,
from x in Recursos.Vendedores
where filtro.get_Vendedores().Contains(x.get_Id())
select x.get_Nome());
strArrays1[3] = Environment.NewLine;
strArrays1[4] = Environment.NewLine;
str3 = string.Concat(strArrays1);
}
string str14 = str3;
if (filtro.get_Estipulantes() == null || filtro.get_Estipulantes().Count == 0)
{
str4 = "";
}
else
{
string[] newLine2 = new string[] { "ESTIPULANTES FILTRADOS: ", Environment.NewLine, null, null, null };
newLine2[2] = string.Join(Environment.NewLine,
from x in Recursos.Estipulantes
where filtro.get_Estipulantes().Contains(x.get_Id())
select x.get_Nome());
newLine2[3] = Environment.NewLine;
newLine2[4] = Environment.NewLine;
str4 = string.Concat(newLine2);
}
string str15 = str4;
if (filtro.get_Produtos() == null || filtro.get_Produtos().Count == 0)
{
str5 = "";
}
else
{
string[] strArrays2 = new string[] { "PRODUTOS FILTRADOS: ", Environment.NewLine, null, null, null };
strArrays2[2] = string.Join(Environment.NewLine,
from x in Recursos.Produtos
where filtro.get_Produtos().Contains(x.get_Id())
select x.get_Nome());
strArrays2[3] = Environment.NewLine;
strArrays2[4] = Environment.NewLine;
str5 = string.Concat(strArrays2);
}
string str16 = str5;
if (filtro.get_Negocio() == null || filtro.get_Negocio().Count == 0)
{
str6 = "";
}
else
{
string[] newLine3 = new string[] { "TIPOS DE NEGÓCIOS FILTRADOS: ", Environment.NewLine, null, null, null };
newLine3[2] = string.Join<NegocioCorretora>(Environment.NewLine,
from x in filtro.get_Negocio()
select (int)x);
newLine3[3] = Environment.NewLine;
newLine3[4] = Environment.NewLine;
str6 = string.Concat(newLine3);
}
string str17 = str6;
if (filtro.get_Usuarios() == null || filtro.get_Usuarios().Count == 0)
{
str7 = "";
}
else
{
string[] strArrays3 = new string[] { "USUÁRIOS FILTRADOS: ", Environment.NewLine, null, null, null };
strArrays3[2] = string.Join(Environment.NewLine,
from x in Recursos.Usuarios
where filtro.get_Usuarios().Contains(x.get_Id())
select x.get_Nome());
strArrays3[3] = Environment.NewLine;
strArrays3[4] = Environment.NewLine;
str7 = string.Concat(strArrays3);
}
string str18 = str7;
if (filtro.get_Telas() == null || filtro.get_Telas().Count == 0)
{
str8 = "";
}
else
{
string[] newLine4 = new string[] { "TELAS FILTRADAS: ", Environment.NewLine, null, null, null };
newLine4[2] = string.Join<TipoTela>(Environment.NewLine,
from x in filtro.get_Telas()
select (int)x);
newLine4[3] = Environment.NewLine;
newLine4[4] = Environment.NewLine;
str8 = string.Concat(newLine4);
}
string str19 = str8;
if (filtro.get_Relatorios() == null || filtro.get_Relatorios().Count == 0)
{
str9 = "";
}
else
{
string[] strArrays4 = new string[] { "RELATÓRIOS FILTRADOS: ", Environment.NewLine, null, null, null };
strArrays4[2] = string.Join<Gestor.Model.Common.Relatorio>(Environment.NewLine,
from x in filtro.get_Relatorios()
select (int)x);
strArrays4[3] = Environment.NewLine;
strArrays4[4] = Environment.NewLine;
str9 = string.Concat(strArrays4);
}
string str20 = str9;
if (filtro.get_ParcelasEspeciais() != null)
{
if (!filtro.get_ParcelasEspeciais().Any<FiltroTipoParcela>((FiltroTipoParcela x) => x.get_Selecionado()))
{
goto Label1;
}
string[] newLine5 = new string[] { "TIPOS DE PARCELAS FILTRADOS: ", Environment.NewLine, null, null, null };
newLine5[2] = string.Join<SubTipo>(Environment.NewLine,
from x in filtro.get_ParcelasEspeciais()
select x.get_Tipo());
newLine5[3] = Environment.NewLine;
newLine5[4] = Environment.NewLine;
str10 = string.Concat(newLine5);
goto Label0;
}
Label1:
str10 = "";
Label0:
string str21 = str10;
string str22 = (filtro.get_IdEmpresa() == 0 ? "" : string.Concat(new string[] { "EMPRESA: ", Environment.NewLine, Recursos.Empresas.Find((Empresa x) => x.get_Id() == filtro.get_IdEmpresa()).get_Nome(), Environment.NewLine, Environment.NewLine }));
string.Format("PERÍODO DE {0:d} ATÉ {1:d}", filtro.get_Inicio(), filtro.get_Fim());
this.Obs = string.Concat(new string[] { ValidationHelper.GetDescription(registro.get_Relatorio()), Environment.NewLine, Environment.NewLine, str22, str11, str13, str16, str14, str15, str12, str17, str21, str18, str19, str20 });
}
}
}
|