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
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
|
using Gestor.Application.Helpers;
using Gestor.Application.Servicos.Seguros.Itens;
using Gestor.Application.ViewModels.Generic;
using Gestor.Common.Validation;
using Gestor.Model.Domain.Generic;
using Gestor.Model.Domain.Seguros;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
namespace Gestor.Application.ViewModels
{
public class CoberturaViewModel : BaseSegurosViewModel
{
private readonly ItemServico _itemServico;
private Cobertura _selectedCobertura;
private List<CoberturaPadrao> _coberturasPadrao;
private ObservableCollection<Cobertura> _coberturas;
private readonly IComparer<Cobertura> _comparerCobertura;
public ObservableCollection<Cobertura> Coberturas
{
get
{
return this._coberturas;
}
set
{
this._coberturas = value;
base.OnPropertyChanged("Coberturas");
}
}
public List<CoberturaPadrao> CoberturasPadrao
{
get
{
return this._coberturasPadrao;
}
set
{
this._coberturasPadrao = value;
base.OnPropertyChanged("CoberturasPadrao");
}
}
public Gestor.Model.Domain.Seguros.Item Item
{
get;
set;
}
public Gestor.Model.Domain.Seguros.Ramo Ramo
{
get;
set;
}
public Cobertura SelectedCobertura
{
get
{
return this._selectedCobertura;
}
set
{
this._selectedCobertura = value;
base.OnPropertyChanged("SelectedCobertura");
}
}
public CoberturaViewModel(Gestor.Model.Domain.Seguros.Ramo ramo = null, Gestor.Model.Domain.Seguros.Item item = null)
{
//
// Current member / type: System.Void Gestor.Application.ViewModels.CoberturaViewModel::.ctor(Gestor.Model.Domain.Seguros.Ramo,Gestor.Model.Domain.Seguros.Item)
// File path: C:\AggerSeguros\Gestor.Application.exe
//
// Product version: 0.0.0.0
// Exception in: System.Void .ctor(Gestor.Model.Domain.Seguros.Ramo,Gestor.Model.Domain.Seguros.Item)
//
// Object reference not set to an instance of an object.
// at Telerik.JustDecompiler.Decompiler.TypeInference.TypeInferer.FindLowestCommonAncestor(ICollection`1 typeNodes) in D:\a\CodemerxDecompile\CodemerxDecompile\src\JustDecompileEngine\src\JustDecompiler.Shared\Decompiler\TypeInference\TypeInferer.cs:line 515
// at Telerik.JustDecompiler.Decompiler.TypeInference.TypeInferer.MergeWithLowestCommonAncestor() in D:\a\CodemerxDecompile\CodemerxDecompile\src\JustDecompileEngine\src\JustDecompiler.Shared\Decompiler\TypeInference\TypeInferer.cs:line 459
// at Telerik.JustDecompiler.Decompiler.TypeInference.TypeInferer.ProcessSingleConstraints() in D:\a\CodemerxDecompile\CodemerxDecompile\src\JustDecompileEngine\src\JustDecompiler.Shared\Decompiler\TypeInference\TypeInferer.cs:line 378
// at Telerik.JustDecompiler.Decompiler.TypeInference.TypeInferer.InferTypes() in D:\a\CodemerxDecompile\CodemerxDecompile\src\JustDecompileEngine\src\JustDecompiler.Shared\Decompiler\TypeInference\TypeInferer.cs:line 331
// at Telerik.JustDecompiler.Decompiler.ExpressionDecompilerStep.Process(DecompilationContext theContext, BlockStatement body) in D:\a\CodemerxDecompile\CodemerxDecompile\src\JustDecompileEngine\src\JustDecompiler.Shared\Decompiler\ExpressionDecompilerStep.cs:line 104
// at Telerik.JustDecompiler.Decompiler.DecompilationPipeline.RunInternal(MethodBody body, BlockStatement block, ILanguage language) in D:\a\CodemerxDecompile\CodemerxDecompile\src\JustDecompileEngine\src\JustDecompiler.Shared\Decompiler\DecompilationPipeline.cs:line 100
// at Telerik.JustDecompiler.Decompiler.DecompilationPipeline.Run(MethodBody body, ILanguage language) in D:\a\CodemerxDecompile\CodemerxDecompile\src\JustDecompileEngine\src\JustDecompiler.Shared\Decompiler\DecompilationPipeline.cs:line 72
// at Telerik.JustDecompiler.Decompiler.Extensions.Decompile(MethodBody body, ILanguage language, DecompilationContext& context, TypeSpecificContext typeContext) in D:\a\CodemerxDecompile\CodemerxDecompile\src\JustDecompileEngine\src\JustDecompiler.Shared\Decompiler\Extensions.cs:line 61
// at Telerik.JustDecompiler.Decompiler.WriterContextServices.BaseWriterContextService.DecompileMethod(ILanguage language, MethodDefinition method, TypeSpecificContext typeContext) in D:\a\CodemerxDecompile\CodemerxDecompile\src\JustDecompileEngine\src\JustDecompiler.Shared\Decompiler\WriterContextServices\BaseWriterContextService.cs:line 133
//
// mailto: JustDecompilePublicFeedback@telerik.com
}
public void AdicionaCobertura()
{
Cobertura cobertura = new Cobertura();
cobertura.set_Item(this.Item);
Cobertura cobertura1 = cobertura;
ValidationHelper.AddSorted<Cobertura>(this.Coberturas, cobertura1, this._comparerCobertura);
this.SelectedCobertura = cobertura1;
}
internal async Task<List<CoberturaPadrao>> BuscarCobertura(string value)
{
Func<CoberturaPadrao, bool> func2 = null;
List<CoberturaPadrao> coberturaPadraos = await Task.Run<List<CoberturaPadrao>>(() => {
List<CoberturaPadrao> coberturasPadrao = this.CoberturasPadrao;
if (coberturasPadrao == null)
{
return null;
}
Func<CoberturaPadrao, bool> u003cu003e9_1 = func2;
if (u003cu003e9_1 == null)
{
Func<CoberturaPadrao, bool> func = (CoberturaPadrao x) => ValidationHelper.RemoveDiacritics(x.get_Descricao().ToUpper().Trim()).Contains(value.ToUpper());
Func<CoberturaPadrao, bool> func1 = func;
func2 = func;
u003cu003e9_1 = func1;
}
return coberturasPadrao.Where<CoberturaPadrao>(u003cu003e9_1).ToList<CoberturaPadrao>();
});
return coberturaPadraos;
}
public async Task CancelarAlteracao()
{
if (this.Item != null)
{
this.Coberturas = await this._itemServico.BuscarCoberturasPorItemAsync(this.Item.get_Id());
}
}
public ObservableCollection<Cobertura> CarregaCoberturaPadrao()
{
List<Cobertura> list;
List<CoberturaPadrao> coberturasPadrao = this.CoberturasPadrao;
if (coberturasPadrao != null)
{
list = (
from x in coberturasPadrao
where x.get_Padrao()
select x).Select<CoberturaPadrao, Cobertura>((CoberturaPadrao x) => {
Cobertura cobertura = new Cobertura();
cobertura.set_CoberturaPadrao(x);
cobertura.set_Observacao(x.get_Descricao());
return cobertura;
}).ToList<Cobertura>();
}
else
{
list = null;
}
ObservableCollection<Cobertura> observableCollection = new ObservableCollection<Cobertura>(list);
ObservableCollection<Cobertura> observableCollection1 = observableCollection;
this.Coberturas = observableCollection;
return observableCollection1;
}
public void CarregaPadrao()
{
List<Cobertura> list;
List<CoberturaPadrao> coberturasPadrao = this.CoberturasPadrao;
if (coberturasPadrao != null)
{
list = (
from x in coberturasPadrao
where x.get_Padrao()
select x).Select<CoberturaPadrao, Cobertura>((CoberturaPadrao x) => {
Cobertura cobertura = new Cobertura();
cobertura.set_CoberturaPadrao(x);
cobertura.set_Observacao(x.get_Descricao());
return cobertura;
}).ToList<Cobertura>();
}
else
{
list = null;
}
List<Cobertura> coberturas = list;
if (coberturas == null)
{
return;
}
this.Coberturas = new ObservableCollection<Cobertura>(coberturas);
}
public async void ExcluirCobertura(Cobertura cobertura)
{
if (cobertura != null)
{
string[] newLine = new string[] { "DESEJA REALMENTE EXCLUIR A COBERTURA", Environment.NewLine, "\"", cobertura.get_Observacao(), "\"?" };
if (await base.ShowMessage(string.Concat(newLine), "SIM", "NÃO", false))
{
this.Coberturas.Remove(cobertura);
}
}
}
public async Task<IList<Cobertura>> LimpaCoberturas()
{
bool flag;
IList<Cobertura> list;
if (this.Coberturas == null)
{
flag = false;
}
else
{
ObservableCollection<Cobertura> coberturas = this.Coberturas;
flag = coberturas.Any<Cobertura>((Cobertura x) => {
if (!(x.get_Franquia() == decimal.Zero) || !(x.get_Lmi() == decimal.Zero))
{
return false;
}
return x.get_Premio() == decimal.Zero;
});
}
bool flag1 = flag;
if (flag1)
{
flag1 = await base.ShowMessage("DESEJA LIMPAR AS COBERTURAS SEM VALOR DE FRANQUIA, LMI E PRÊMIO?", "SIM", "NÃO", false);
}
if (flag1)
{
ObservableCollection<Cobertura> observableCollection = this.Coberturas;
if (observableCollection != null)
{
list = observableCollection.Where<Cobertura>((Cobertura x) => {
if (string.IsNullOrEmpty(x.get_Observacao()))
{
return false;
}
if (x.get_Franquia() != decimal.Zero || x.get_Lmi() != decimal.Zero)
{
return true;
}
return x.get_Premio() != decimal.Zero;
}).ToList<Cobertura>();
}
else
{
list = null;
}
}
else
{
ObservableCollection<Cobertura> coberturas1 = this.Coberturas;
if (coberturas1 != null)
{
list = coberturas1.ToList<Cobertura>();
}
else
{
list = null;
}
}
return list;
}
public async Task SelectionaCoberturas()
{
if (this.Ramo != null)
{
this.CoberturasPadrao = (
from x in Recursos.Coberturas
where x.get_IdRamo() == this.Ramo.get_Id()
select x).ToList<CoberturaPadrao>();
if (this.Item != null)
{
this.Coberturas = await this._itemServico.BuscarCoberturasPorItemAsync(this.Item.get_Id());
}
}
}
}
}
|