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
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
|
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Globalization;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using Agger.Registro;
using Gestor.Application.Componentes;
using Gestor.Application.Helpers;
using Gestor.Application.Servicos;
using Gestor.Application.Servicos.Generic;
using Gestor.Application.Servicos.Seguros;
using Gestor.Application.Servicos.Seguros.Itens;
using Gestor.Application.ViewModels.Seguros.Itens;
using Gestor.Application.Views.Seguros.Itens;
using Gestor.Model.Common;
using Gestor.Model.Domain.Card;
using Gestor.Model.Domain.Common;
using Gestor.Model.Domain.Ferramentas;
using Gestor.Model.Domain.Generic;
using Gestor.Model.Domain.MalaDireta;
using Gestor.Model.Domain.Seguros;
using Gestor.Model.Helper;
using MaterialDesignThemes.Wpf;
using Xceed.Wpf.AvalonDock.Controls;
namespace Gestor.Application.ViewModels.Generic;
public class BaseSegurosViewModel : BaseViewModel
{
private string _anotacoes;
private bool _enableEndossar;
private bool _enableRenovar;
public AutoCompleteFilterPredicate<object> ClienteItemFilter => (string searchText, object obj) => CultureInfo.InvariantCulture.CompareInfo.IndexOf(((Cliente)obj).Nome.ToUpper(), searchText.Trim(), CompareOptions.IgnoreNonSpace) > -1 || (((Cliente)obj).Documento != null && ((Cliente)obj).Documento.Contains(searchText.Trim())) || (((Cliente)obj).Rne != null && ((Cliente)obj).Rne.Contains(searchText.Trim())) || (((Cliente)obj).Cei != null && ((Cliente)obj).Cei.Contains(searchText.Trim())) || (((Cliente)obj).NomeSocialRg != null && ((Cliente)obj).NomeSocialRg.ToUpper().Contains(searchText.Trim().ToUpper())) || (((Cliente)obj).Telefones != null && ((Cliente)obj).Telefones.Count > 0 && ((Cliente)obj).Telefones.Any((ClienteTelefone x) => ((TelefoneBase)x).Numero.Contains(searchText.Trim())));
public string Anotacoes
{
get
{
return _anotacoes;
}
set
{
_anotacoes = value;
OnPropertyChanged("Anotacoes");
}
}
public AutoCompleteFilterPredicate<object> AgendaItemFilter => (string searchText, object obj) => ((Agenda)obj).Nome.ToUpper().Contains(searchText.ToUpper());
public AutoCompleteFilterPredicate<object> VendedorItemFilter => (string searchText, object obj) => ((Vendedor)obj).Nome.ToUpper().Contains(searchText.ToUpper()) || (((Vendedor)obj).Documento != null && ((Vendedor)obj).Documento.ToUpper().Contains(searchText.ToUpper()));
public AutoCompleteFilterPredicate<object> ProfissaoItemFilter => (string searchText, object obj) => ((Profissao)obj).Nome.ToUpper().Contains(searchText.ToUpper()) || ((Profissao)obj).Codigo.ToUpper().Contains(searchText.ToUpper());
public AutoCompleteFilterPredicate<object> EstipulanteItemFilter => (string searchText, object obj) => ((Estipulante)obj).Nome.ToUpper().Contains(searchText.ToUpper()) || ((Estipulante)obj).Documento.ToString().Contains(searchText.ToUpper());
public AutoCompleteFilterPredicate<object> ProdutoItemFilter => (string searchText, object obj) => ((Produto)obj).Nome.ToUpper().Contains(searchText.ToUpper());
public AutoCompleteFilterPredicate<object> TipoTarefaItemFilter => (string searchText, object obj) => ((TipoDeTarefa)obj).Nome.ToUpper().Contains(searchText.ToUpper());
public AutoCompleteFilterPredicate<object> StatusProspeccaoItemFilter => (string searchText, object obj) => ((StatusDeProspeccao)obj).Nome.ToUpper().Contains(searchText.ToUpper());
public AutoCompleteFilterPredicate<object> NotaFiscalItemFilter => (string searchText, object obj) => ((NotaFiscal)obj).Seguradora.Nome.ToUpper().Contains(searchText.ToUpper());
public AutoCompleteFilterPredicate<object> StatusItemFilter => (string searchText, object obj) => ((Status)obj).Nome.ToUpper().Contains(searchText.ToUpper());
public AutoCompleteFilterPredicate<object> ReciboItemFilter => (string searchText, object obj) => ((Recibo)obj).Pagante.ToUpper().Contains(searchText.ToUpper()) || ((Recibo)obj).Recebedor.ToUpper().Contains(searchText.ToUpper());
public AutoCompleteFilterPredicate<object> EtiquetaItemFilter => (string searchText, object obj) => ((Documento)obj).Controle.Cliente.Nome.ToUpper().Contains(searchText.ToUpper());
public AutoCompleteFilterPredicate<object> EmpresaItemFilter => (string searchText, object obj) => ((Empresa)obj).Nome.ToUpper().Contains(searchText.ToUpper()) || ((Empresa)obj).Documento.ToString().Contains(searchText.ToUpper()) || ((Empresa)obj).Serial.ToString().Contains(searchText.ToUpper());
public AutoCompleteFilterPredicate<object> SocioItemFilter => (string searchText, object obj) => ((Socio)obj).Nome.ToUpper().Contains(searchText.ToUpper()) || ((Socio)obj).Email.ToString().Contains(searchText.ToUpper()) || ((Socio)obj).Telefone.ToString().Contains(searchText.ToUpper());
public AutoCompleteFilterPredicate<object> UsuarioItemFilter => (string searchText, object obj) => ((Usuario)obj).Nome.ToUpper().Contains(searchText.ToUpper()) || ((Usuario)obj).Documento.ToString().Contains(searchText.ToUpper());
public AutoCompleteFilterPredicate<object> NomeItemFilter => (string searchText, object obj) => ((Credencial)obj).Descricao.ToUpper().Contains(searchText.ToUpper());
public AutoCompleteFilterPredicate<object> BancoItemFilter => (string searchText, object obj) => ((Banco)obj).Nome.ToUpper().Contains(searchText.ToUpper()) || ((Banco)obj).Codigo.ToString().Contains(searchText.ToUpper());
public AutoCompleteFilterPredicate<object> AtividadeItemFilter => (string searchText, object obj) => ((Atividade)obj).Nome.ToUpper().Contains(searchText.ToUpper()) || ((Atividade)obj).Cnac.ToUpper().Contains(searchText.ToUpper());
public AutoCompleteFilterPredicate<object> FabricanteItemFilter => (string searchText, object obj) => ((Fabricante)obj).Descricao.ToUpper().Contains(searchText.ToUpper());
public AutoCompleteFilterPredicate<object> SeguradoraItemFilter => (string searchText, object obj) => ((Seguradora)obj).Nome.ToUpper().Contains(searchText.ToUpper()) || (((Seguradora)obj).Documento != null && ((Seguradora)obj).Documento.ToUpper().Contains(searchText.ToUpper())) || (((Seguradora)obj).Susep != null && ((Seguradora)obj).Susep.ToUpper().Contains(searchText.ToUpper()));
public AutoCompleteFilterPredicate<object> ConfigItemFilter => (string searchText, object obj) => ((ConfigExtratoImport)obj).Descricao.ToUpper().Contains(searchText.ToUpper());
public AutoCompleteFilterPredicate<object> ParceiroItemFilter => (string searchText, object obj) => ((Parceiro)obj).Nome.ToUpper().Contains(searchText.ToUpper());
public AutoCompleteFilterPredicate<object> TipoVendedorItemFilter => (string searchText, object obj) => ((TipoVendedor)obj).Descricao.ToUpper().Contains(searchText.ToUpper());
public AutoCompleteFilterPredicate<object> RamoItemFilter => (string searchText, object obj) => ((Ramo)obj).Nome.ToUpper().Contains(searchText.ToUpper());
public AutoCompleteFilterPredicate<object> ItemFilter => (string searchText, object obj) => ((Item)obj).Descricao.ToUpper().Contains(searchText.ToUpper());
public AutoCompleteFilterPredicate<object> SinitroItemFilter => (string searchText, object obj) => ((ControleSinistro)obj).DataSinistro.ToString().Contains(searchText) || (((ControleSinistro)obj).Sinistros != null && ((ControleSinistro)obj).Sinistros.Count > 0 && ((ControleSinistro)obj).Sinistros[0].Numero.ToUpper().Contains(searchText.ToUpper()));
public AutoCompleteFilterPredicate<object> CoberturaPadraoItemFilter => (string searchText, object obj) => ((CoberturaPadrao)obj).Descricao.ToUpper().Contains(searchText.ToUpper());
public bool EnableEndossar
{
get
{
return _enableEndossar;
}
set
{
_enableEndossar = value;
OnPropertyChanged("EnableEndossar");
}
}
public bool EnableRenovar
{
get
{
return _enableRenovar;
}
set
{
_enableRenovar = value;
OnPropertyChanged("EnableRenovar");
}
}
public List<Cliente> FilterCliente(List<Cliente> clientes, string searchText)
{
return clientes.Where((Cliente x) => x.Nome.ToUpper().Contains(searchText.ToUpper()) || (x.Documento != null && x.Documento.Contains(searchText)) || (x.Rne != null && x.Rne.Contains(searchText)) || (x.Cei != null && x.Cei.Contains(searchText))).ToList();
}
internal async Task<List<Cliente>> BuscarClienteEmpresa(string value)
{
return await Task.Run(() => new BaseServico().BuscarClienteEmpresa(value));
}
internal async Task<List<Cliente>> BuscarCliente(string value, List<long> vinculos = null, TipoFiltroCliente tipoFiltroCliente = 2)
{
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
return await new ClienteServico().BuscarCliente(value, vinculos, tipoFiltroCliente);
}
internal async Task<List<Cliente>> BuscarClienteVinculo(string value, long id)
{
return await Task.Run(() => new ClienteServico().BuscarClienteVinculo(value, id));
}
internal async Task<List<Profissao>> BuscarProfissao(string value)
{
return await Task.Run(() => new BaseServico().BuscarProfissao(value));
}
internal async Task<List<Atividade>> BuscarAtividade(string value)
{
return await Task.Run(() => new BaseServico().BuscarAtividade(value));
}
internal async Task<List<Fabricante>> BuscaFabricante(string value)
{
return await Task.Run(() => new BaseServico().BuscarFabricante(value));
}
internal async Task<List<Usuario>> BuscarUsuario(string value)
{
return await Task.Run(() => new BaseServico().BuscarUsuario(value));
}
internal async Task ShowDetalheExtrato(List<DetalheExtrato> detalhes)
{
DialogHost host = GetHost();
if (host == null || !host.IsOpen)
{
DialogDetalheExtrato dialogControl = new DialogDetalheExtrato(detalhes);
await ExecuteRunExtendedDialogDetalheExtrato((UserControl)(object)dialogControl, (host != null) ? host.Identifier.ToString() : "RootDialog");
}
}
public async Task ExecuteRunExtendedDialogDetalheExtrato(UserControl dialogControl, string hostName)
{
Extentions.FindVisualChildren<WebEditor>((DependencyObject)(object)((IEnumerable)Application.Current.Windows).OfType<Window>().SingleOrDefault((Func<Window, bool>)((Window x) => x.IsActive))).ToList().ForEach(delegate(WebEditor x)
{
((UIElement)x).Visibility = (Visibility)2;
});
await DialogHost.Show((object)dialogControl, (object)hostName, new DialogOpenedEventHandler(base.ExtendedOpenedEventHandler), new DialogClosingEventHandler(base.ExtendedClosingEventHandler));
}
internal async Task<Fipe> ShowBuscaModeloDialog(string modelo, string ano)
{
DialogHost host = GetHost();
if (host != null && host.IsOpen)
{
return null;
}
BuscarModeloView dialogControl = new BuscarModeloView(new BuscarModeloViewModel(modelo, ano));
return await ExecuteRunExtendedDialogBuscaModelo((UserControl)(object)dialogControl, (host != null) ? host.Identifier.ToString() : "RootDialog");
}
internal async Task ShowEditarParcelasDialog(Documento documento)
{
DialogHost host = GetHost();
if (host == null || !host.IsOpen)
{
DialogEditarParcelas dialogControl = new DialogEditarParcelas(documento);
await ExecuteRunExtendedDialogEditarParcelas((UserControl)(object)dialogControl, (host != null) ? host.Identifier.ToString() : "RootDialog");
}
}
public async Task ExecuteRunExtendedDialogEditarParcelas(UserControl dialogControl, string hostName)
{
Extentions.FindVisualChildren<WebEditor>((DependencyObject)(object)((IEnumerable)Application.Current.Windows).OfType<Window>().SingleOrDefault((Func<Window, bool>)((Window x) => x.IsActive))).ToList().ForEach(delegate(WebEditor x)
{
((UIElement)x).Visibility = (Visibility)2;
});
await DialogHost.Show((object)dialogControl, (object)hostName, new DialogOpenedEventHandler(base.ExtendedOpenedEventHandler), new DialogClosingEventHandler(base.ExtendedClosingEventHandler));
}
internal async Task<string> ShowObservacaoDialog()
{
DialogHost host = GetHost();
if (host != null && host.IsOpen)
{
return null;
}
DialogObservacao dialogControl = new DialogObservacao();
return await ExecuteRunExtendedDialogObservacao((UserControl)(object)dialogControl, (host != null) ? host.Identifier.ToString() : "RootDialog");
}
public async Task<string> ExecuteRunExtendedDialogObservacao(UserControl dialogControl, string hostName)
{
Extentions.FindVisualChildren<WebEditor>((DependencyObject)(object)((IEnumerable)Application.Current.Windows).OfType<Window>().SingleOrDefault((Func<Window, bool>)((Window x) => x.IsActive))).ToList().ForEach(delegate(WebEditor x)
{
((UIElement)x).Visibility = (Visibility)2;
});
object obj = await DialogHost.Show((object)dialogControl, (object)hostName, new DialogOpenedEventHandler(base.ExtendedOpenedEventHandler), new DialogClosingEventHandler(base.ExtendedClosingEventHandler));
if (obj is bool)
{
return null;
}
return (string)obj;
}
public async Task<Fipe> ExecuteRunExtendedDialogBuscaModelo(UserControl dialogControl, string hostName)
{
Extentions.FindVisualChildren<WebEditor>((DependencyObject)(object)((IEnumerable)Application.Current.Windows).OfType<Window>().SingleOrDefault((Func<Window, bool>)((Window x) => x.IsActive))).ToList().ForEach(delegate(WebEditor x)
{
((UIElement)x).Visibility = (Visibility)2;
});
object obj = await DialogHost.Show((object)dialogControl, (object)hostName, new DialogOpenedEventHandler(base.ExtendedOpenedEventHandler), new DialogClosingEventHandler(base.ExtendedClosingEventHandler));
if (obj is bool)
{
return null;
}
return (Fipe)obj;
}
internal async Task<VinculoRepasse> ShowVinculoDialog(VinculoRepasse vinculo, List<Repasse> repasses, Repasse repasse)
{
DialogHost host = GetHost();
if (host != null && host.IsOpen)
{
return null;
}
DialogVinculo dialogControl = new DialogVinculo(vinculo, repasses, repasse);
return await ExecuteRunExtendedDialogVinculo((UserControl)(object)dialogControl, (host != null) ? host.Identifier.ToString() : "RootDialog");
}
public async Task<VinculoRepasse> ExecuteRunExtendedDialogVinculo(UserControl dialogControl, string hostName)
{
Extentions.FindVisualChildren<WebEditor>((DependencyObject)(object)((IEnumerable)Application.Current.Windows).OfType<Window>().SingleOrDefault((Func<Window, bool>)((Window x) => x.IsActive))).ToList().ForEach(delegate(WebEditor x)
{
((UIElement)x).Visibility = (Visibility)2;
});
object obj = await DialogHost.Show((object)dialogControl, (object)hostName, new DialogOpenedEventHandler(base.ExtendedOpenedEventHandler), new DialogClosingEventHandler(base.ExtendedClosingEventHandler));
if (obj is bool)
{
return null;
}
return (VinculoRepasse)obj;
}
internal async Task<Tarefa> ShowTarefaDialog(Tarefa tarefa, bool nota = false, bool agendamento = false)
{
DialogHost host = GetHost();
if (host != null && host.IsOpen)
{
return null;
}
List<TelefoneBase> telefones = new List<TelefoneBase>();
if (tarefa != null && tarefa.IdCliente > 0)
{
telefones = (await new ClienteServico().BuscarTelefonesAsync(tarefa.IdCliente)).Where((ClienteTelefone x) => ValidationHelper.ValidacaoTelefone(((TelefoneBase)x).Numero)).Select((Func<ClienteTelefone, TelefoneBase>)((ClienteTelefone x) => new TelefoneBase
{
Tipo = ((TelefoneBase)x).Tipo,
Id = ((DomainBase)x).Id,
Numero = ((TelefoneBase)x).Numero,
Prefixo = ((TelefoneBase)x).Prefixo
})).ToList();
}
DialogTarefa dialogControl = new DialogTarefa(tarefa, telefones, nota, agendamento);
return await ExecuteRunExtendedDialogTarefa((UserControl)(object)dialogControl, (host != null) ? host.Identifier.ToString() : "RootDialog");
}
internal async Task<ObservableCollection<Item>> ShowSelecionarItensDialog(long id)
{
DialogHost host = GetHost();
if (host != null && host.IsOpen)
{
return null;
}
DialogSelecionarItens dialogControl = new DialogSelecionarItens(id);
return await ExecuteRunExtendedDialogSelecionarItens((UserControl)(object)dialogControl, (host != null) ? host.Identifier.ToString() : "RootDialog");
}
internal async Task<ObservableCollection<Item>> ShowReordenarItensDialog(List<long> ids)
{
DialogHost host = GetHost();
if (host != null && host.IsOpen)
{
return null;
}
DialogReordenarItens dialogControl = new DialogReordenarItens(ids);
return await ExecuteRunExtendedDialogReordenarItens((UserControl)(object)dialogControl, (host != null) ? host.Identifier.ToString() : "RootDialog");
}
internal async Task<List<Documento>> ShowProtocoloDialog(List<Documento> itens)
{
DialogHost host = GetHost();
if (host != null && host.IsOpen)
{
return null;
}
DialogProtocolo dialogControl = new DialogProtocolo(itens);
return await ExecuteRunExtendedDialogProtocolo((UserControl)(object)dialogControl, (host != null) ? host.Identifier.ToString() : "RootDialog");
}
public async Task<List<Documento>> ExecuteRunExtendedDialogProtocolo(UserControl dialogControl, string hostName)
{
Extentions.FindVisualChildren<WebEditor>((DependencyObject)(object)((IEnumerable)Application.Current.Windows).OfType<Window>().SingleOrDefault((Func<Window, bool>)((Window x) => x.IsActive))).ToList().ForEach(delegate(WebEditor x)
{
((UIElement)x).Visibility = (Visibility)2;
});
object obj = await DialogHost.Show((object)dialogControl, (object)hostName, new DialogOpenedEventHandler(base.ExtendedOpenedEventHandler), new DialogClosingEventHandler(base.ExtendedClosingEventHandler));
if (obj == null || obj is bool)
{
return null;
}
return ((ObservableCollection<Documento>)obj).ToList();
}
public async Task<ObservableCollection<Item>> ExecuteRunExtendedDialogReordenarItens(UserControl dialogControl, string hostName)
{
Extentions.FindVisualChildren<WebEditor>((DependencyObject)(object)((IEnumerable)Application.Current.Windows).OfType<Window>().SingleOrDefault((Func<Window, bool>)((Window x) => x.IsActive))).ToList().ForEach(delegate(WebEditor x)
{
((UIElement)x).Visibility = (Visibility)2;
});
object obj = await DialogHost.Show((object)dialogControl, (object)hostName, new DialogOpenedEventHandler(base.ExtendedOpenedEventHandler), new DialogClosingEventHandler(base.ExtendedClosingEventHandler));
if (obj == null || obj is bool)
{
return null;
}
return (ObservableCollection<Item>)obj;
}
public async Task<ObservableCollection<Item>> ExecuteRunExtendedDialogSelecionarItens(UserControl dialogControl, string hostName)
{
Extentions.FindVisualChildren<WebEditor>((DependencyObject)(object)((IEnumerable)Application.Current.Windows).OfType<Window>().SingleOrDefault((Func<Window, bool>)((Window x) => x.IsActive))).ToList().ForEach(delegate(WebEditor x)
{
((UIElement)x).Visibility = (Visibility)2;
});
object obj = await DialogHost.Show((object)dialogControl, (object)hostName, new DialogOpenedEventHandler(base.ExtendedOpenedEventHandler), new DialogClosingEventHandler(base.ExtendedClosingEventHandler));
if (obj is bool)
{
return null;
}
return (ObservableCollection<Item>)obj;
}
internal async Task<Tuple<List<PermissaoUsuario>, Usuario, List<RestricaoUsuario>, List<PermissaoArquivoDigital>, List<RestricaoUsuarioCamposRelatorios>>> ShowCopiarPermissaoDialog()
{
DialogHost host = GetHost();
if (host != null && host.IsOpen)
{
return null;
}
DialogCopiarPermissao dialogControl = new DialogCopiarPermissao(new DialogCopiarPermissaoViewModel());
return await ExecuteRunExtendedDialogCopiarPermiss((UserControl)(object)dialogControl, (host != null) ? host.Identifier.ToString() : "RootDialog");
}
internal async Task<List<Usuario>> ShowExportarPermissaoDialog(long idUsuario)
{
DialogHost host = GetHost();
if (host != null && host.IsOpen)
{
return null;
}
DialogExportarPermissao dialogControl = new DialogExportarPermissao(new DialogExportarPermissaoViewModel(idUsuario));
return await ExecuteRunExtendedDialogExportarPermiss((UserControl)(object)dialogControl, (host != null) ? host.Identifier.ToString() : "RootDialog");
}
internal async Task ShowLogAcessoDialog(TipoTela tela, Usuario usuario)
{
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
DialogHost host = GetHost();
if (host == null || !host.IsOpen)
{
DialogLogAcesso dialogControl = new DialogLogAcesso(tela, usuario);
await ExecuteRunExtendedDialogEnviarEmails((UserControl)(object)dialogControl, (host != null) ? host.Identifier.ToString() : "RootDialog");
}
}
public async Task ExecuteRunExtendedDialogLogAcesso(UserControl dialogControl, string hostName)
{
Extentions.FindVisualChildren<WebEditor>((DependencyObject)(object)((IEnumerable)Application.Current.Windows).OfType<Window>().SingleOrDefault((Func<Window, bool>)((Window x) => x.IsActive))).ToList().ForEach(delegate(WebEditor x)
{
((UIElement)x).Visibility = (Visibility)2;
});
await DialogHost.Show((object)dialogControl, (object)hostName, new DialogOpenedEventHandler(base.ExtendedOpenedEventHandler), new DialogClosingEventHandler(base.ExtendedClosingEventHandler));
}
internal async Task ShowEnviarEmailsDialog(List<MalaDireta> lista, bool assinatura, bool original, List<ArquivoDigital> arquivosAnexados, string assunto, string corpo, Credencial credencial, FiltroArquivoDigital filtro, bool salvarAd, bool confirmarLeitura)
{
DialogHost host = GetHost();
if (host == null || !host.IsOpen)
{
DialogEnviarEmails dialogControl = new DialogEnviarEmails(new DialogEnviarEmailsViewModel(lista, assinatura, original, arquivosAnexados, assunto, corpo, credencial, filtro, salvarAd, confirmarLeitura));
await ExecuteRunExtendedDialogEnviarEmails((UserControl)(object)dialogControl, (host != null) ? host.Identifier.ToString() : "RootDialog");
}
}
internal async Task<PesquisaAvancada> ShowPesquisaAvancadaDialog()
{
DialogHost host = GetHost();
if (host != null && host.IsOpen)
{
return null;
}
DialogPesquisaAvancadaViewModel dialogPesquisaAvancadaViewModel = new DialogPesquisaAvancadaViewModel();
DialogPesquisaAvancada dialogPesquisaAvancada = new DialogPesquisaAvancada(dialogPesquisaAvancadaViewModel);
((FrameworkElement)dialogPesquisaAvancada).DataContext = dialogPesquisaAvancadaViewModel;
DialogPesquisaAvancada dialogControl = dialogPesquisaAvancada;
return await ExecuteRunExtendedDialogPesquisaAvancada((UserControl)(object)dialogControl, (host != null) ? host.Identifier.ToString() : "RootDialog");
}
public async Task<Tarefa> ExecuteRunExtendedDialogTarefa(UserControl dialogControl, string hostName)
{
Extentions.FindVisualChildren<WebEditor>((DependencyObject)(object)((IEnumerable)Application.Current.Windows).OfType<Window>().SingleOrDefault((Func<Window, bool>)((Window x) => x.IsActive))).ToList().ForEach(delegate(WebEditor x)
{
((UIElement)x).Visibility = (Visibility)2;
});
object obj = await DialogHost.Show((object)dialogControl, (object)hostName, new DialogOpenedEventHandler(base.ExtendedOpenedEventHandler), new DialogClosingEventHandler(base.ExtendedClosingEventHandler));
if (obj is bool)
{
return null;
}
return (Tarefa)obj;
}
public async Task<Tuple<List<PermissaoUsuario>, Usuario, List<RestricaoUsuario>, List<PermissaoArquivoDigital>, List<RestricaoUsuarioCamposRelatorios>>> ExecuteRunExtendedDialogCopiarPermiss(UserControl dialogControl, string hostName)
{
Extentions.FindVisualChildren<WebEditor>((DependencyObject)(object)((IEnumerable)Application.Current.Windows).OfType<Window>().SingleOrDefault((Func<Window, bool>)((Window x) => x.IsActive))).ToList().ForEach(delegate(WebEditor x)
{
((UIElement)x).Visibility = (Visibility)2;
});
object obj = await DialogHost.Show((object)dialogControl, (object)hostName, new DialogOpenedEventHandler(base.ExtendedOpenedEventHandler), new DialogClosingEventHandler(base.ExtendedClosingEventHandler));
if (obj is bool)
{
return null;
}
return (Tuple<List<PermissaoUsuario>, Usuario, List<RestricaoUsuario>, List<PermissaoArquivoDigital>, List<RestricaoUsuarioCamposRelatorios>>)obj;
}
public async Task<List<Usuario>> ExecuteRunExtendedDialogExportarPermiss(UserControl dialogControl, string hostName)
{
Extentions.FindVisualChildren<WebEditor>((DependencyObject)(object)((IEnumerable)Application.Current.Windows).OfType<Window>().SingleOrDefault((Func<Window, bool>)((Window x) => x.IsActive))).ToList().ForEach(delegate(WebEditor x)
{
((UIElement)x).Visibility = (Visibility)2;
});
object obj = await DialogHost.Show((object)dialogControl, (object)hostName, new DialogOpenedEventHandler(base.ExtendedOpenedEventHandler), new DialogClosingEventHandler(base.ExtendedClosingEventHandler));
if (obj is bool)
{
return null;
}
return (List<Usuario>)obj;
}
public async Task ExecuteRunExtendedDialogEnviarEmails(UserControl dialogControl, string hostName)
{
Extentions.FindVisualChildren<WebEditor>((DependencyObject)(object)((IEnumerable)Application.Current.Windows).OfType<Window>().SingleOrDefault((Func<Window, bool>)((Window x) => x.IsActive))).ToList().ForEach(delegate(WebEditor x)
{
((UIElement)x).Visibility = (Visibility)2;
});
await DialogHost.Show((object)dialogControl, (object)hostName, new DialogOpenedEventHandler(base.ExtendedOpenedEventHandler), new DialogClosingEventHandler(base.ExtendedClosingEventHandler));
}
public async Task<PesquisaAvancada> ExecuteRunExtendedDialogPesquisaAvancada(UserControl dialogControl, string hostName)
{
Extentions.FindVisualChildren<WebEditor>((DependencyObject)(object)((IEnumerable)Application.Current.Windows).OfType<Window>().SingleOrDefault((Func<Window, bool>)((Window x) => x.IsActive))).ToList().ForEach(delegate(WebEditor x)
{
((UIElement)x).Visibility = (Visibility)2;
});
object obj = await DialogHost.Show((object)dialogControl, (object)hostName, new DialogOpenedEventHandler(base.ExtendedOpenedEventHandler), new DialogClosingEventHandler(base.ExtendedClosingEventHandler));
if (obj is bool)
{
return null;
}
return (PesquisaAvancada)obj;
}
public async Task<Documento> CarregaApolice(long id)
{
return await new ApoliceServico().BuscarApoliceAsync(id);
}
public async Task<Cliente> CarregaCliente(long id)
{
return await new ClienteServico().BuscarClienteAsync(id);
}
public async Task<Sinistro> CarregaSinistroApolice(long id)
{
return await new SinistroServico().BuscarSinistro(id);
}
public async Task<Documento> CarregaApoliceParcela(long id)
{
return await new ParcelaServico().BuscarApolice(id);
}
public async Task<Parcela> CarregaParcela(long id)
{
return await new ParcelaServico().BuscarParcela(id);
}
public async Task<Prospeccao> CarregarProspeccao(long id)
{
return await new ProspeccaoServico().BuscarProspeccao(id);
}
public async Task<List<Item>> CarregarItem(long id, StatusItem status = 2)
{
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
return (await new ItemServico().BuscarItens(id, status)).ToList();
}
public async Task<string> CreateLinkAssistencia(Documento documento, string item, bool retorno = true)
{
if (documento == null)
{
return "";
}
return $"{Address.Assistance}{((DomainBase)documento).Id.GeraAssistencia()}";
}
public async Task<string> CreateCardLogo(Empresa empresa, string id = null)
{
if (empresa == null)
{
return "";
}
Logo logo = new Logo
{
CustomId = ApplicationHelper.NumeroSerial,
Data = empresa.Logo,
Corretora = ((!string.IsNullOrEmpty(empresa.NomeSocial)) ? empresa.NomeSocial : empresa.Nome),
Whatsapp = empresa.Whatsapp,
WhatsappSinistro = empresa.WhatsappSinistro
};
string text = ((!string.IsNullOrWhiteSpace(id)) ? (await logo.Atualizarlogo(id)) : (await logo.Criarlogo()));
id = text;
return id;
}
public async Task<string> CreateSeguradora(Seguradora seguradora, string id = null)
{
if (seguradora == null)
{
return "";
}
int index = 1;
AssistenciaCia assistencia = new AssistenciaCia
{
Seguradora = seguradora.Nome,
IdSeguradora = ((DomainBase)seguradora).Id,
LinkAppAndroid = seguradora.LinkAppAndroid,
LinkAppIos = seguradora.LinkAppIos,
CustomId = ApplicationHelper.NumeroSerial
};
seguradora.Contatos.OrderBy((SeguradoraContato x) => ((object)((TelefoneBase)x).Tipo.GetValueOrDefault((TipoTelefone)7)).GetType()).ToList().ForEach(delegate(SeguradoraContato x)
{
//IL_0121: Unknown result type (might be due to invalid IL or missing references)
//IL_0208: Unknown result type (might be due to invalid IL or missing references)
//IL_02ef: Unknown result type (might be due to invalid IL or missing references)
//IL_003a: Unknown result type (might be due to invalid IL or missing references)
//IL_0160: Unknown result type (might be due to invalid IL or missing references)
//IL_0167: Invalid comparison between Unknown and I4
//IL_014e: Unknown result type (might be due to invalid IL or missing references)
//IL_0155: Invalid comparison between Unknown and I4
//IL_0247: Unknown result type (might be due to invalid IL or missing references)
//IL_024e: Invalid comparison between Unknown and I4
//IL_0235: Unknown result type (might be due to invalid IL or missing references)
//IL_023c: Invalid comparison between Unknown and I4
//IL_032e: Unknown result type (might be due to invalid IL or missing references)
//IL_0335: Invalid comparison between Unknown and I4
//IL_031c: Unknown result type (might be due to invalid IL or missing references)
//IL_0323: Invalid comparison between Unknown and I4
//IL_0079: Unknown result type (might be due to invalid IL or missing references)
//IL_0080: Invalid comparison between Unknown and I4
//IL_0067: Unknown result type (might be due to invalid IL or missing references)
//IL_006e: Invalid comparison between Unknown and I4
//IL_0172: Unknown result type (might be due to invalid IL or missing references)
//IL_0178: Invalid comparison between Unknown and I4
//IL_0259: Unknown result type (might be due to invalid IL or missing references)
//IL_025f: Invalid comparison between Unknown and I4
//IL_0340: Unknown result type (might be due to invalid IL or missing references)
//IL_0346: Invalid comparison between Unknown and I4
//IL_008b: Unknown result type (might be due to invalid IL or missing references)
//IL_0091: Invalid comparison between Unknown and I4
switch (index)
{
default:
assistencia.Assistencia1Tipo = ((!((TelefoneBase)x).Tipo.HasValue) ? 10 : ((int)((TelefoneBase)x).Tipo.Value));
assistencia.Assistencia1 = ((((TelefoneBase)x).Tipo.HasValue && (int)((TelefoneBase)x).Tipo.GetValueOrDefault() == 10) ? ("0800-" + ((TelefoneBase)x).Numero) : (((int)((TelefoneBase)x).Tipo.GetValueOrDefault() == 11) ? ("0300-" + ((TelefoneBase)x).Numero) : (((int)((TelefoneBase)x).Tipo.GetValueOrDefault() == 7 && string.IsNullOrEmpty(((TelefoneBase)x).Prefixo)) ? ((TelefoneBase)x).Numero : ("(" + ((TelefoneBase)x).Prefixo + ") " + ((TelefoneBase)x).Numero))));
assistencia.Assistencia1Obs = x.NomeContato;
break;
case 2:
assistencia.Assistencia2Tipo = ((!((TelefoneBase)x).Tipo.HasValue) ? 10 : ((int)((TelefoneBase)x).Tipo.Value));
assistencia.Assistencia2 = ((((TelefoneBase)x).Tipo.HasValue && (int)((TelefoneBase)x).Tipo.GetValueOrDefault() == 10) ? ("0800-" + ((TelefoneBase)x).Numero) : (((int)((TelefoneBase)x).Tipo.GetValueOrDefault() == 11) ? ("0300-" + ((TelefoneBase)x).Numero) : (((int)((TelefoneBase)x).Tipo.GetValueOrDefault() == 7 && string.IsNullOrEmpty(((TelefoneBase)x).Prefixo)) ? ((TelefoneBase)x).Numero : ("(" + ((TelefoneBase)x).Prefixo + ") " + ((TelefoneBase)x).Numero))));
assistencia.Assistencia2Obs = x.NomeContato;
break;
case 3:
assistencia.Assistencia3Tipo = ((!((TelefoneBase)x).Tipo.HasValue) ? 10 : ((int)((TelefoneBase)x).Tipo.Value));
assistencia.Assistencia3 = ((((TelefoneBase)x).Tipo.HasValue && (int)((TelefoneBase)x).Tipo.GetValueOrDefault() == 10) ? ("0800-" + ((TelefoneBase)x).Numero) : (((int)((TelefoneBase)x).Tipo.GetValueOrDefault() == 11) ? ("0300-" + ((TelefoneBase)x).Numero) : (((int)((TelefoneBase)x).Tipo.GetValueOrDefault() == 7 && string.IsNullOrEmpty(((TelefoneBase)x).Prefixo)) ? ((TelefoneBase)x).Numero : ("(" + ((TelefoneBase)x).Prefixo + ") " + ((TelefoneBase)x).Numero))));
assistencia.Assistencia3Obs = x.NomeContato;
break;
case 4:
assistencia.Assistencia4Tipo = ((!((TelefoneBase)x).Tipo.HasValue) ? 10 : ((int)((TelefoneBase)x).Tipo.Value));
assistencia.Assistencia4 = ((((TelefoneBase)x).Tipo.HasValue && (int)((TelefoneBase)x).Tipo.GetValueOrDefault() == 10) ? ("0800-" + ((TelefoneBase)x).Numero) : (((int)((TelefoneBase)x).Tipo.GetValueOrDefault() == 11) ? ("0300-" + ((TelefoneBase)x).Numero) : (((int)((TelefoneBase)x).Tipo.GetValueOrDefault() == 7 && string.IsNullOrEmpty(((TelefoneBase)x).Prefixo)) ? ((TelefoneBase)x).Numero : ("(" + ((TelefoneBase)x).Prefixo + ") " + ((TelefoneBase)x).Numero))));
assistencia.Assistencia4Obs = x.NomeContato;
break;
}
index++;
});
string text = ((!string.IsNullOrWhiteSpace(id)) ? (await assistencia.AtualizarSeguradora(id)) : (await assistencia.CriarSeguradora()));
id = text;
return id;
}
}
|