summaryrefslogtreecommitdiff
path: root/Codemerx/Gestor.Application/ViewModels/Generic/DialogPesquisaAvancadaViewModel.cs
blob: 284d82167b3cc83b6933d6cb3504a7e8d1c6c40a (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
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
using Gestor.Application.Helpers;
using Gestor.Application.Servicos;
using Gestor.Application.Servicos.Ferramentas;
using Gestor.Application.Servicos.Seguros;
using Gestor.Application.Servicos.Seguros.Itens;
using Gestor.Common.Validation;
using Gestor.Model.Common;
using Gestor.Model.Domain.Common;
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.Generic
{
	public class DialogPesquisaAvancadaViewModel : BaseSegurosViewModel
	{
		private ObservableCollection<PesquisaAvancada> _pesquisas = new ObservableCollection<PesquisaAvancada>();

		private PesquisaAvancada _resultado = new PesquisaAvancada();

		private string _pesquisa;

		private FiltroStatusDocumento _status;

		private TipoTela _tela;

		private TipoFiltroBusca _tipoFiltro;

		private bool _habilitarFiltroBuscar;

		private FiltroStatusDocumento _oldStatus;

		private bool _enableStatus = true;

		public bool TipoBusca;

		private TipoPesquisa _tipo { get; set; } = 14;

		public bool EnableStatus
		{
			get
			{
				return this._enableStatus;
			}
			set
			{
				this._enableStatus = value;
				base.OnPropertyChanged("EnableStatus");
			}
		}

		public bool HabilitarFiltroBuscar
		{
			get
			{
				return this._habilitarFiltroBuscar;
			}
			set
			{
				this._habilitarFiltroBuscar = value;
				base.OnPropertyChanged("HabilitarFiltroBuscar");
			}
		}

		public string Informacao
		{
			get
			{
				return "O LIMITE DA PESQUISA É EM MIL ITENS,\r\nPARA OBTER UMA EXATIDÃO NA PESQUISA É NECESSÁRIO ESPECIFICAR O ITEM PROCURADO.";
			}
		}

		public string Pesquisa
		{
			get
			{
				return this._pesquisa;
			}
			set
			{
				this._pesquisa = value;
				base.OnPropertyChanged("Pesquisa");
			}
		}

		public ObservableCollection<PesquisaAvancada> Pesquisas
		{
			get
			{
				return this._pesquisas;
			}
			set
			{
				this._pesquisas = value;
				base.OnPropertyChanged("Pesquisas");
			}
		}

		public PesquisaAvancada Resultado
		{
			get
			{
				return this._resultado;
			}
			set
			{
				if (value != null)
				{
					value.set_Status(this.Status);
				}
				this._resultado = value;
				base.OnPropertyChanged("Resultado");
			}
		}

		public FiltroStatusDocumento Status
		{
			get
			{
				return this._status;
			}
			set
			{
				this._status = value;
				this._oldStatus = value;
				if (this.Resultado != null)
				{
					this.Resultado.set_Status(this.Status);
				}
				base.OnPropertyChanged("Status");
			}
		}

		public TipoTela Tela
		{
			get
			{
				return this._tela;
			}
			set
			{
				this._tela = value;
				base.OnPropertyChanged("Tela");
			}
		}

		public TipoPesquisa Tipo
		{
			get
			{
				return this._tipo;
			}
			set
			{
				if (value == 1 || value == 2 || value == 17 || value == 9)
				{
					this.EnableStatus = false;
					FiltroStatusDocumento filtroStatusDocumento = this._oldStatus;
					this.Status = 4;
					this._oldStatus = filtroStatusDocumento;
				}
				else if (this._tipo == 1 || this._tipo == 2)
				{
					this.EnableStatus = true;
					this.Status = this._oldStatus;
				}
				this._tipo = value;
				this.GetTipoTela();
				this.HabilitarBusca();
				base.OnPropertyChanged("Tipo");
			}
		}

		public TipoFiltroBusca TipoFiltro
		{
			get
			{
				return this._tipoFiltro;
			}
			set
			{
				this._tipoFiltro = value;
				base.OnPropertyChanged("TipoFiltro");
			}
		}

		public DialogPesquisaAvancadaViewModel()
		{
		}

		public void GetTipoPesquisa()
		{
			TipoFiltroBusca tipoFiltroBusca = this._tipoFiltro;
			if (tipoFiltroBusca == null)
			{
				this.TipoBusca = false;
				return;
			}
			if (tipoFiltroBusca != 1)
			{
				return;
			}
			this.TipoBusca = true;
		}

		public void GetTipoTela()
		{
			switch (this.Tipo)
			{
				case 0:
				case 14:
				{
					this.Tela = 3;
					return;
				}
				case 1:
				case 3:
				case 4:
				case 5:
				case 6:
				case 7:
				case 8:
				case 10:
				case 11:
				case 12:
				case 13:
				case 15:
				case 16:
				case 17:
				{
					this.Tela = 21;
					return;
				}
				case 2:
				case 9:
				{
					this.Tela = 7;
					return;
				}
				default:
				{
					return;
				}
			}
		}

		public void HabilitarBusca()
		{
			switch (this.Tipo)
			{
				case 0:
				case 4:
				case 6:
				case 8:
				case 10:
				case 13:
				case 14:
				{
					this.HabilitarFiltroBuscar = true;
					return;
				}
				case 1:
				case 2:
				{
					this.TipoFiltro = 1;
					this.HabilitarFiltroBuscar = false;
					return;
				}
				case 3:
				case 5:
				case 7:
				case 9:
				case 11:
				case 12:
				{
					this.TipoFiltro = 0;
					this.HabilitarFiltroBuscar = false;
					return;
				}
				default:
				{
					this.TipoFiltro = 0;
					this.HabilitarFiltroBuscar = false;
					return;
				}
			}
		}

		public async Task Pesquisar()
		{
			List<VendedorUsuario> vendedorUsuarios;
			long id;
			ObservableCollection<PesquisaAvancada> observableCollection;
			PesquisaAvancada pesquisaAvancada2;
			int num;
			ObservableCollection<PesquisaAvancada> observableCollection1;
			if (Recursos.Usuario != null)
			{
				vendedorUsuarios = await base.VerificaVinculoVendedor(Recursos.Usuario);
			}
			else
			{
				vendedorUsuarios = new List<VendedorUsuario>();
			}
			List<VendedorUsuario> vendedorUsuarios1 = vendedorUsuarios;
			this.GetTipoPesquisa();
			switch (this.Tipo)
			{
				case 0:
				{
					this.Pesquisas = new ObservableCollection<PesquisaAvancada>(await (new AutoServico()).BuscarChassi(this.Pesquisa, this.Status, vendedorUsuarios1, this.TipoBusca));
					break;
				}
				case 1:
				{
					if (long.TryParse(this.Pesquisa, out id))
					{
						Documento documento = await (new ApoliceServico()).BuscarCodDocumento(long.Parse(this.Pesquisa), vendedorUsuarios1);
						DialogPesquisaAvancadaViewModel dialogPesquisaAvancadaViewModel = this;
						if (documento == null || documento.get_Excluido())
						{
							observableCollection1 = new ObservableCollection<PesquisaAvancada>();
						}
						else
						{
							observableCollection = new ObservableCollection<PesquisaAvancada>();
							pesquisaAvancada2 = new PesquisaAvancada();
							pesquisaAvancada2.set_Nome(documento.get_Controle().get_Cliente().get_Nome());
							pesquisaAvancada2.set_IdDocumento(documento.get_Id());
							string[] proposta = new string[] { "CÓDIGO DO COCUMENTO: ", null, null, null, null, null, null, null };
							id = documento.get_Id();
							proposta[1] = id.ToString();
							proposta[2] = " - NÚMERO DA PROPOSTA: ";
							proposta[3] = documento.get_Proposta();
							proposta[4] = " - NÚMERO DA APÓLICE: ";
							proposta[5] = documento.get_Apolice();
							proposta[6] = " - NÚMERO DO ENDOSSO: ";
							proposta[7] = documento.get_Endosso();
							pesquisaAvancada2.set_Pesquisa(string.Concat(proposta));
							pesquisaAvancada2.set_IdCliente(documento.get_Controle().get_Cliente().get_Id());
							observableCollection.Add(pesquisaAvancada2);
							observableCollection1 = observableCollection;
						}
						dialogPesquisaAvancadaViewModel.Pesquisas = observableCollection1;
						break;
					}
					else
					{
						return;
					}
				}
				case 2:
				{
					SinistroServico sinistroServico = new SinistroServico();
					if (int.TryParse(this.Pesquisa, out num))
					{
						Sinistro sinistro = await sinistroServico.BuscarSinistro(long.Parse(this.Pesquisa));
						if (sinistro != null)
						{
							observableCollection = new ObservableCollection<PesquisaAvancada>();
							pesquisaAvancada2 = new PesquisaAvancada();
							pesquisaAvancada2.set_IdCliente(sinistro.get_ControleSinistro().get_Item().get_Documento().get_Controle().get_Cliente().get_Id());
							pesquisaAvancada2.set_IdDocumento(sinistro.get_ControleSinistro().get_Item().get_Documento().get_Id());
							pesquisaAvancada2.set_IdItem(sinistro.get_ControleSinistro().get_Item().get_Id());
							pesquisaAvancada2.set_IdSinistro(sinistro.get_Id());
							pesquisaAvancada2.set_Nome(sinistro.get_ControleSinistro().get_Item().get_Documento().get_NomeProponente());
							string[] itemSinistrado = new string[] { "CÓDIGO DO SINISTRO: ", null, null, null, null, null };
							id = sinistro.get_ControleSinistro().get_Id();
							itemSinistrado[1] = id.ToString();
							itemSinistrado[2] = " - NÚMERO DA APÓLICE: ";
							itemSinistrado[3] = sinistro.get_ControleSinistro().get_Item().get_Documento().get_Apolice();
							itemSinistrado[4] = " - ITEM ";
							itemSinistrado[5] = sinistro.get_ItemSinistrado();
							pesquisaAvancada2.set_Pesquisa(string.Concat(itemSinistrado));
							observableCollection.Add(pesquisaAvancada2);
							this.Pesquisas = observableCollection;
							break;
						}
						else
						{
							this.Pesquisas = new ObservableCollection<PesquisaAvancada>();
							break;
						}
					}
					else
					{
						return;
					}
				}
				case 3:
				{
					List<ClienteEmail> clienteEmails = await (new EmailServico()).BuscarEmail(this.Pesquisa);
					DialogPesquisaAvancadaViewModel dialogPesquisaAvancadaViewModel1 = this;
					List<ClienteEmail> clienteEmails1 = clienteEmails;
					dialogPesquisaAvancadaViewModel1.Pesquisas = new ObservableCollection<PesquisaAvancada>(clienteEmails1.Select<ClienteEmail, PesquisaAvancada>((ClienteEmail x) => {
						PesquisaAvancada pesquisaAvancada = new PesquisaAvancada();
						pesquisaAvancada.set_Nome(x.get_Cliente().get_Nome());
						pesquisaAvancada.set_Pesquisa(string.Concat("E-MAIL: ", x.get_Email()));
						pesquisaAvancada.set_IdCliente(x.get_Cliente().get_Id());
						return pesquisaAvancada;
					}).ToList<PesquisaAvancada>());
					break;
				}
				case 4:
				{
					List<Documento> documentos = await (new ApoliceServico()).BuscarApolice(this.Pesquisa, this.Status, vendedorUsuarios1, "Estipulante", this.TipoBusca);
					DialogPesquisaAvancadaViewModel observableCollection2 = this;
					List<Documento> documentos1 = documentos;
					observableCollection2.Pesquisas = new ObservableCollection<PesquisaAvancada>(documentos1.Select<Documento, PesquisaAvancada>((Documento x) => {
						PesquisaAvancada pesquisaAvancada = new PesquisaAvancada();
						pesquisaAvancada.set_IdCliente(x.get_Controle().get_Cliente().get_Id());
						pesquisaAvancada.set_IdDocumento(x.get_Id());
						pesquisaAvancada.set_Nome(x.get_Controle().get_Cliente().get_Nome());
						pesquisaAvancada.set_Pesquisa(string.Concat(" NÚMERO DA APÓLICE: ", x.get_Apolice()));
						return pesquisaAvancada;
					}).ToList<PesquisaAvancada>());
					break;
				}
				case 5:
				{
					this.Pesquisas = new ObservableCollection<PesquisaAvancada>(await (new PatrimonialServico()).BuscarImobiliaria(this.Pesquisa, this.Status, vendedorUsuarios1));
					break;
				}
				case 6:
				{
					this.Pesquisas = new ObservableCollection<PesquisaAvancada>(await (new AutoServico()).BuscarItem(this.Pesquisa, this.Status, vendedorUsuarios1, this.TipoBusca));
					break;
				}
				case 7:
				{
					this.Pesquisas = new ObservableCollection<PesquisaAvancada>(await (new PatrimonialServico()).BuscarLocatario(this.Pesquisa, this.Status, vendedorUsuarios1));
					break;
				}
				case 8:
				{
					List<Documento> documentos2 = await (new ApoliceServico()).BuscarApolice(this.Pesquisa, this.Status, vendedorUsuarios1, "", this.TipoBusca);
					DialogPesquisaAvancadaViewModel dialogPesquisaAvancadaViewModel2 = this;
					List<Documento> documentos3 = documentos2;
					dialogPesquisaAvancadaViewModel2.Pesquisas = new ObservableCollection<PesquisaAvancada>(documentos3.Select<Documento, PesquisaAvancada>((Documento x) => {
						string str;
						PesquisaAvancada pesquisaAvancada = new PesquisaAvancada();
						pesquisaAvancada.set_IdCliente(x.get_Controle().get_Cliente().get_Id());
						pesquisaAvancada.set_IdDocumento(x.get_Id());
						pesquisaAvancada.set_Nome(x.get_Controle().get_Cliente().get_Nome());
						PesquisaAvancada pesquisaAvancada1 = pesquisaAvancada;
						if (!x.get_Vigencia2().HasValue)
						{
							str = string.Format("NÚMERO DA APÓLICE: {0} - VIGÊNCIA INICIAL: {1:d} - NÚMERO DO ENDOSSO: {2}", x.get_Apolice(), x.get_Vigencia1(), x.get_Endosso());
						}
						else
						{
							object[] apolice = new object[] { x.get_Apolice(), x.get_Vigencia1(), null, null };
							apolice[2] = x.get_Vigencia2().Value;
							apolice[3] = x.get_Endosso();
							str = string.Format("NÚMERO DA APÓLICE: {0} - VIGÊNCIA INICIAL: {1:d} - VIGÊNCIA FINAL: {2:d} - NÚMERO DO ENDOSSO: {3}", apolice);
						}
						pesquisaAvancada1.set_Pesquisa(str);
						return pesquisaAvancada;
					}).ToList<PesquisaAvancada>());
					break;
				}
				case 9:
				{
					List<Sinistro> sinistros = await (new SinistroServico()).BuscarSinistros(this.Pesquisa);
					DialogPesquisaAvancadaViewModel observableCollection3 = this;
					List<Sinistro> sinistros1 = sinistros;
					observableCollection3.Pesquisas = new ObservableCollection<PesquisaAvancada>(sinistros1.Select<Sinistro, PesquisaAvancada>((Sinistro x) => {
						PesquisaAvancada pesquisaAvancada = new PesquisaAvancada();
						pesquisaAvancada.set_Nome(x.get_ControleSinistro().get_Item().get_Documento().get_Controle().get_Cliente().get_Nome());
						pesquisaAvancada.set_Pesquisa(string.Concat(new string[] { "NÚMERO DO SINISTRO: ", x.get_Numero(), " -  NÚMERO DA APÓLICE: ", x.get_ControleSinistro().get_Item().get_Documento().get_Apolice(), " - ITEM: ", x.get_ItemSinistrado() }));
						pesquisaAvancada.set_IdCliente(x.get_ControleSinistro().get_Item().get_Documento().get_Controle().get_Cliente().get_Id());
						pesquisaAvancada.set_IdDocumento(x.get_ControleSinistro().get_Item().get_Documento().get_Id());
						pesquisaAvancada.set_IdItem(x.get_ControleSinistro().get_Item().get_Id());
						pesquisaAvancada.set_IdSinistro(x.get_Id());
						return pesquisaAvancada;
					}).ToList<PesquisaAvancada>());
					break;
				}
				case 10:
				{
					List<Documento> documentos4 = await (new ApoliceServico()).BuscarApolice(this.Pesquisa, this.Status, vendedorUsuarios1, "Proposta", this.TipoBusca);
					DialogPesquisaAvancadaViewModel dialogPesquisaAvancadaViewModel3 = this;
					List<Documento> documentos5 = documentos4;
					dialogPesquisaAvancadaViewModel3.Pesquisas = new ObservableCollection<PesquisaAvancada>(documentos5.Select<Documento, PesquisaAvancada>((Documento x) => {
						PesquisaAvancada pesquisaAvancada = new PesquisaAvancada();
						pesquisaAvancada.set_IdCliente(x.get_Controle().get_Cliente().get_Id());
						pesquisaAvancada.set_IdDocumento(x.get_Id());
						pesquisaAvancada.set_Nome(x.get_Controle().get_Cliente().get_Nome());
						pesquisaAvancada.set_Pesquisa(string.Concat(new string[] { "NÚMERO DA PROPOSTA: ", x.get_Proposta(), " - NÚMERO DA APÓLICE: ", x.get_Apolice(), " - NÚMERO DO ENDOSSO: ", x.get_Endosso() }));
						return pesquisaAvancada;
					}).ToList<PesquisaAvancada>());
					break;
				}
				case 11:
				{
					List<Documento> documentos6 = await (new ApoliceServico()).BuscarApolice(this.Pesquisa, this.Status, vendedorUsuarios1, "NumeroEndosso", this.TipoBusca);
					DialogPesquisaAvancadaViewModel observableCollection4 = this;
					List<Documento> documentos7 = documentos6;
					observableCollection4.Pesquisas = new ObservableCollection<PesquisaAvancada>(documentos7.Select<Documento, PesquisaAvancada>((Documento x) => {
						PesquisaAvancada pesquisaAvancada = new PesquisaAvancada();
						pesquisaAvancada.set_IdCliente(x.get_Controle().get_Cliente().get_Id());
						pesquisaAvancada.set_IdDocumento(x.get_Id());
						pesquisaAvancada.set_Nome(x.get_Controle().get_Cliente().get_Nome());
						pesquisaAvancada.set_Pesquisa(string.Concat("NÚMERO DA APÓLICE: ", x.get_Apolice(), " - NÚMERO DO ENDOSSO: ", x.get_Endosso()));
						return pesquisaAvancada;
					}).ToList<PesquisaAvancada>());
					break;
				}
				case 12:
				{
					List<Cliente> clientes = await (new ClienteServico()).BuscarObsCliente(this.Pesquisa);
					DialogPesquisaAvancadaViewModel dialogPesquisaAvancadaViewModel4 = this;
					List<Cliente> clientes1 = clientes;
					dialogPesquisaAvancadaViewModel4.Pesquisas = new ObservableCollection<PesquisaAvancada>(clientes1.Select<Cliente, PesquisaAvancada>((Cliente x) => {
						PesquisaAvancada pesquisaAvancada = new PesquisaAvancada();
						pesquisaAvancada.set_Nome(x.get_Nome());
						pesquisaAvancada.set_Pesquisa(string.Concat("OBSERVAÇÃO: ", x.get_Observacao()));
						pesquisaAvancada.set_IdCliente(x.get_Id());
						return pesquisaAvancada;
					}).ToList<PesquisaAvancada>());
					break;
				}
				case 13:
				{
					List<Cliente> clientes2 = await (new ClienteServico()).BuscarPastaCliente(this.Pesquisa, this.TipoBusca);
					DialogPesquisaAvancadaViewModel observableCollection5 = this;
					List<Cliente> clientes3 = clientes2;
					observableCollection5.Pesquisas = new ObservableCollection<PesquisaAvancada>(clientes3.Select<Cliente, PesquisaAvancada>((Cliente x) => {
						PesquisaAvancada pesquisaAvancada = new PesquisaAvancada();
						pesquisaAvancada.set_Nome(x.get_Nome());
						pesquisaAvancada.set_Pesquisa(string.Concat("PASTA: ", x.get_Pasta()));
						pesquisaAvancada.set_IdCliente(x.get_Id());
						return pesquisaAvancada;
					}).ToList<PesquisaAvancada>());
					break;
				}
				case 14:
				{
					this.Pesquisas = new ObservableCollection<PesquisaAvancada>(await (new AutoServico()).BuscarPlaca(this.Pesquisa, this.Status, vendedorUsuarios1, this.TipoBusca));
					break;
				}
				case 15:
				{
					List<Documento> documentos8 = await (new ApoliceServico()).BuscarApolice(this.Pesquisa, this.Status, vendedorUsuarios1, "PedidoEndosso", this.TipoBusca);
					DialogPesquisaAvancadaViewModel dialogPesquisaAvancadaViewModel5 = this;
					List<Documento> documentos9 = documentos8;
					dialogPesquisaAvancadaViewModel5.Pesquisas = new ObservableCollection<PesquisaAvancada>(documentos9.Select<Documento, PesquisaAvancada>((Documento x) => {
						PesquisaAvancada pesquisaAvancada = new PesquisaAvancada();
						pesquisaAvancada.set_IdCliente(x.get_Controle().get_Cliente().get_Id());
						pesquisaAvancada.set_IdDocumento(x.get_Id());
						pesquisaAvancada.set_Nome(x.get_Controle().get_Cliente().get_Nome());
						pesquisaAvancada.set_Pesquisa(string.Concat(new string[] { "PROPOSTA ENDOSSO: ", x.get_PropostaEndosso(), " - NÚMERO DA APÓLICE: ", x.get_Apolice(), " - NÚMERO DO ENDOSSO: ", x.get_Endosso() }));
						return pesquisaAvancada;
					}).ToList<PesquisaAvancada>());
					break;
				}
				case 16:
				{
					ClienteServico clienteServico = new ClienteServico();
					string str1 = ValidationHelper.FormatarTelefone(this.Pesquisa);
					string str2 = str1;
					this.Pesquisa = str1;
					List<ClienteTelefone> clienteTelefones = await clienteServico.BuscarTelefonesClientes(str2);
					DialogPesquisaAvancadaViewModel observableCollection6 = this;
					List<ClienteTelefone> clienteTelefones1 = clienteTelefones;
					observableCollection6.Pesquisas = new ObservableCollection<PesquisaAvancada>(clienteTelefones1.Select<ClienteTelefone, PesquisaAvancada>((ClienteTelefone x) => {
						PesquisaAvancada pesquisaAvancada = new PesquisaAvancada();
						pesquisaAvancada.set_Nome(x.get_Cliente().get_Nome());
						pesquisaAvancada.set_Pesquisa(string.Concat("TELEFONE: ", x.get_Prefixo(), "-", x.get_Numero()));
						pesquisaAvancada.set_IdCliente(x.get_Cliente().get_Id());
						return pesquisaAvancada;
					}).ToList<PesquisaAvancada>());
					break;
				}
				case 17:
				{
					List<Documento> documentos10 = await (new ParcelaServico()).BuscarFatura(this.Pesquisa);
					DialogPesquisaAvancadaViewModel dialogPesquisaAvancadaViewModel6 = this;
					List<Documento> documentos11 = documentos10;
					dialogPesquisaAvancadaViewModel6.Pesquisas = new ObservableCollection<PesquisaAvancada>(documentos11.Select<Documento, PesquisaAvancada>((Documento x) => {
						PesquisaAvancada pesquisaAvancada = new PesquisaAvancada();
						pesquisaAvancada.set_IdDocumento(x.get_Id());
						pesquisaAvancada.set_Nome(x.get_Controle().get_Cliente().get_Nome());
						pesquisaAvancada.set_Pesquisa(string.Concat("CÓDIGO DA FATURA: ", x.get_Endosso()));
						pesquisaAvancada.set_IdCliente(x.get_Controle().get_Cliente().get_Id());
						return pesquisaAvancada;
					}).ToList<PesquisaAvancada>());
					break;
				}
				case 18:
				{
					this.Pesquisas = new ObservableCollection<PesquisaAvancada>(await (new ItemServico()).BuscaItensPorObs(this.Pesquisa, this.Status, vendedorUsuarios1, this.TipoBusca));
					break;
				}
			}
		}
	}
}