summaryrefslogtreecommitdiff
path: root/Gestor.Application/ViewModels/Drawer/ExtratosViewModel.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Gestor.Application/ViewModels/Drawer/ExtratosViewModel.cs')
-rw-r--r--Gestor.Application/ViewModels/Drawer/ExtratosViewModel.cs5516
1 files changed, 0 insertions, 5516 deletions
diff --git a/Gestor.Application/ViewModels/Drawer/ExtratosViewModel.cs b/Gestor.Application/ViewModels/Drawer/ExtratosViewModel.cs
deleted file mode 100644
index f07bd68..0000000
--- a/Gestor.Application/ViewModels/Drawer/ExtratosViewModel.cs
+++ /dev/null
@@ -1,5516 +0,0 @@
-using Gestor.Application.Componentes;
-using Gestor.Application.Helpers;
-using Gestor.Application.Servicos;
-using Gestor.Application.Servicos.Seguros;
-using Gestor.Application.Servicos.Seguros.Itens;
-using Gestor.Application.ViewModels;
-using Gestor.Application.ViewModels.Generic;
-using Gestor.Common.Validation;
-using Gestor.Model.Common;
-using Gestor.Model.Domain.Common;
-using Gestor.Model.Domain.Configuracoes;
-using Gestor.Model.Domain.Generic;
-using Gestor.Model.Domain.Relatorios.ClientesAtivosInativos;
-using Gestor.Model.Domain.Seguros;
-using NReco.PdfGenerator;
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Diagnostics;
-using System.IO;
-using System.Linq;
-using System.Runtime.CompilerServices;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows;
-
-namespace Gestor.Application.ViewModels.Drawer
-{
- public class ExtratosViewModel : BaseSegurosViewModel
- {
- private readonly ClienteServico _clienteServico = new ClienteServico();
-
- private List<Documento> _documentos;
-
- private List<Prospeccao> _prospeccoes;
-
- private List<Cliente> _clientes;
-
- private bool _tipoExtratoEnabled = true;
-
- private bool _extratoResumido;
-
- private bool _segurosVigentes;
-
- private Visibility _clientePorPaginaVisibility;
-
- private bool _clientePorPagina;
-
- private bool _extratoPorPagina;
-
- private bool _clientePorPaginaEnabled = true;
-
- private bool _obsCliente;
-
- private bool _comissaoDocumento;
-
- private bool _premioParcela;
-
- private bool _obsApolice;
-
- private bool _beneficiariosItens;
-
- private bool _selecionarItens;
-
- private bool _endossos;
-
- private bool _somenteEndosso;
-
- private Visibility _selecionarItensVisibility;
-
- private Visibility _endossoVisibility;
-
- private Visibility _obsDocVisibility;
-
- private Visibility _segurosVigentesVisibility;
-
- private bool _obsItem;
-
- private bool _separarPagina;
-
- private bool _perfilCondutor;
-
- private bool _obsClienteEnabled = true;
-
- private bool _comissaoDocumentoEnabled;
-
- private bool _obsApoliceEnabled;
-
- private bool _beneficiariosItensEnabled;
-
- private bool _obsItemEnabled;
-
- private bool _separarPaginaEnabled;
-
- private bool _coberturasEnabled;
-
- private bool _coberturas;
-
- private bool _perfilCondutorEnabled;
-
- private bool _endossoEnabled;
-
- private bool _esconderResumido;
-
- private bool _clienteVisibility;
-
- private bool _documentoVisibility;
-
- private bool _itemVisibility;
-
- private bool _perfilVisibility;
-
- private TipoExtrato _selectedTipoExtrato;
-
- private bool _carregando;
-
- private List<Item> _itensSelecionados;
-
- internal Relatorio? TipoDeRelatorio;
-
- public bool BeneficiariosItens
- {
- get
- {
- return this._beneficiariosItens;
- }
- set
- {
- this._beneficiariosItens = value;
- base.OnPropertyChanged("BeneficiariosItens");
- }
- }
-
- public bool BeneficiariosItensEnabled
- {
- get
- {
- return this._beneficiariosItensEnabled;
- }
- set
- {
- this._beneficiariosItensEnabled = value;
- base.OnPropertyChanged("BeneficiariosItensEnabled");
- }
- }
-
- public bool Carregando
- {
- get
- {
- return this._carregando;
- }
- set
- {
- this._carregando = value;
- base.IsEnabled = !value;
- base.EnableMenu = !value;
- base.OnPropertyChanged("Carregando");
- }
- }
-
- public bool ClientePorPagina
- {
- get
- {
- return this._clientePorPagina;
- }
- set
- {
- this._clientePorPagina = value;
- base.OnPropertyChanged("ClientePorPagina");
- }
- }
-
- public bool ClientePorPaginaEnabled
- {
- get
- {
- return this._clientePorPaginaEnabled;
- }
- set
- {
- this._clientePorPaginaEnabled = value;
- base.OnPropertyChanged("ClientePorPaginaEnabled");
- }
- }
-
- public Visibility ClientePorPaginaVisibility
- {
- get
- {
- return this._clientePorPaginaVisibility;
- }
- set
- {
- this._clientePorPaginaVisibility = value;
- base.OnPropertyChanged("ClientePorPaginaVisibility");
- }
- }
-
- public List<Cliente> Clientes
- {
- get
- {
- return this._clientes;
- }
- set
- {
- this._clientes = value;
- base.OnPropertyChanged("Clientes");
- }
- }
-
- public bool ClienteVisibility
- {
- get
- {
- return this._clienteVisibility;
- }
- set
- {
- this._clienteVisibility = value;
- base.OnPropertyChanged("ClienteVisibility");
- }
- }
-
- public bool Coberturas
- {
- get
- {
- return this._coberturas;
- }
- set
- {
- this._coberturas = value;
- base.OnPropertyChanged("Coberturas");
- }
- }
-
- public bool CoberturasEnabled
- {
- get
- {
- return this._coberturasEnabled;
- }
- set
- {
- this._coberturasEnabled = value;
- base.OnPropertyChanged("CoberturasEnabled");
- }
- }
-
- public bool ComissaoDocumento
- {
- get
- {
- return this._comissaoDocumento;
- }
- set
- {
- this._comissaoDocumento = value;
- base.OnPropertyChanged("ComissaoDocumento");
- }
- }
-
- public bool ComissaoDocumentoEnabled
- {
- get
- {
- return this._comissaoDocumentoEnabled;
- }
- set
- {
- this._comissaoDocumentoEnabled = value;
- base.OnPropertyChanged("ComissaoDocumentoEnabled");
- }
- }
-
- public List<Documento> Documentos
- {
- get
- {
- return this._documentos;
- }
- set
- {
- this._documentos = value;
- base.OnPropertyChanged("Documentos");
- }
- }
-
- public bool DocumentoVisibility
- {
- get
- {
- return this._documentoVisibility;
- }
- set
- {
- this._documentoVisibility = value;
- base.OnPropertyChanged("DocumentoVisibility");
- }
- }
-
- public bool EndossoEnabled
- {
- get
- {
- return this._endossoEnabled;
- }
- set
- {
- this._endossoEnabled = value;
- base.OnPropertyChanged("EndossoEnabled");
- }
- }
-
- public bool Endossos
- {
- get
- {
- return this._endossos;
- }
- set
- {
- this._endossos = value;
- if (this.SomenteEndossos != !value)
- {
- this.SomenteEndossos = !value;
- }
- base.OnPropertyChanged("Endossos");
- }
- }
-
- public Visibility EndossoVisibility
- {
- get
- {
- return this._endossoVisibility;
- }
- set
- {
- this._endossoVisibility = value;
- base.OnPropertyChanged("EndossoVisibility");
- }
- }
-
- public bool EsconderResumido
- {
- get
- {
- return this._esconderResumido;
- }
- set
- {
- this._esconderResumido = value;
- base.OnPropertyChanged("EsconderResumido");
- }
- }
-
- public bool ExtratoPorPagina
- {
- get
- {
- return this._extratoPorPagina;
- }
- set
- {
- this._extratoPorPagina = value;
- base.OnPropertyChanged("ExtratoPorPagina");
- }
- }
-
- public bool ExtratoResumido
- {
- get
- {
- return this._extratoResumido;
- }
- set
- {
- this._extratoResumido = value;
- if (!value)
- {
- this.ClienteVisibility = true;
- this.DocumentoVisibility = true;
- this.ItemVisibility = true;
- this.AjustaTipoSelecionado(this.SelectedTipoExtrato);
- }
- else
- {
- this.ClienteVisibility = false;
- this.DocumentoVisibility = false;
- this.ItemVisibility = this.CoberturasEnabled;
- this.SelecionarItensVisibility = Visibility.Collapsed;
- this.BeneficiariosItensEnabled = false;
- this.ObsItemEnabled = false;
- this.SepararPaginaEnabled = false;
- }
- base.OnPropertyChanged("ExtratoResumido");
- }
- }
-
- public bool ItemVisibility
- {
- get
- {
- return this._itemVisibility;
- }
- set
- {
- this._itemVisibility = value;
- base.OnPropertyChanged("ItemVisibility");
- }
- }
-
- public bool ObsApolice
- {
- get
- {
- return this._obsApolice;
- }
- set
- {
- this._obsApolice = value;
- base.OnPropertyChanged("ObsApolice");
- }
- }
-
- public bool ObsApoliceEnabled
- {
- get
- {
- return this._obsApoliceEnabled;
- }
- set
- {
- this._obsApoliceEnabled = value;
- base.OnPropertyChanged("ObsApoliceEnabled");
- }
- }
-
- public bool ObsCliente
- {
- get
- {
- return this._obsCliente;
- }
- set
- {
- this._obsCliente = value;
- base.OnPropertyChanged("ObsCliente");
- }
- }
-
- public bool ObsClienteEnabled
- {
- get
- {
- return this._obsClienteEnabled;
- }
- set
- {
- this._obsClienteEnabled = value;
- base.OnPropertyChanged("ObsClienteEnabled");
- }
- }
-
- public Visibility ObsDocVisibility
- {
- get
- {
- return this._obsDocVisibility;
- }
- set
- {
- this._obsDocVisibility = value;
- base.OnPropertyChanged("ObsDocVisibility");
- }
- }
-
- public bool ObsItem
- {
- get
- {
- return this._obsItem;
- }
- set
- {
- this._obsItem = value;
- base.OnPropertyChanged("ObsItem");
- }
- }
-
- public bool ObsItemEnabled
- {
- get
- {
- return this._obsItemEnabled;
- }
- set
- {
- this._obsItemEnabled = value;
- base.OnPropertyChanged("ObsItemEnabled");
- }
- }
-
- public bool PerfilCondutor
- {
- get
- {
- return this._perfilCondutor;
- }
- set
- {
- this._perfilCondutor = value;
- base.OnPropertyChanged("PerfilCondutor");
- }
- }
-
- public bool PerfilCondutorEnabled
- {
- get
- {
- return this._perfilCondutorEnabled;
- }
- set
- {
- this._perfilCondutorEnabled = value;
- base.OnPropertyChanged("PerfilCondutorEnabled");
- }
- }
-
- public bool PerfilVisibility
- {
- get
- {
- return this._perfilVisibility;
- }
- set
- {
- this._perfilVisibility = value;
- base.OnPropertyChanged("PerfilVisibility");
- }
- }
-
- public bool PremioParcela
- {
- get
- {
- return this._premioParcela;
- }
- set
- {
- this._premioParcela = value;
- base.OnPropertyChanged("PremioParcela");
- }
- }
-
- public List<Prospeccao> Prospeccoes
- {
- get
- {
- return this._prospeccoes;
- }
- set
- {
- this._prospeccoes = value;
- base.OnPropertyChanged("Prospeccoes");
- }
- }
-
- public bool SegurosVigentes
- {
- get
- {
- return this._segurosVigentes;
- }
- set
- {
- this._segurosVigentes = value;
- base.OnPropertyChanged("SegurosVigentes");
- }
- }
-
- public Visibility SegurosVigentesVisibility
- {
- get
- {
- return this._segurosVigentesVisibility;
- }
- set
- {
- this._segurosVigentesVisibility = value;
- base.OnPropertyChanged("SegurosVigentesVisibility");
- }
- }
-
- public bool SelecionarItens
- {
- get
- {
- return this._selecionarItens;
- }
- set
- {
- this._selecionarItens = value;
- if (!value)
- {
- this._itensSelecionados = new List<Item>();
- }
- base.OnPropertyChanged("SelecionarItens");
- }
- }
-
- public Visibility SelecionarItensVisibility
- {
- get
- {
- return this._selecionarItensVisibility;
- }
- set
- {
- this._selecionarItensVisibility = value;
- base.OnPropertyChanged("SelecionarItensVisibility");
- }
- }
-
- public TipoExtrato SelectedTipoExtrato
- {
- get
- {
- return this._selectedTipoExtrato;
- }
- set
- {
- this._selectedTipoExtrato = value;
- this.AjustaTipoSelecionado(value);
- base.OnPropertyChanged("SelectedTipoExtrato");
- }
- }
-
- public bool SepararPagina
- {
- get
- {
- return this._separarPagina;
- }
- set
- {
- this._separarPagina = value;
- base.OnPropertyChanged("SepararPagina");
- }
- }
-
- public bool SepararPaginaEnabled
- {
- get
- {
- return this._separarPaginaEnabled;
- }
- set
- {
- this._separarPaginaEnabled = value;
- base.OnPropertyChanged("SepararPaginaEnabled");
- }
- }
-
- public bool SomenteEndossos
- {
- get
- {
- return this._somenteEndosso;
- }
- set
- {
- this._somenteEndosso = value;
- if (this.Endossos != !value)
- {
- this.Endossos = !value;
- }
- base.OnPropertyChanged("SomenteEndossos");
- }
- }
-
- public bool TipoExtratoEnabled
- {
- get
- {
- return this._tipoExtratoEnabled;
- }
- set
- {
- this._tipoExtratoEnabled = value;
- base.OnPropertyChanged("TipoExtratoEnabled");
- }
- }
-
- public ExtratosViewModel()
- {
- }
-
- public void AjustaTipoSelecionado(TipoExtrato tipoExtrato)
- {
- switch (tipoExtrato)
- {
- case 0:
- {
- this.ClienteVisibility = true;
- this.ClientePorPaginaVisibility = Visibility.Hidden;
- this.DocumentoVisibility = false;
- this.ItemVisibility = false;
- this.PerfilVisibility = false;
- this.EsconderResumido = true;
- this.SelecionarItensVisibility = Visibility.Collapsed;
- this.SegurosVigentesVisibility = Visibility.Collapsed;
- this.SegurosVigentes = false;
- this.EndossoVisibility = Visibility.Collapsed;
- this.ObsDocVisibility = Visibility.Collapsed;
- this.ExtratoCliente();
- return;
- }
- case 1:
- {
- this.ClienteVisibility = true;
- this.ClientePorPaginaVisibility = Visibility.Visible;
- this.DocumentoVisibility = true;
- this.ItemVisibility = true;
- this.PerfilVisibility = true;
- this.EsconderResumido = false;
- this.SelecionarItensVisibility = (!this.TipoDeRelatorio.HasValue ? Visibility.Visible : Visibility.Collapsed);
- this.SegurosVigentesVisibility = Visibility.Collapsed;
- this.SegurosVigentes = false;
- this.EndossoVisibility = Visibility.Visible;
- this.ObsDocVisibility = Visibility.Visible;
- this.ApoliceSelecionada();
- return;
- }
- case 2:
- {
- this.ClienteVisibility = false;
- this.ClientePorPaginaVisibility = Visibility.Collapsed;
- this.DocumentoVisibility = true;
- this.ItemVisibility = false;
- this.PerfilVisibility = true;
- this.EsconderResumido = false;
- this.SelecionarItensVisibility = Visibility.Collapsed;
- this.SegurosVigentesVisibility = Visibility.Visible;
- this.EndossoVisibility = Visibility.Collapsed;
- this.ObsDocVisibility = Visibility.Collapsed;
- this.RelacaoApolices();
- return;
- }
- default:
- {
- return;
- }
- }
- }
-
- private void ApoliceSelecionada()
- {
- this.SetAllFalse();
- this.ObsClienteEnabled = true;
- this.ClientePorPaginaEnabled = true;
- this.ComissaoDocumentoEnabled = true;
- this.ObsApoliceEnabled = true;
- this.BeneficiariosItensEnabled = true;
- this.ObsItemEnabled = true;
- this.SepararPaginaEnabled = true;
- this.PerfilCondutorEnabled = true;
- this.EndossoEnabled = true;
- this.CoberturasEnabled = true;
- }
-
- private void ExtratoCliente()
- {
- this.SetAllFalse();
- this.ObsClienteEnabled = true;
- }
-
- public async Task Gerar(Relatorio? tipoRelatorio = null, bool pdf = false)
- {
- DateTime date;
- List<Item> items;
- int numeroParcela;
- DateTime? clienteDesde;
- EstadoCivil? estadoCivil;
- Sexo? sexo;
- TipoTelefone? nullable;
- TipoTelefone tipoTelefone;
- decimal premioLiquido;
- List<ControleSinistro> controleSinistros;
- long id;
- Patrimonial patrimonial;
- Auto auto;
- TipoCobertura? tipoCobertura;
- int? bonus;
- TabelaReferencia? tabelaReferencia;
- Vida vida;
- RiscosDiversos riscosDiverso;
- Aeronautico aeronautico;
- Granizo granizo;
- string str14;
- string str15;
- string str16;
- string str17;
- string str18;
- string str19;
- string str20;
- string str21;
- string str22;
- string shortDateString;
- string str23;
- string str24;
- string shortDateString1;
- string str25;
- string str26;
- string str27;
- string str28;
- string str29;
- string str30;
- string str31;
- string str32;
- string shortDateString2;
- string str33;
- string str34;
- string str35;
- string str36;
- string str37;
- string str38;
- string str39;
- string str40;
- string str41;
- string str42;
- string str43;
- string str44;
- string str45;
- string str46;
- string str47;
- string str48;
- string shortDateString3;
- string str49;
- string str50;
- string str51;
- string str52;
- string str53;
- string endosso;
- string str54;
- string str55;
- string str56;
- string str57;
- string str58;
- string str59;
- string str60;
- string str61;
- string str62;
- string str63;
- string str64;
- string str65;
- string str66;
- string str67;
- string str68;
- string str69;
- string str70;
- string str71;
- string str72;
- string shortDateString4;
- string str73;
- string shortDateString5;
- string str74;
- string str75;
- string str76;
- string str77;
- string str78;
- string str79;
- string str80;
- string str81;
- string str82;
- string str83;
- string str84;
- string str85;
- string str86;
- string str87;
- string str88;
- string str89;
- string str90;
- string description;
- string str91;
- string str92;
- string str93;
- string str94;
- string description1;
- string str95;
- string str96;
- string str97;
- string str98;
- string str99;
- string str100;
- string str101;
- string str102;
- string str103;
- string str104;
- string str105;
- string str106;
- DateTime? dataReclamacao;
- string shortDateString6;
- string str107;
- string description2;
- string str108;
- string str109;
- string currency;
- string str110;
- string str111;
- string descricao;
- string str112;
- string str113;
- string str114;
- string str115;
- string str116;
- string str117;
- string str118;
- string shortDateString7;
- string str119;
- string str120;
- string str121;
- string str122;
- string str123;
- string str124;
- string str125;
- string str126;
- string str127;
- string str128;
- string str129;
- string str130;
- string str131;
- string str132;
- string str133;
- string str134;
- string str135;
- string str136;
- string str137;
- string str138;
- string str139;
- string str140;
- string str141;
- string str142;
- string str143;
- string str144;
- string str145;
- string str146;
- string str147;
- string str148;
- string str149;
- string str150;
- string str151;
- string str152;
- string str153;
- string str154;
- string str155;
- string str156;
- string str157;
- string str158;
- string str159;
- string str160;
- string str161;
- string str162;
- string str163;
- bool count;
- string str164;
- string str165;
- string str166;
- string str167;
- string str168;
- string str169;
- string str170;
- string str171;
- string str172;
- string str173;
- string str174;
- string str175;
- NegocioCorretora negocioCorretora;
- string str176;
- string str177;
- string str178;
- string str179;
- string shortDateString8;
- string str180;
- string str181;
- string str182;
- string str183;
- string str184;
- string str185;
- string shortDateString9;
- string str186;
- string str187;
- string str188;
- string str189;
- string str190;
- string str191;
- string str192;
- string str193;
- string str194;
- string str195;
- string str196;
- string str197;
- string str198;
- string str199;
- string str200;
- string str201;
- string str202;
- string str203;
- string str204;
- string str205;
- string str206;
- string str207;
- string str208;
- string str209;
- string str210;
- string str211;
- string str212;
- string str213;
- string str214;
- string str215;
- string str216;
- string str217;
- string str218;
- string str219;
- string str220;
- string str221;
- string str222;
- string str223;
- string str224;
- string shortDateString10;
- string str225;
- string str226;
- string str227;
- string str228;
- string str229;
- string shortDateString11;
- string str230;
- string shortDateString12;
- string str231;
- string shortDateString13;
- string str232;
- string str233;
- string str234;
- string str235;
- string str236;
- string str237;
- string str238;
- string str239;
- string str240;
- string str241;
- string str242;
- string str243;
- Documento documento;
- string str244;
- string str245;
- string str246;
- string shortDateString14;
- string str247;
- string str248;
- string str249;
- string str250;
- string str251;
- string endosso1;
- string str252;
- string str253;
- string str254;
- string str255;
- string str256;
- string str257;
- string str258;
- string str259;
- string str260;
- string str261;
- string str262;
- string str263;
- string str264;
- string str265;
- string str266;
- string str267;
- string str268;
- string str269;
- string str270;
- string str271;
- string str272;
- string str273;
- string str274;
- string str275;
- string str276;
- string str277;
- string description3;
- string str278;
- string str279;
- string str280;
- string str281;
- string description4;
- string str282;
- string str283;
- string str284;
- string str285;
- string str286;
- string str287;
- string str288;
- string str289;
- string str290;
- string str291;
- DateTime? dataReclamacao1;
- string shortDateString15;
- string str292;
- string str293;
- string str294;
- string str295;
- string descricao1;
- string str296;
- string str297;
- string str298;
- string str299;
- string str300;
- string str301;
- string str302;
- string shortDateString16;
- string str303;
- string str304;
- string str305;
- string str306;
- string str307;
- string str308;
- string str309;
- string str310;
- string str311;
- string str312;
- string str313;
- string str314;
- string str315;
- string str316;
- string str317;
- string str318;
- string str319;
- string str320;
- string str321;
- string str322;
- string str323;
- string str324;
- string str325;
- string str326;
- string str327;
- string str328;
- string str329;
- string str330;
- string str331;
- NegocioCorretora negocioCorretora1;
- string str332;
- string str333;
- string str334;
- string str335;
- string str336;
- string str337;
- string str338;
- string str339;
- string str340;
- string str341;
- string str342;
- string str343;
- string str344;
- string str345;
- string str346;
- string str347;
- string str348;
- string str349;
- string str350;
- string str351;
- string str352;
- string shortDateString17;
- string str353;
- string str354;
- string str355;
- string str356;
- string str357;
- string str358;
- string str359;
- string str360;
- string str361;
- string str362;
- string str363;
- string str364;
- string str365;
- string str366;
- string str367;
- string str368;
- string str369;
- ExtratosViewModel.u003cu003ec__DisplayClass170_0 variable9 = null;
- int num10;
- List<Item> list;
- Item item = null;
- Item item1;
- string str370;
- string str371 = "";
- if (this.Clientes != null && this.Documentos == null)
- {
- str371 = string.Concat(str371, "<html><head><meta http-equiv='Content-Type' content='text/html; charset=UTF-8'><meta http-equiv='Content-Language' content='pt-br'><meta charset='utf-8'><meta name='viewport' content='width=device-width, initial-scale=1, shrink-to-fit=no'><link rel='stylesheet' href='https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css' integrity='sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T' crossorigin='anonymous'><style type='text/css' media='print'>@page{ size: A4;} body; -webkit-print-color-adjust: exact; }</style><title>");
- str367 = (this.ExtratoResumido ? " RESUMIDO" : "");
- str370 = string.Concat("EXTRATO", str367, " DO CLIENTE");
- str371 = string.Concat(str371, str370);
- str371 = string.Concat(str371, "</title></head><body bgcolor='#FFFFFF'><div align='center'>");
- str371 = string.Concat(str371, "<style> td > p { margin: 2px; }</style>");
- long id1 = (long)0;
- this.Clientes.ForEach((Cliente x) => {
- TipoTelefone? tipo;
- TipoTelefone valueOrDefault;
- string str;
- string str1;
- string upper;
- string str2;
- string str3;
- string str4;
- string upper1;
- string str5;
- string str6;
- string str7;
- string str8;
- int num = 0;
- if (id1 != x.get_Id())
- {
- id1 = x.get_Id();
- str371 = string.Concat(str371, (!this.ClientePorPagina || !this.ClientePorPaginaEnabled ? "" : "<div style='page-break-before:always;'>"));
- str371 = string.Concat(str371, "<table border='0' width='999'><td height='20' width='999' bgcolor='black'><h4 style='text-align: center; color: white; background-color: black'>");
- str370 = string.Concat("EXTRATO", (this.ExtratoResumido ? " RESUMIDO" : ""), " DO CLIENTE: ", x.get_Nome());
- str371 = string.Concat(str371, str370, "</h4></td></table><br>");
- string str9 = (x.get_Atividade() == null ? "NASCIMENTO" : "ABERTURA");
- bool pessoaFisica = x.get_PessoaFisica();
- ExtratosViewModel.u003cu003ec__DisplayClass170_0 cSu0024u003cu003e8_locals1 = variable9;
- string[] strArrays = new string[] { str371, "<table border='1' bordercolor='#ededed' width='999'><font face='Verdana' style='font-size: 12pt; position: absolute; top: 50 %; -moz-transform: translateY(-50 %); -webkit-transform: translateY(-50 %); transform: translateY(-50 %)'><tr><td width='333' bgcolor='", (num % 2 == 0 ? "WhiteSmoke" : "White"), "' ", (pessoaFisica ? "" : "colspan='1'"), "><p align='left'><b>CLIENTE: </b>", x.get_Nome(), "</p></td><td width='222' bgcolor='", (num % 2 == 0 ? "WhiteSmoke" : "White"), "' ", (pessoaFisica ? "" : "colspan='2'"), "><p align='left' x-ms-format-detection='none'><b>CPF/CNPJ: </b>", x.get_Documento(), "</p></td><td width='222' bgcolor='", (num % 2 == 0 ? "WhiteSmoke" : "White"), "' ", (pessoaFisica ? "" : "colspan='3'"), "><p align='left'><b>", str9, ": </b>", null, null };
- DateTime? nascimento = x.get_Nascimento();
- strArrays[20] = (nascimento.HasValue ? nascimento.GetValueOrDefault().ToShortDateString() : null);
- strArrays[21] = "</p></td>";
- cSu0024u003cu003e8_locals1.html = string.Concat(strArrays);
- if (!pessoaFisica)
- {
- num++;
- }
- else
- {
- ExtratosViewModel.u003cu003ec__DisplayClass170_0 variable = variable9;
- string[] cSu0024u003cu003e8_locals11 = new string[] { str371, "<td width='222' bgcolor='", null, null, null, null };
- int num1 = num;
- num = num1 + 1;
- cSu0024u003cu003e8_locals11[2] = (num1 % 2 == 0 ? "WhiteSmoke" : "White");
- cSu0024u003cu003e8_locals11[3] = "'><p align='left'><b>FALECIDO: </b>";
- cSu0024u003cu003e8_locals11[4] = (x.get_Falecido() ? "SIM" : "NÃO");
- cSu0024u003cu003e8_locals11[5] = "</p></td>";
- variable.html = string.Concat(cSu0024u003cu003e8_locals11);
- }
- str371 = string.Concat(str371, "</tr>");
- if (x.get_Atividade() != null)
- {
- ExtratosViewModel.u003cu003ec__DisplayClass170_0 variable1 = variable9;
- string[] nome = new string[] { str371, "<tr><td bgcolor='", null, null, null, null };
- nome[2] = (num % 2 == 0 ? "WhiteSmoke" : "White");
- nome[3] = "' colspan='6'><p align='left'><b>RAMO DE ATIVIDADE: </b>";
- nome[4] = x.get_Atividade().get_Nome();
- nome[5] = "</p></td></tr>";
- variable1.html = string.Concat(nome);
- if (!pessoaFisica)
- {
- num++;
- }
- }
- if (this.SelectedTipoExtrato != 2)
- {
- str371 = string.Concat(str371, "<tr>");
- if (pessoaFisica)
- {
- ExtratosViewModel.u003cu003ec__DisplayClass170_0 cSu0024u003cu003e8_locals12 = variable9;
- string[] strArrays1 = new string[] { str371, "<td bgcolor='", null, null, null, null, null, null, null, null };
- strArrays1[2] = (num % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays1[3] = "'><p align='left'><b>ESTADO CIVIL: </b>";
- strArrays1[4] = (x.get_EstadoCivil().HasValue ? x.get_EstadoCivil().ToString().ToUpper() : "-");
- strArrays1[5] = "</p></td><td bgcolor='";
- strArrays1[6] = (num % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays1[7] = "'><p align='left'><b>SEXO: </b>";
- strArrays1[8] = (x.get_Sexo().HasValue ? x.get_Sexo().ToString().ToUpper() : "-");
- strArrays1[9] = "</p></td>";
- cSu0024u003cu003e8_locals12.html = string.Concat(strArrays1);
- }
- ExtratosViewModel.u003cu003ec__DisplayClass170_0 variable2 = variable9;
- string[] strArrays2 = new string[] { str371, "<td bgcolor='", null, null, null, null, null, null };
- int num2 = num;
- num = num2 + 1;
- strArrays2[2] = (num2 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays2[3] = "' ";
- strArrays2[4] = (pessoaFisica ? "colspan='2'" : "colspan='4'");
- strArrays2[5] = "><p align='left'><b>CLIENTE DESDE: </b>";
- nascimento = x.get_ClienteDesde();
- if (nascimento.HasValue)
- {
- nascimento = x.get_ClienteDesde();
- str8 = (nascimento.HasValue ? nascimento.GetValueOrDefault().ToShortDateString() : null);
- }
- else
- {
- str8 = "-";
- }
- strArrays2[6] = str8;
- strArrays2[7] = "</p></td></tr>";
- variable2.html = string.Concat(strArrays2);
- }
- if (pessoaFisica)
- {
- ExtratosViewModel.u003cu003ec__DisplayClass170_0 cSu0024u003cu003e8_locals13 = variable9;
- string[] strArrays3 = new string[] { str371, "<tr><td bgcolor='", (num % 2 == 0 ? "WhiteSmoke" : "White"), "'><p align='left' x-ms-format-detection='none'><b>HABILITAÇÃO: </b>", (!string.IsNullOrWhiteSpace(x.get_Habilitacao()) ? x.get_Habilitacao() : "-"), "</p></td><td bgcolor='", (num % 2 == 0 ? "WhiteSmoke" : "White"), "'><p align='left' x-ms-format-detection='none'><b>CATEGORIA: </b>", (!string.IsNullOrWhiteSpace(x.get_CategoriaHabilitacao()) ? x.get_CategoriaHabilitacao() : "-"), "</p></td><td bgcolor='", (num % 2 == 0 ? "WhiteSmoke" : "White"), "'><p align='left' x-ms-format-detection='none'><b>1ª HAB.: </b>", null, null, null, null, null, null };
- nascimento = x.get_PrimeiraHabilitacao();
- if (nascimento.HasValue)
- {
- nascimento = x.get_PrimeiraHabilitacao();
- str6 = (nascimento.HasValue ? nascimento.GetValueOrDefault().ToShortDateString() : null);
- }
- else
- {
- str6 = "-";
- }
- strArrays3[12] = str6;
- strArrays3[13] = "</p></td><td bgcolor='";
- int num3 = num;
- num = num3 + 1;
- strArrays3[14] = (num3 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays3[15] = "'><p align='left' x-ms-format-detection='none'><b>VENCIMENTO: </b>";
- nascimento = x.get_VencimentoHabilitacao();
- if (nascimento.HasValue)
- {
- nascimento = x.get_VencimentoHabilitacao();
- str7 = (nascimento.HasValue ? nascimento.GetValueOrDefault().ToShortDateString() : null);
- }
- else
- {
- str7 = "-";
- }
- strArrays3[16] = str7;
- strArrays3[17] = "</p></td></tr>";
- cSu0024u003cu003e8_locals13.html = string.Concat(strArrays3);
- }
- if (!string.IsNullOrWhiteSpace(x.get_Identidade()))
- {
- ExtratosViewModel.u003cu003ec__DisplayClass170_0 variable3 = variable9;
- string[] cSu0024u003cu003e8_locals14 = new string[] { str371, "<tr><td bgcolor='", (num % 2 == 0 ? "WhiteSmoke" : "White"), "'><p align='left' x-ms-format-detection='none'><b>RG: </b>", (!string.IsNullOrWhiteSpace(x.get_Identidade()) ? x.get_Identidade() : "-"), "</p></td><td bgcolor='", (num % 2 == 0 ? "WhiteSmoke" : "White"), "'><p align='left'><b>ORGÃO EMISSOR: </b>", (!string.IsNullOrWhiteSpace(x.get_Emissor()) ? x.get_Emissor() : "-"), "</p></td><td bgcolor='", (num % 2 == 0 ? "WhiteSmoke" : "White"), "'><p align='left'><b>ESTADO EMISSOR: </b>", (!string.IsNullOrWhiteSpace(x.get_EstadoEmissor()) ? x.get_EstadoEmissor() : "-"), "</p></td><td bgcolor='", null, null, null, null };
- int num4 = num;
- num = num4 + 1;
- cSu0024u003cu003e8_locals14[14] = (num4 % 2 == 0 ? "WhiteSmoke" : "White");
- cSu0024u003cu003e8_locals14[15] = "'><p align='left'><b>EXPEDIÇÃO: </b>";
- nascimento = x.get_Expedicao();
- if (nascimento.HasValue)
- {
- nascimento = x.get_Expedicao();
- str5 = (nascimento.HasValue ? nascimento.GetValueOrDefault().ToShortDateString() : null);
- }
- else
- {
- str5 = "-";
- }
- cSu0024u003cu003e8_locals14[16] = str5;
- cSu0024u003cu003e8_locals14[17] = "</p></td></tr>";
- variable3.html = string.Concat(cSu0024u003cu003e8_locals14);
- }
- if (this.SelectedTipoExtrato != 2 && !this.ExtratoResumido)
- {
- ExtratosViewModel.u003cu003ec__DisplayClass170_0 variable4 = variable9;
- string[] strArrays4 = new string[] { str371, "<tr><td bgcolor='", (num % 2 == 0 ? "WhiteSmoke" : "White"), "'><p align='left'><b>BANCO: </b>", (x.get_Banco() != null ? x.get_Banco().get_Nome() : "-"), "</p></td><td bgcolor='", (num % 2 == 0 ? "WhiteSmoke" : "White"), "'><p align='left' x-ms-format-detection='none'><b>AGÊNCIA: </b>", (!string.IsNullOrWhiteSpace(x.get_Agencia()) ? x.get_Agencia() : "-"), "</p></td><td bgcolor='", (num % 2 == 0 ? "WhiteSmoke" : "White"), "'><p align='left' x-ms-format-detection='none'><b>CONTA: </b>", (!string.IsNullOrWhiteSpace(x.get_Conta()) ? x.get_Conta() : "-"), "</p></td><td bgcolor='", null, null, null, null };
- int num5 = num;
- num = num5 + 1;
- strArrays4[14] = (num5 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays4[15] = "'><p align='left' x-ms-format-detection='none'><b>TIPO: </b>";
- strArrays4[16] = (!string.IsNullOrWhiteSpace(x.get_TipoConta()) ? x.get_TipoConta() : "-");
- strArrays4[17] = "</p></td></tr>";
- variable4.html = string.Concat(strArrays4);
- }
- if ((x.get_Telefones() != null || x.get_Emails() != null) && this.SelectedTipoExtrato != 2)
- {
- str371 = string.Concat(str371, "<tr>");
- if (x.get_Telefones() != null)
- {
- string str10 = "";
- foreach (ClienteTelefone telefone in x.get_Telefones())
- {
- string[] prefixo = new string[] { str10, "<br>", null, null, null, null, null };
- tipo = telefone.get_Tipo();
- if (tipo.HasValue)
- {
- valueOrDefault = tipo.GetValueOrDefault();
- upper1 = valueOrDefault.ToString().ToUpper();
- }
- else
- {
- upper1 = null;
- }
- prefixo[2] = upper1;
- prefixo[3] = " (";
- prefixo[4] = telefone.get_Prefixo();
- prefixo[5] = ") ";
- prefixo[6] = telefone.get_Numero();
- str10 = string.Concat(prefixo);
- }
- ExtratosViewModel.u003cu003ec__DisplayClass170_0 cSu0024u003cu003e8_locals15 = variable9;
- string[] strArrays5 = new string[] { str371, "<td bgcolor='", null, null, null, null };
- strArrays5[2] = (num % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays5[3] = "' colspan='2'><p align='left'><b>CONTATOS: </b>";
- strArrays5[4] = str10;
- strArrays5[5] = "</p></td>";
- cSu0024u003cu003e8_locals15.html = string.Concat(strArrays5);
- }
- if (x.get_Emails() != null && !this.ExtratoResumido)
- {
- string str11 = "";
- foreach (ClienteEmail email in x.get_Emails())
- {
- str11 = string.Concat(str11, "<br>", email.get_Email());
- }
- ExtratosViewModel.u003cu003ec__DisplayClass170_0 variable5 = variable9;
- string[] cSu0024u003cu003e8_locals16 = new string[] { str371, "<td bgcolor='", null, null, null, null };
- cSu0024u003cu003e8_locals16[2] = (num % 2 == 0 ? "WhiteSmoke" : "White");
- cSu0024u003cu003e8_locals16[3] = "' colspan='2'><p align='left'><b>EMAILS: </b>";
- cSu0024u003cu003e8_locals16[4] = str11;
- cSu0024u003cu003e8_locals16[5] = "</p></td>";
- variable5.html = string.Concat(cSu0024u003cu003e8_locals16);
- }
- num++;
- str371 = string.Concat(str371, "</tr>");
- }
- if (x.get_Enderecos() != null && this.SelectedTipoExtrato != 2)
- {
- string str12 = "";
- foreach (ClienteEndereco endereco in x.get_Enderecos())
- {
- string[] bairro = new string[] { str12, "<br>", endereco.get_Endereco(), ", ", endereco.get_Numero(), ", ", null, null, null, null, null, null, null, null };
- bairro[6] = (string.IsNullOrWhiteSpace(endereco.get_Complemento()) ? "" : string.Concat(endereco.get_Complemento(), ", "));
- bairro[7] = endereco.get_Bairro();
- bairro[8] = " - ";
- bairro[9] = endereco.get_Cidade();
- bairro[10] = " - ";
- bairro[11] = endereco.get_Estado();
- bairro[12] = " - ";
- bairro[13] = endereco.get_Cep();
- str12 = string.Concat(bairro);
- }
- ExtratosViewModel.u003cu003ec__DisplayClass170_0 variable6 = variable9;
- string[] strArrays6 = new string[] { str371, "<tr><td bgcolor='", null, null, null, null };
- int num6 = num;
- num = num6 + 1;
- strArrays6[2] = (num6 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays6[3] = "' colspan='6'><p align='left'><b>ENDEREÇOS: </b>";
- strArrays6[4] = str12;
- strArrays6[5] = "</p></td></tr>";
- variable6.html = string.Concat(strArrays6);
- }
- if (x.get_Profissao() != null && this.SelectedTipoExtrato != 2)
- {
- ExtratosViewModel.u003cu003ec__DisplayClass170_0 cSu0024u003cu003e8_locals17 = variable9;
- string[] nome1 = new string[] { str371, "<tr><td bgcolor='", null, null, null, null };
- int num7 = num;
- num = num7 + 1;
- nome1[2] = (num7 % 2 == 0 ? "WhiteSmoke" : "White");
- nome1[3] = "' colspan='6'><p align='left'><b>PROFISSÃO: </b>";
- nome1[4] = x.get_Profissao().get_Nome();
- nome1[5] = "</p></td></tr>";
- cSu0024u003cu003e8_locals17.html = string.Concat(nome1);
- }
- if (x.get_Contatos() != null && this.SelectedTipoExtrato != 2 && !this.ExtratoResumido)
- {
- string str13 = "";
- foreach (MaisContato contato in x.get_Contatos())
- {
- string[] nome2 = new string[15];
- nome2[0] = str13;
- nome2[1] = "<br>NOME: ";
- nome2[2] = contato.get_Nome();
- nome2[3] = (!string.IsNullOrWhiteSpace(contato.get_Documento()) ? string.Concat(", DOCUMENTO: ", contato.get_Documento()) : "");
- nascimento = contato.get_Nascimento();
- if (nascimento.HasValue)
- {
- nascimento = contato.get_Nascimento();
- str = string.Concat(", NASCIMENTO: ", (nascimento.HasValue ? nascimento.GetValueOrDefault().ToShortDateString() : null));
- }
- else
- {
- str = "";
- }
- nome2[4] = str;
- Parentesco? parentesco = contato.get_Parentesco();
- if (parentesco.HasValue)
- {
- parentesco = contato.get_Parentesco();
- str1 = string.Concat(", PARENTESCO: ", (parentesco.HasValue ? parentesco.GetValueOrDefault().ToString().ToUpper() : null));
- }
- else
- {
- str1 = "";
- }
- nome2[5] = str1;
- nome2[6] = (!string.IsNullOrWhiteSpace(contato.get_Banco()) || !string.IsNullOrWhiteSpace(contato.get_Agencia()) || !string.IsNullOrWhiteSpace(contato.get_Conta()) ? "<br>" : "");
- nome2[7] = (!string.IsNullOrWhiteSpace(contato.get_Banco()) ? string.Concat("BANCO: ", contato.get_Banco()) : "");
- nome2[8] = (!string.IsNullOrWhiteSpace(contato.get_Agencia()) ? string.Concat((!string.IsNullOrWhiteSpace(contato.get_Banco()) ? ", AGÊNCIA: " : "AGÊNCIA: "), contato.get_Agencia()) : "");
- nome2[9] = (!string.IsNullOrWhiteSpace(contato.get_Conta()) ? string.Concat((!string.IsNullOrWhiteSpace(contato.get_Banco()) || !string.IsNullOrWhiteSpace(contato.get_Agencia()) ? ", CONTA: " : "CONTA: "), contato.get_Conta()) : "");
- tipo = contato.get_Tipo();
- nome2[10] = (tipo.HasValue || !string.IsNullOrWhiteSpace(contato.get_Prefixo()) && !string.IsNullOrWhiteSpace(contato.get_Telefone()) || !string.IsNullOrWhiteSpace(contato.get_Email()) ? "<br>" : "");
- tipo = contato.get_Tipo();
- if (tipo.HasValue)
- {
- tipo = contato.get_Tipo();
- if (tipo.HasValue)
- {
- valueOrDefault = tipo.GetValueOrDefault();
- upper = valueOrDefault.ToString().ToUpper();
- }
- else
- {
- upper = null;
- }
- str2 = string.Concat("TIPO DO TELEFONE: ", upper);
- }
- else
- {
- str2 = "";
- }
- nome2[11] = str2;
- if (string.IsNullOrWhiteSpace(contato.get_Prefixo()) || string.IsNullOrWhiteSpace(contato.get_Telefone()))
- {
- str3 = "";
- }
- else
- {
- tipo = contato.get_Tipo();
- str3 = string.Concat((tipo.HasValue ? ", TELEFONE: (" : "TELEFONE: ("), contato.get_Prefixo(), ") ", contato.get_Telefone());
- }
- nome2[12] = str3;
- if (!string.IsNullOrWhiteSpace(contato.get_Email()))
- {
- tipo = contato.get_Tipo();
- str4 = string.Concat((tipo.HasValue || !string.IsNullOrWhiteSpace(contato.get_Prefixo()) && !string.IsNullOrWhiteSpace(contato.get_Telefone()) ? ", EMAIL: " : "EMAIL: "), contato.get_Email());
- }
- else
- {
- str4 = "";
- }
- nome2[13] = str4;
- nome2[14] = "<br>";
- str13 = string.Concat(nome2);
- }
- ExtratosViewModel.u003cu003ec__DisplayClass170_0 variable7 = variable9;
- string[] strArrays7 = new string[] { str371, "<tr><td bgcolor='", null, null, null, null };
- int num8 = num;
- num = num8 + 1;
- strArrays7[2] = (num8 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays7[3] = "' colspan='6'><p align='left'><b>MAIS CONTATOS: </b>";
- strArrays7[4] = str13;
- strArrays7[5] = "</p></td></tr>";
- variable7.html = string.Concat(strArrays7);
- }
- if (this.ObsCliente && this.ClienteVisibility && this.ObsClienteEnabled && !string.IsNullOrWhiteSpace(x.get_Observacao()) && this.SelectedTipoExtrato != 2 && !this.ExtratoResumido)
- {
- x.set_Observacao(string.Concat("<br>", x.get_Observacao().Replace("\r\n", "<br>")));
- ExtratosViewModel.u003cu003ec__DisplayClass170_0 cSu0024u003cu003e8_locals18 = variable9;
- string[] observacao = new string[] { str371, "<tr><td bgcolor='", null, null, null, null };
- int num9 = num;
- num = num9 + 1;
- observacao[2] = (num9 % 2 == 0 ? "WhiteSmoke" : "White");
- observacao[3] = "' colspan='6'><p align='left' x-ms-format-detection='none'><b>OBSERVAÇÕES: </b>";
- observacao[4] = x.get_Observacao();
- observacao[5] = "</p></td></tr>";
- cSu0024u003cu003e8_locals18.html = string.Concat(observacao);
- }
- if (!string.IsNullOrWhiteSpace(x.get_Pasta()) && this.SelectedTipoExtrato != 2 && !this.ExtratoResumido)
- {
- ExtratosViewModel.u003cu003ec__DisplayClass170_0 variable8 = variable9;
- string[] pasta = new string[] { str371, "<tr><td bgcolor='", null, null, null, null };
- pasta[2] = (num % 2 == 0 ? "WhiteSmoke" : "White");
- pasta[3] = "' colspan='6'><p align='left' x-ms-format-detection='none'><b>PASTA: </b>";
- pasta[4] = x.get_Pasta();
- pasta[5] = "</p></td></tr>";
- variable8.html = string.Concat(pasta);
- }
- str371 = string.Concat(str371, "</font></table>");
- str371 = string.Concat(str371, (this.ClientePorPaginaVisibility != Visibility.Visible || !this.ClientePorPagina || !this.ClientePorPaginaEnabled ? "" : "</div>"));
- }
- });
- DateTime networkTime = Funcoes.GetNetworkTime();
- string[] strArrays8 = new string[] { str371, "<br><font face='Verdana' size='1'><br>", Recursos.Usuario.get_Nome(), " - ", null, null };
- date = networkTime.Date;
- strArrays8[4] = date.ToShortDateString();
- strArrays8[5] = "</font></div><script src='https://code.jquery.com/jquery-3.3.1.slim.min.js' integrity='sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo' crossorigin='anonymous'></script><script src='https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js' integrity='sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1' crossorigin='anonymous'></script><script src='https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js' integrity='sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM' crossorigin='anonymous'></script></body></html>";
- str371 = string.Concat(strArrays8);
- string tempPath = Path.GetTempPath();
- string str372 = string.Format("{0}{1}_{2:ddMMyyyyhhmmss}.html", tempPath, (TipoExtrato)0, networkTime);
- if (!pdf)
- {
- StreamWriter streamWriter = new StreamWriter(str372, true, Encoding.UTF8);
- streamWriter.Write(str371);
- streamWriter.Close();
- }
- else
- {
- str372 = string.Format("{0}{1}_{2:ddMMyyyyhhmmss}.pdf", tempPath, (TipoExtrato)0, networkTime);
- File.WriteAllBytes(str372, (new NRecoHtmlToPdfConverter()).GeneratePdf(str371));
- }
- Process.Start(str372);
- ExtratosViewModel extratosViewModel = this;
- str368 = (this.ExtratoResumido ? " RESUMIDO" : "");
- if (this.Clientes != null)
- {
- str369 = (this.Clientes.Count > 1 ? string.Format("DE {0} CLIENTES", this.Clientes.Count) : string.Concat("DO CLIENTE ", this.Clientes[0].get_Nome()));
- }
- else
- {
- str369 = "";
- }
- string str373 = string.Concat("GEROU O EXTRATO", str368, " ", str369);
- long num11 = (long)0;
- TipoTela? nullable1 = new TipoTela?(23);
- List<Cliente> clientes = this.Clientes;
- extratosViewModel.RegistrarAcao(str373, num11, nullable1, string.Concat("NOMES DOS CLIENTES:\n", string.Join("\n",
- from x in clientes
- select x.get_Nome()), this.GerarOpcoes()));
- this.Documentos = null;
- this.Clientes = null;
- }
- else if ((this.Documentos != null || this.Prospeccoes != null) && this.Clientes == null)
- {
- str371 = "<html><head><meta http-equiv='Content-Type' content='text/html; charset=UTF-8'><meta http-equiv='Content-Language' content='pt-br'><meta charset='utf-8'><meta name='viewport' content='width=device-width, initial-scale=1, shrink-to-fit=no'><link rel='stylesheet' href='https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css' integrity='sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T' crossorigin='anonymous'><style type='text/css' media='print'>@page{ size: A4;} body; -webkit-print-color-adjust: exact; }</style><title>";
- str370 = "";
- switch (this.SelectedTipoExtrato)
- {
- case 0:
- {
- str14 = (this.ExtratoResumido ? " RESUMIDO" : "");
- str370 = string.Concat("EXTRATO", str14, " DO CLIENTE");
- break;
- }
- case 1:
- {
- str364 = (this.ExtratoResumido ? " RESUMIDO" : "");
- str370 = string.Concat("EXTRATO", str364, " DA APÓLICE SELECIONADA");
- if (!tipoRelatorio.HasValue || tipoRelatorio.GetValueOrDefault() != 4)
- {
- break;
- }
- str365 = (this.ExtratoResumido ? " RESUMIDO" : "");
- str370 = string.Concat("EXTRATO", str365, " DO RELATÓRIO DE RENOVAÇÕES");
- break;
- }
- case 2:
- {
- str366 = (this.ExtratoResumido ? " RESUMIDO" : "");
- str370 = string.Concat("EXTRATO", str366, " DE RELAÇÃO DE APÓLICES");
- break;
- }
- }
- str371 = string.Concat(str371, str370);
- str371 = string.Concat(str371, "</title></head><body bgcolor='#FFFFFF'><div align='center'>");
- List<long> nums = new List<long>();
- if (this.Documentos != null && this.Documentos.Count > 0)
- {
- List<ConfiguracaoSistema> configuracoes = Recursos.Configuracoes;
- bool flag = configuracoes.Any<ConfiguracaoSistema>((ConfiguracaoSistema x) => x.get_Configuracao() == 42);
- foreach (Documento documento1 in this.Documentos)
- {
- Documento documento2 = documento1;
- ObservableCollection<Parcela> observableCollection = await (new ParcelaServico()).BuscarParcelasAsync(documento1.get_Id());
- documento2.set_Parcelas(observableCollection);
- documento2 = null;
- Controle controle = documento1.get_Controle();
- Cliente cliente = await this._clienteServico.BuscarCliente(documento1.get_Controle().get_Cliente().get_Id());
- controle.set_Cliente(cliente);
- controle = null;
- Cliente cliente1 = documento1.get_Controle().get_Cliente();
- ObservableCollection<ClienteEndereco> observableCollection1 = await this._clienteServico.BuscarEnderecosAsync(documento1.get_Controle().get_Cliente().get_Id());
- cliente1.set_Enderecos(observableCollection1);
- cliente1 = null;
- cliente1 = documento1.get_Controle().get_Cliente();
- ObservableCollection<ClienteEmail> observableCollection2 = await this._clienteServico.BuscarEmailsAsync(documento1.get_Controle().get_Cliente().get_Id());
- cliente1.set_Emails(observableCollection2);
- cliente1 = null;
- cliente1 = documento1.get_Controle().get_Cliente();
- ObservableCollection<ClienteTelefone> observableCollection3 = await this._clienteServico.BuscarTelefonesAsync(documento1.get_Controle().get_Cliente().get_Id());
- cliente1.set_Telefones(observableCollection3);
- cliente1 = null;
- cliente1 = documento1.get_Controle().get_Cliente();
- ObservableCollection<MaisContato> observableCollection4 = await this._clienteServico.BuscarContatosAsync(documento1.get_Controle().get_Cliente().get_Id());
- cliente1.set_Contatos(observableCollection4);
- cliente1 = null;
- }
- bool flag1 = true;
- foreach (Documento documento3 in this.Documentos)
- {
- List<Item> items1 = new List<Item>();
- items = (!this.Endossos ? await (new ItemServico()).BuscarItens(documento3.get_Controle().get_Id(), 0).ToList<Item>() : await (new ItemServico()).BuscarItens(documento3.get_Id(), 2).ToList<Item>());
- List<Item> items2 = items;
- if (this._itensSelecionados == null || this._itensSelecionados.Count <= 0)
- {
- items1.AddRange(items2);
- }
- else
- {
- items2.ForEach((Item x) => {
- if (this._itensSelecionados.Any<Item>((Item y) => y.get_Id() == x.get_Id()))
- {
- items1.Add(x);
- }
- });
- }
- List<Perfil> perfils = await (new PerfilServico()).BuscarPerfis(documento3.get_Controle().get_Id());
- long num12 = (long)0;
- num10 = 0;
- if (!flag1)
- {
- string str374 = str371;
- str363 = (this.ExtratoPorPagina ? "<div style='page-break-before:always;'>" : "");
- str371 = string.Concat(str374, str363);
- }
- if (num12 != documento3.get_Controle().get_Cliente().get_Id())
- {
- string str375 = str371;
- str40 = (this.ClientePorPaginaVisibility != Visibility.Visible || !this.ClientePorPagina || !this.ClientePorPaginaEnabled || this.ExtratoPorPagina ? "" : "<div style='page-break-before:always;'>");
- str371 = string.Concat(str375, str40);
- str371 = string.Concat(str371, "<table border='0' width='999'><td height='20' width='999' bgcolor='black'><h4 style='text-align: center; color: white; background-color: black'>");
- switch (this.SelectedTipoExtrato)
- {
- case 0:
- {
- str41 = (this.ExtratoResumido ? " RESUMIDO" : "");
- str370 = string.Concat("EXTRATO", str41, " DO CLIENTE: ", documento3.get_Controle().get_Cliente().get_Nome());
- break;
- }
- case 1:
- {
- str359 = (this.ExtratoResumido ? " RESUMIDO" : "");
- str370 = string.Concat("EXTRATO", str359, " DA APÓLICE SELECIONADA: ", documento3.get_Apolice());
- if (tipoRelatorio.HasValue && tipoRelatorio.GetValueOrDefault() == 4)
- {
- str361 = (this.ExtratoResumido ? " RESUMIDO" : "");
- str370 = string.Concat("EXTRATO", str361, " DA APÓLICE: ", documento3.get_Apolice());
- }
- if (!string.IsNullOrEmpty(documento3.get_Endosso()) && !documento3.get_Endosso().Equals("0"))
- {
- str370 = string.Concat(str370, " E DO ENDOSSO: ", documento3.get_Endosso());
- }
- if (!this.SomenteEndossos)
- {
- break;
- }
- str360 = (this.ExtratoResumido ? " RESUMIDO" : "");
- str370 = string.Concat("EXTRATO", str360, " DO ENDOSSO: ", documento3.get_Endosso());
- break;
- }
- case 2:
- {
- str362 = (this.ExtratoResumido ? " RESUMIDO" : "");
- str370 = string.Concat("EXTRATO", str362, " DE RELAÇÃO DE APÓLICES");
- break;
- }
- }
- str371 = string.Concat(str371, str370, "</h4></td></table><br>");
- str371 = string.Concat(str371, "<style>td > p {margin: 2px;}</style>");
- if (!this.ExtratoResumido)
- {
- if ((!this.Endossos || !this.SomenteEndossos) && !nums.Any<long>((long x) => x == this.documento.get_Controle().get_Id()))
- {
- str176 = (documento3.get_Controle().get_Cliente().get_Atividade() == null ? "NASCIMENTO" : "ABERTURA");
- string str376 = str176;
- bool flag2 = documento3.get_Controle().get_Cliente().get_PessoaFisica();
- string[] documento4 = new string[24];
- documento4[0] = str371;
- documento4[1] = "<table border='1' bordercolor='#ededed' width='999'><font face='Verdana' style='font-size: 12pt; position: absolute; top: 50 %; -moz-transform: translateY(-50 %); -webkit-transform: translateY(-50 %); transform: translateY(-50 %)'><tr><td width='";
- documento4[2] = (flag2 ? "222" : "2500");
- documento4[3] = "' bgcolor='";
- str177 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- documento4[4] = str177;
- documento4[5] = "' ";
- documento4[6] = (flag2 ? "" : "colspan='2'");
- documento4[7] = "><p align='left'><b>CLIENTE: </b>";
- documento4[8] = documento3.get_Controle().get_Cliente().get_Nome();
- documento4[9] = "</p></td><td width='";
- documento4[10] = (flag2 ? "222" : "200");
- documento4[11] = "' bgcolor='";
- str178 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- documento4[12] = str178;
- documento4[13] = "'><p align='left' x-ms-format-detection='none'><b>CPF/CNPJ: </b>";
- documento4[14] = documento3.get_Controle().get_Cliente().get_Documento();
- documento4[15] = "</p></td><td width='";
- documento4[16] = (flag2 ? "222" : "300");
- documento4[17] = "' bgcolor='";
- str179 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- documento4[18] = str179;
- documento4[19] = "'><p align='left'><b>";
- documento4[20] = str376;
- documento4[21] = ": </b>";
- clienteDesde = documento3.get_Controle().get_Cliente().get_Nascimento();
- if (clienteDesde.HasValue)
- {
- shortDateString8 = clienteDesde.GetValueOrDefault().ToShortDateString();
- }
- else
- {
- shortDateString8 = null;
- }
- documento4[22] = shortDateString8;
- documento4[23] = "</p></td>";
- str371 = string.Concat(documento4);
- if (!flag2)
- {
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- }
- else
- {
- string[] strArrays9 = new string[] { str371, "<td width='222' bgcolor='", null, null, null, null };
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str238 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays9[2] = str238;
- strArrays9[3] = "'><p align='left'><b>FALECIDO: </b>";
- str239 = (documento3.get_Controle().get_Cliente().get_Falecido() ? "SIM" : "NÃO");
- strArrays9[4] = str239;
- strArrays9[5] = "</p></td>";
- str371 = string.Concat(strArrays9);
- }
- str371 = string.Concat(str371, "</tr>");
- if (documento3.get_Controle().get_Cliente().get_Atividade() != null)
- {
- string[] strArrays10 = new string[] { str371, "<tr><td bgcolor='", null, null, null, null, null, null };
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str237 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays10[2] = str237;
- strArrays10[3] = "' ";
- strArrays10[4] = (flag2 ? "" : "colspan='4'");
- strArrays10[5] = "><p align='left'><b>RAMO DE ATIVIDADE: </b>";
- strArrays10[6] = documento3.get_Controle().get_Cliente().get_Atividade().get_Nome();
- strArrays10[7] = "</p></td></tr>";
- str371 = string.Concat(strArrays10);
- }
- if (this.SelectedTipoExtrato != 2)
- {
- string[] strArrays11 = new string[] { str371, "<tr><td bgcolor='", null, null, null, null };
- str231 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays11[2] = str231;
- strArrays11[3] = "' ";
- strArrays11[4] = (flag2 ? "" : "colspan='4'");
- strArrays11[5] = ">";
- str371 = string.Concat(strArrays11);
- if (flag2)
- {
- string[] strArrays12 = new string[] { str371, "<b>ESTADO CIVIL: </b>", null, null, null, null, null, null, null, null };
- if (documento3.get_Controle().get_Cliente().get_EstadoCivil().HasValue)
- {
- estadoCivil = documento3.get_Controle().get_Cliente().get_EstadoCivil();
- str233 = estadoCivil.ToString().ToUpper();
- }
- else
- {
- str233 = "-";
- }
- strArrays12[2] = str233;
- strArrays12[3] = "</p></td><td bgcolor='";
- str234 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays12[4] = str234;
- strArrays12[5] = "'><p align='left'><b>SEXO: </b>";
- if (documento3.get_Controle().get_Cliente().get_Sexo().HasValue)
- {
- sexo = documento3.get_Controle().get_Cliente().get_Sexo();
- str235 = sexo.ToString().ToUpper();
- }
- else
- {
- str235 = "-";
- }
- strArrays12[6] = str235;
- strArrays12[7] = "</p></td><td bgcolor='";
- str236 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays12[8] = str236;
- strArrays12[9] = "'><p align='left'>";
- str371 = string.Concat(strArrays12);
- }
- string str377 = str371;
- clienteDesde = documento3.get_Controle().get_Cliente().get_ClienteDesde();
- if (clienteDesde.HasValue)
- {
- clienteDesde = documento3.get_Controle().get_Cliente().get_ClienteDesde();
- if (clienteDesde.HasValue)
- {
- shortDateString13 = clienteDesde.GetValueOrDefault().ToShortDateString();
- }
- else
- {
- shortDateString13 = null;
- }
- }
- else
- {
- shortDateString13 = "-";
- }
- str371 = string.Concat(str377, "<p align='left'><b>CLIENTE DESDE: </b>", shortDateString13, "</p></td>");
- if (documento3.get_Controle().get_Cliente().get_Profissao() == null || this.SelectedTipoExtrato == 2)
- {
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- }
- else
- {
- string[] strArrays13 = new string[] { str371, "<td bgcolor='", null, null, null, null };
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str232 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays13[2] = str232;
- strArrays13[3] = "' > <p align='left'><b>PROFISSÃO: </b>";
- strArrays13[4] = documento3.get_Controle().get_Cliente().get_Profissao().get_Nome();
- strArrays13[5] = "</p></td>";
- str371 = string.Concat(strArrays13);
- }
- str371 = string.Concat(str371, "</tr>");
- }
- if (flag2)
- {
- string[] strArrays14 = new string[18];
- strArrays14[0] = str371;
- strArrays14[1] = "<tr><td bgcolor='";
- str225 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays14[2] = str225;
- strArrays14[3] = "'><p align='left' x-ms-format-detection='none'><b>HABILITAÇÃO: </b>";
- str226 = (!string.IsNullOrWhiteSpace(documento3.get_Controle().get_Cliente().get_Habilitacao()) ? documento3.get_Controle().get_Cliente().get_Habilitacao() : "-");
- strArrays14[4] = str226;
- strArrays14[5] = "</p></td><td bgcolor='";
- str227 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays14[6] = str227;
- strArrays14[7] = "'><p align='left' x-ms-format-detection='none'><b>CATEGORIA: </b>";
- str228 = (!string.IsNullOrWhiteSpace(documento3.get_Controle().get_Cliente().get_CategoriaHabilitacao()) ? documento3.get_Controle().get_Cliente().get_CategoriaHabilitacao() : "-");
- strArrays14[8] = str228;
- strArrays14[9] = "</p></td><td bgcolor='";
- str229 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays14[10] = str229;
- strArrays14[11] = "'><p align='left' x-ms-format-detection='none'><b>1ª HAB.: </b>";
- clienteDesde = documento3.get_Controle().get_Cliente().get_PrimeiraHabilitacao();
- if (clienteDesde.HasValue)
- {
- clienteDesde = documento3.get_Controle().get_Cliente().get_PrimeiraHabilitacao();
- if (clienteDesde.HasValue)
- {
- shortDateString11 = clienteDesde.GetValueOrDefault().ToShortDateString();
- }
- else
- {
- shortDateString11 = null;
- }
- }
- else
- {
- shortDateString11 = "-";
- }
- strArrays14[12] = shortDateString11;
- strArrays14[13] = "</p></td><td bgcolor='";
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str230 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays14[14] = str230;
- strArrays14[15] = "'><p align='left' x-ms-format-detection='none'><b>VENCIMENTO: </b>";
- clienteDesde = documento3.get_Controle().get_Cliente().get_VencimentoHabilitacao();
- if (clienteDesde.HasValue)
- {
- clienteDesde = documento3.get_Controle().get_Cliente().get_VencimentoHabilitacao();
- if (clienteDesde.HasValue)
- {
- shortDateString12 = clienteDesde.GetValueOrDefault().ToShortDateString();
- }
- else
- {
- shortDateString12 = null;
- }
- }
- else
- {
- shortDateString12 = "-";
- }
- strArrays14[16] = shortDateString12;
- strArrays14[17] = "</p></td></tr>";
- str371 = string.Concat(strArrays14);
- }
- if (!string.IsNullOrWhiteSpace(documento3.get_Controle().get_Cliente().get_Identidade()))
- {
- string[] strArrays15 = new string[18];
- strArrays15[0] = str371;
- strArrays15[1] = "<tr><td bgcolor='";
- str218 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays15[2] = str218;
- strArrays15[3] = "'><p align='left' x-ms-format-detection='none'><b>RG: </b>";
- str219 = (!string.IsNullOrWhiteSpace(documento3.get_Controle().get_Cliente().get_Identidade()) ? documento3.get_Controle().get_Cliente().get_Identidade() : "-");
- strArrays15[4] = str219;
- strArrays15[5] = "</p></td><td bgcolor='";
- str220 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays15[6] = str220;
- strArrays15[7] = "'><p align='left'><b>ORGÃO EMISSOR: </b>";
- str221 = (!string.IsNullOrWhiteSpace(documento3.get_Controle().get_Cliente().get_Emissor()) ? documento3.get_Controle().get_Cliente().get_Emissor() : "-");
- strArrays15[8] = str221;
- strArrays15[9] = "</p></td><td bgcolor='";
- str222 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays15[10] = str222;
- strArrays15[11] = "'><p align='left'><b>ESTADO EMISSOR: </b>";
- str223 = (!string.IsNullOrWhiteSpace(documento3.get_Controle().get_Cliente().get_EstadoEmissor()) ? documento3.get_Controle().get_Cliente().get_EstadoEmissor() : "-");
- strArrays15[12] = str223;
- strArrays15[13] = "</p></td><td bgcolor='";
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str224 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays15[14] = str224;
- strArrays15[15] = "'><p align='left'><b>EXPEDIÇÃO: </b>";
- clienteDesde = documento3.get_Controle().get_Cliente().get_Expedicao();
- if (clienteDesde.HasValue)
- {
- clienteDesde = documento3.get_Controle().get_Cliente().get_Expedicao();
- if (clienteDesde.HasValue)
- {
- shortDateString10 = clienteDesde.GetValueOrDefault().ToShortDateString();
- }
- else
- {
- shortDateString10 = null;
- }
- }
- else
- {
- shortDateString10 = "-";
- }
- strArrays15[16] = shortDateString10;
- strArrays15[17] = "</p></td></tr>";
- str371 = string.Concat(strArrays15);
- }
- if (this.SelectedTipoExtrato != 2 && !this.ExtratoResumido)
- {
- string[] strArrays16 = new string[18];
- strArrays16[0] = str371;
- strArrays16[1] = "<tr><td bgcolor='";
- str210 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays16[2] = str210;
- strArrays16[3] = "'><p align='left'><b>BANCO: </b>";
- str211 = (documento3.get_Controle().get_Cliente().get_Banco() != null ? documento3.get_Controle().get_Cliente().get_Banco().get_Nome() : "-");
- strArrays16[4] = str211;
- strArrays16[5] = "</p></td><td bgcolor='";
- str212 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays16[6] = str212;
- strArrays16[7] = "'><p align='left' x-ms-format-detection='none'><b>AGÊNCIA: </b>";
- str213 = (!string.IsNullOrWhiteSpace(documento3.get_Controle().get_Cliente().get_Agencia()) ? documento3.get_Controle().get_Cliente().get_Agencia() : "-");
- strArrays16[8] = str213;
- strArrays16[9] = "</p></td><td bgcolor='";
- str214 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays16[10] = str214;
- strArrays16[11] = "'><p align='left' x-ms-format-detection='none'><b>CONTA: </b>";
- str215 = (!string.IsNullOrWhiteSpace(documento3.get_Controle().get_Cliente().get_Conta()) ? documento3.get_Controle().get_Cliente().get_Conta() : "-");
- strArrays16[12] = str215;
- strArrays16[13] = "</p></td><td bgcolor='";
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str216 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays16[14] = str216;
- strArrays16[15] = "'><p align='left' x-ms-format-detection='none'><b>TIPO: </b>";
- str217 = (!string.IsNullOrWhiteSpace(documento3.get_Controle().get_Cliente().get_TipoConta()) ? documento3.get_Controle().get_Cliente().get_TipoConta() : "-");
- strArrays16[16] = str217;
- strArrays16[17] = "</p></td></tr>";
- str371 = string.Concat(strArrays16);
- }
- if ((documento3.get_Controle().get_Cliente().get_Telefones() != null || documento3.get_Controle().get_Cliente().get_Emails() != null) && this.SelectedTipoExtrato != 2)
- {
- str371 = string.Concat(str371, "<tr>");
- if (documento3.get_Controle().get_Cliente().get_Telefones() != null)
- {
- string str378 = "";
- foreach (ClienteTelefone clienteTelefone in documento3.get_Controle().get_Cliente().get_Telefones())
- {
- string[] numero = new string[] { str378, "<br>", null, null, null, null, null, null, null, null };
- nullable = clienteTelefone.get_Tipo();
- if (nullable.HasValue)
- {
- tipoTelefone = nullable.GetValueOrDefault();
- str208 = tipoTelefone.ToString().ToUpper();
- }
- else
- {
- str208 = null;
- }
- numero[2] = str208;
- numero[3] = " (";
- numero[4] = clienteTelefone.get_Prefixo();
- numero[5] = ") ";
- numero[6] = clienteTelefone.get_Numero();
- numero[7] = " (";
- numero[8] = clienteTelefone.get_Observacao();
- numero[9] = ") ";
- str378 = string.Concat(numero);
- }
- string[] strArrays17 = new string[] { str371, "<td bgcolor='", null, null, null, null };
- str209 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays17[2] = str209;
- strArrays17[3] = "' colspan='2'><p align='left'><b>CONTATOS: </b>";
- strArrays17[4] = str378;
- strArrays17[5] = "</p></td>";
- str371 = string.Concat(strArrays17);
- }
- if (documento3.get_Controle().get_Cliente().get_Emails() != null && !this.ExtratoResumido)
- {
- string str379 = "";
- foreach (ClienteEmail clienteEmail in documento3.get_Controle().get_Cliente().get_Emails())
- {
- str379 = string.Concat(str379, "<br>", clienteEmail.get_Email());
- }
- string[] strArrays18 = new string[] { str371, "<td bgcolor='", null, null, null, null };
- str207 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays18[2] = str207;
- strArrays18[3] = "' colspan='2'><p align='left'><b>EMAILS: </b>";
- strArrays18[4] = str379;
- strArrays18[5] = "</p></td>";
- str371 = string.Concat(strArrays18);
- }
- else if (documento3.get_Controle().get_Cliente().get_Enderecos() != null && this.SelectedTipoExtrato != 2)
- {
- string str380 = "";
- foreach (ClienteEndereco clienteEndereco in documento3.get_Controle().get_Cliente().get_Enderecos())
- {
- string[] cidade = new string[] { str380, "<br>", clienteEndereco.get_Endereco(), ", ", clienteEndereco.get_Numero(), ", ", null, null, null, null, null, null, null, null };
- str205 = (string.IsNullOrWhiteSpace(clienteEndereco.get_Complemento()) ? "" : string.Concat(clienteEndereco.get_Complemento(), ", "));
- cidade[6] = str205;
- cidade[7] = clienteEndereco.get_Bairro();
- cidade[8] = " - ";
- cidade[9] = clienteEndereco.get_Cidade();
- cidade[10] = " - ";
- cidade[11] = clienteEndereco.get_Estado();
- cidade[12] = " - ";
- cidade[13] = clienteEndereco.get_Cep();
- str380 = string.Concat(cidade);
- }
- string[] strArrays19 = new string[] { str371, "<td bgcolor='", null, null, null, null };
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str206 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays19[2] = str206;
- strArrays19[3] = "' colspan='6'><p align='left'><b>ENDEREÇOS: </b>";
- strArrays19[4] = str380;
- strArrays19[5] = "</p></td>";
- str371 = string.Concat(strArrays19);
- }
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str371 = string.Concat(str371, "</tr>");
- }
- if (documento3.get_Controle().get_Cliente().get_Enderecos() != null && this.SelectedTipoExtrato != 2 && documento3.get_Controle().get_Cliente().get_Emails() == null && this.ExtratoResumido)
- {
- string str381 = "";
- foreach (ClienteEndereco clienteEndereco1 in documento3.get_Controle().get_Cliente().get_Enderecos())
- {
- string[] estado = new string[] { str381, "<br>", clienteEndereco1.get_Endereco(), ", ", clienteEndereco1.get_Numero(), ", ", null, null, null, null, null, null, null, null };
- str203 = (string.IsNullOrWhiteSpace(clienteEndereco1.get_Complemento()) ? "" : string.Concat(clienteEndereco1.get_Complemento(), ", "));
- estado[6] = str203;
- estado[7] = clienteEndereco1.get_Bairro();
- estado[8] = " - ";
- estado[9] = clienteEndereco1.get_Cidade();
- estado[10] = " - ";
- estado[11] = clienteEndereco1.get_Estado();
- estado[12] = " - ";
- estado[13] = clienteEndereco1.get_Cep();
- str381 = string.Concat(estado);
- }
- string[] strArrays20 = new string[] { str371, "<tr><td bgcolor='", null, null, null, null };
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str204 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays20[2] = str204;
- strArrays20[3] = "' colspan='6'><p align='left'><b>ENDEREÇOS: </b>";
- strArrays20[4] = str381;
- strArrays20[5] = "</p></td></tr>";
- str371 = string.Concat(strArrays20);
- }
- if (documento3.get_Controle().get_Cliente().get_Contatos() != null && this.SelectedTipoExtrato != 2 && !this.ExtratoResumido)
- {
- string str382 = "";
- foreach (MaisContato maisContato in documento3.get_Controle().get_Cliente().get_Contatos())
- {
- string[] strArrays21 = new string[15];
- strArrays21[0] = str382;
- strArrays21[1] = "<br>NOME: ";
- strArrays21[2] = maisContato.get_Nome();
- str185 = (!string.IsNullOrWhiteSpace(maisContato.get_Documento()) ? string.Concat(", DOCUMENTO: ", maisContato.get_Documento()) : "");
- strArrays21[3] = str185;
- clienteDesde = maisContato.get_Nascimento();
- if (clienteDesde.HasValue)
- {
- clienteDesde = maisContato.get_Nascimento();
- if (clienteDesde.HasValue)
- {
- shortDateString9 = clienteDesde.GetValueOrDefault().ToShortDateString();
- }
- else
- {
- shortDateString9 = null;
- }
- str186 = string.Concat(", NASCIMENTO: ", shortDateString9);
- }
- else
- {
- str186 = "";
- }
- strArrays21[4] = str186;
- Parentesco? nullable2 = maisContato.get_Parentesco();
- if (nullable2.HasValue)
- {
- nullable2 = maisContato.get_Parentesco();
- if (nullable2.HasValue)
- {
- str187 = nullable2.GetValueOrDefault().ToString().ToUpper();
- }
- else
- {
- str187 = null;
- }
- str188 = string.Concat(", PARENTESCO: ", str187);
- }
- else
- {
- str188 = "";
- }
- strArrays21[5] = str188;
- str189 = (!string.IsNullOrWhiteSpace(maisContato.get_Banco()) || !string.IsNullOrWhiteSpace(maisContato.get_Agencia()) || !string.IsNullOrWhiteSpace(maisContato.get_Conta()) ? "<br>" : "");
- strArrays21[6] = str189;
- str190 = (!string.IsNullOrWhiteSpace(maisContato.get_Banco()) ? string.Concat("BANCO: ", maisContato.get_Banco()) : "");
- strArrays21[7] = str190;
- if (!string.IsNullOrWhiteSpace(maisContato.get_Agencia()))
- {
- str191 = (!string.IsNullOrWhiteSpace(maisContato.get_Banco()) ? ", AGÊNCIA: " : "AGÊNCIA: ");
- str192 = string.Concat(str191, maisContato.get_Agencia());
- }
- else
- {
- str192 = "";
- }
- strArrays21[8] = str192;
- if (!string.IsNullOrWhiteSpace(maisContato.get_Conta()))
- {
- str193 = (!string.IsNullOrWhiteSpace(maisContato.get_Banco()) || !string.IsNullOrWhiteSpace(maisContato.get_Agencia()) ? ", CONTA: " : "CONTA: ");
- str194 = string.Concat(str193, maisContato.get_Conta());
- }
- else
- {
- str194 = "";
- }
- strArrays21[9] = str194;
- nullable = maisContato.get_Tipo();
- str195 = (nullable.HasValue || !string.IsNullOrWhiteSpace(maisContato.get_Prefixo()) && !string.IsNullOrWhiteSpace(maisContato.get_Telefone()) || !string.IsNullOrWhiteSpace(maisContato.get_Email()) ? "<br>" : "");
- strArrays21[10] = str195;
- nullable = maisContato.get_Tipo();
- if (nullable.HasValue)
- {
- nullable = maisContato.get_Tipo();
- if (nullable.HasValue)
- {
- tipoTelefone = nullable.GetValueOrDefault();
- str196 = tipoTelefone.ToString().ToUpper();
- }
- else
- {
- str196 = null;
- }
- str197 = string.Concat("TIPO DO TELEFONE: ", str196);
- }
- else
- {
- str197 = "";
- }
- strArrays21[11] = str197;
- if (string.IsNullOrWhiteSpace(maisContato.get_Prefixo()) || string.IsNullOrWhiteSpace(maisContato.get_Telefone()))
- {
- str198 = "";
- }
- else
- {
- nullable = maisContato.get_Tipo();
- str201 = (nullable.HasValue ? ", TELEFONE: (" : "TELEFONE: (");
- str198 = string.Concat(str201, maisContato.get_Prefixo(), ") ", maisContato.get_Telefone());
- }
- strArrays21[12] = str198;
- if (!string.IsNullOrWhiteSpace(maisContato.get_Email()))
- {
- nullable = maisContato.get_Tipo();
- str199 = (nullable.HasValue || !string.IsNullOrWhiteSpace(maisContato.get_Prefixo()) && !string.IsNullOrWhiteSpace(maisContato.get_Telefone()) ? ", EMAIL: " : "EMAIL: ");
- str200 = string.Concat(str199, maisContato.get_Email());
- }
- else
- {
- str200 = "";
- }
- strArrays21[13] = str200;
- strArrays21[14] = "<br>";
- str382 = string.Concat(strArrays21);
- }
- string[] strArrays22 = new string[] { str371, "<tr><td bgcolor='", null, null, null, null };
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str202 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays22[2] = str202;
- strArrays22[3] = "' colspan='6'><p align='left'><b>MAIS CONTATOS: </b>";
- strArrays22[4] = str382;
- strArrays22[5] = "</p></td></tr>";
- str371 = string.Concat(strArrays22);
- }
- if (documento3.get_Controle().get_Cliente().get_Enderecos() != null && !this.ExtratoResumido)
- {
- string str383 = "";
- foreach (ClienteEndereco clienteEndereco2 in documento3.get_Controle().get_Cliente().get_Enderecos())
- {
- string[] cep = new string[] { str383, "<br>", clienteEndereco2.get_Endereco(), ", ", clienteEndereco2.get_Numero(), ", ", null, null, null, null, null, null, null, null };
- str183 = (string.IsNullOrWhiteSpace(clienteEndereco2.get_Complemento()) ? "" : string.Concat(clienteEndereco2.get_Complemento(), ", "));
- cep[6] = str183;
- cep[7] = clienteEndereco2.get_Bairro();
- cep[8] = " - ";
- cep[9] = clienteEndereco2.get_Cidade();
- cep[10] = " - ";
- cep[11] = clienteEndereco2.get_Estado();
- cep[12] = " - ";
- cep[13] = clienteEndereco2.get_Cep();
- str383 = string.Concat(cep);
- }
- string[] strArrays23 = new string[] { str371, "<td bgcolor='", null, null, null, null };
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str184 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays23[2] = str184;
- strArrays23[3] = "' colspan='6'><p align='left'><b>ENDEREÇOS: </b>";
- strArrays23[4] = str383;
- strArrays23[5] = "</p></td>";
- str371 = string.Concat(strArrays23);
- }
- if (this.ObsCliente && this.ClienteVisibility && this.ObsClienteEnabled && !string.IsNullOrWhiteSpace(documento3.get_Controle().get_Cliente().get_Observacao()) && this.SelectedTipoExtrato != 2 && !this.ExtratoResumido)
- {
- documento3.get_Controle().get_Cliente().set_Observacao(string.Concat("<br>", documento3.get_Controle().get_Cliente().get_Observacao().Replace("\r\n", "<br>")));
- string[] strArrays24 = new string[] { str371, "<tr><td bgcolor='", null, null, null, null };
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str182 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays24[2] = str182;
- strArrays24[3] = "' colspan='6'><p align='left' x-ms-format-detection='none'><b>OBSERVAÇÕES: </b>";
- strArrays24[4] = documento3.get_Controle().get_Cliente().get_Observacao();
- strArrays24[5] = "</p></td></tr>";
- str371 = string.Concat(strArrays24);
- }
- if (!string.IsNullOrWhiteSpace(documento3.get_Controle().get_Cliente().get_Pasta()) && this.SelectedTipoExtrato != 2 && !this.ExtratoResumido)
- {
- string[] strArrays25 = new string[] { str371, "<tr><td bgcolor='", null, null, null, null };
- str181 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays25[2] = str181;
- strArrays25[3] = "' colspan='6'><p align='left' x-ms-format-detection='none'><b>PASTA: </b>";
- strArrays25[4] = documento3.get_Controle().get_Cliente().get_Pasta();
- strArrays25[5] = "</p></td></tr>";
- str371 = string.Concat(strArrays25);
- }
- str371 = string.Concat(str371, "</font></table>");
- if (!flag1)
- {
- string str384 = str371;
- str180 = (this.ClientePorPaginaVisibility != Visibility.Visible || !this.ClientePorPagina || !this.ClientePorPaginaEnabled ? "" : "</div>");
- str371 = string.Concat(str384, str180);
- }
- }
- else
- {
- string[] documento5 = new string[14];
- documento5[0] = str371;
- documento5[1] = "<table border='1' bordercolor='#ededed' width='999'><font face='Verdana' style='font-size: 12pt; position: absolute; top: 50 %; -moz-transform: translateY(-50 %); -webkit-transform: translateY(-50 %); transform: translateY(-50 %)'><tr><td width='333' bgcolor='";
- str42 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- documento5[2] = str42;
- documento5[3] = "'><p align='left'><b>CLIENTE: </b>";
- documento5[4] = documento3.get_Controle().get_Cliente().get_Nome();
- documento5[5] = "</p></td><td bgcolor='";
- str43 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- documento5[6] = str43;
- documento5[7] = "'><p align='left' x-ms-format-detection='none'><b>RG: </b>";
- str44 = (!string.IsNullOrWhiteSpace(documento3.get_Controle().get_Cliente().get_Identidade()) ? documento3.get_Controle().get_Cliente().get_Identidade() : "-");
- documento5[8] = str44;
- documento5[9] = "</p></td><td width='222' bgcolor='";
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str45 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- documento5[10] = str45;
- documento5[11] = "' colspan='2'><p align='left' x-ms-format-detection='none'><b>CPF/CNPJ: </b>";
- documento5[12] = documento3.get_Controle().get_Cliente().get_Documento();
- documento5[13] = "</p></td></tr></font></table>";
- str371 = string.Concat(documento5);
- }
- if (this.SelectedTipoExtrato != null)
- {
- num10 = 0;
- string[] shortDateString18 = new string[58];
- shortDateString18[0] = str371;
- shortDateString18[1] = "<hr style='width:999; border-top: 3px solid #000'><table border='1' bordercolor='#ededed' width='999'><font face='Verdana' style='font-size: 12pt; position: absolute; top: 50 %; -moz-transform: translateY(-50 %); -webkit-transform: translateY(-50 %); transform: translateY(-50 %)'><tr><td bgcolor='";
- str46 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- shortDateString18[2] = str46;
- shortDateString18[3] = "'><p align='left'><b>RAMO: </b>";
- shortDateString18[4] = documento3.get_Controle().get_Ramo().get_Nome();
- shortDateString18[5] = "</p></td><td bgcolor='";
- str47 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- shortDateString18[6] = str47;
- shortDateString18[7] = "'><p align='left' x-ms-format-detection='none'><b>VIGÊNCIA INICIAL: </b>";
- date = documento3.get_Vigencia1();
- shortDateString18[8] = date.ToShortDateString();
- shortDateString18[9] = "</p></td><td bgcolor='";
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str48 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- shortDateString18[10] = str48;
- shortDateString18[11] = "'><p align='left'><b>VIGÊNCIA FINAL: </b>";
- clienteDesde = documento3.get_Vigencia2();
- if (!clienteDesde.HasValue)
- {
- shortDateString3 = "-";
- }
- else
- {
- clienteDesde = documento3.get_Vigencia2();
- if (clienteDesde.HasValue)
- {
- shortDateString3 = clienteDesde.GetValueOrDefault().ToShortDateString();
- }
- else
- {
- shortDateString3 = null;
- }
- }
- shortDateString18[12] = shortDateString3;
- shortDateString18[13] = "</p></td></tr><tr><td bgcolor='";
- str49 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- shortDateString18[14] = str49;
- shortDateString18[15] = "' colspan='2'><p align='left'><b>CONTRATO: </b>";
- str50 = (string.IsNullOrWhiteSpace(documento3.get_Apolice()) ? "-" : documento3.get_Apolice());
- shortDateString18[16] = str50;
- shortDateString18[17] = "</p></td><td bgcolor='";
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str51 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- shortDateString18[18] = str51;
- shortDateString18[19] = "'><p align='left'><b>POSSUI ENDOSSO? </b>";
- str52 = (documento3.get_TemEndosso() ? "SIM" : "NÃO");
- shortDateString18[20] = str52;
- shortDateString18[21] = "</p></td></tr><tr><td bgcolor='";
- str53 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- shortDateString18[22] = str53;
- shortDateString18[23] = "' colspan='2'><p align='left' x-ms-format-detection='none'><b>ADITAMENTO: </b>";
- if (string.IsNullOrWhiteSpace(documento3.get_Endosso()))
- {
- if (flag)
- {
- IList<Documento> documentos = documento3.get_Controle().get_Documentos();
- if (documentos.Where<Documento>((Documento x) => {
- if (x.get_Excluido())
- {
- return false;
- }
- return x.get_Ordem() != 0;
- }).ToList<Documento>().Count <= 0)
- {
- goto Label2;
- }
- IList<Documento> documentos1 = documento3.get_Controle().get_Documentos();
- endosso = documentos1.Last<Documento>((Documento x) => {
- if (x.get_Excluido())
- {
- return false;
- }
- return x.get_Ordem() != 0;
- }).get_Endosso();
- goto Label1;
- }
- Label2:
- endosso = "-";
- }
- else
- {
- endosso = documento3.get_Endosso();
- }
- Label1:
- shortDateString18[24] = endosso;
- shortDateString18[25] = "</p></td><td bgcolor='";
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str54 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- shortDateString18[26] = str54;
- shortDateString18[27] = "'><p align='left'><b>APÓLICE ANTERIOR: </b>";
- str55 = (string.IsNullOrWhiteSpace(documento3.get_ApoliceAnterior()) ? "-" : documento3.get_ApoliceAnterior());
- shortDateString18[28] = str55;
- shortDateString18[29] = "</p></td></tr><tr><td bgcolor='";
- str56 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- shortDateString18[30] = str56;
- shortDateString18[31] = "'><p align='left'><b>BANCO: </b>";
- str57 = (documento3.get_Banco() == null ? "-" : documento3.get_Banco().get_Nome());
- shortDateString18[32] = str57;
- shortDateString18[33] = "</p></td><td bgcolor='";
- str58 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- shortDateString18[34] = str58;
- shortDateString18[35] = "'><p align='left' x-ms-format-detection='none'><b>AGÊNCIA: </b>";
- str59 = (string.IsNullOrWhiteSpace(documento3.get_Agencia()) ? "-" : documento3.get_Agencia());
- shortDateString18[36] = str59;
- shortDateString18[37] = "</p></td><td bgcolor='";
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str60 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- shortDateString18[38] = str60;
- shortDateString18[39] = "'><p align='left'><b>CONTA: </b>";
- str61 = (string.IsNullOrWhiteSpace(documento3.get_Conta()) ? "-" : documento3.get_Conta());
- shortDateString18[40] = str61;
- shortDateString18[41] = "</p></td></tr><td bgcolor='";
- str62 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- shortDateString18[42] = str62;
- shortDateString18[43] = "'><p align='left' x-ms-format-detection='none'><b>NUMERO CARTÃO: </b>";
- str63 = (string.IsNullOrWhiteSpace(documento3.get_NumeroCartao()) ? "-" : documento3.get_NumeroCartao());
- shortDateString18[44] = str63;
- shortDateString18[45] = "</p></td><td bgcolor='";
- str64 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- shortDateString18[46] = str64;
- shortDateString18[47] = "'><p align='left'><b>VENCIMENTO: </b>";
- str65 = (string.IsNullOrWhiteSpace(documento3.get_VencimentoCartao()) ? "-" : documento3.get_VencimentoCartao());
- shortDateString18[48] = str65;
- shortDateString18[49] = "</p></td><td bgcolor='";
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str66 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- shortDateString18[50] = str66;
- shortDateString18[51] = "'><p align='left'><b>BANDEIRA: </b>";
- str67 = (!documento3.get_Bandeira().HasValue ? "-" : ValidationHelper.GetDescription(documento3.get_Bandeira()));
- shortDateString18[52] = str67;
- shortDateString18[53] = "</p></td></tr><td bgcolor='";
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str68 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- shortDateString18[54] = str68;
- shortDateString18[55] = "' colspan='3'><p align='left' x-ms-format-detection='none'><b>TITULAR/PROPONENTE: </b>";
- str69 = (string.IsNullOrWhiteSpace(documento3.get_NomeProponente()) ? "-" : documento3.get_NomeProponente());
- shortDateString18[56] = str69;
- shortDateString18[57] = "</p></td></tr>";
- str371 = string.Concat(shortDateString18);
- if (!documento3.get_NegocioCorretora().HasValue)
- {
- Documento documento6 = documento3;
- negocioCorretora = (documento3.get_Situacao() != 2 || !documento3.get_Negocio().HasValue || documento3.get_Negocio().GetValueOrDefault() != 1 ? 0 : 1);
- documento6.set_NegocioCorretora(new NegocioCorretora?(negocioCorretora));
- }
- if (this.ComissaoDocumento && this.ComissaoDocumentoEnabled)
- {
- if (this.SelectedTipoExtrato == 2)
- {
- string[] strArrays26 = new string[] { str371, "<td bgcolor='", null, null, null, null };
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str172 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays26[2] = str172;
- strArrays26[3] = "' colspan='3'><p align='left'><b>COMISSÃO: </b>";
- strArrays26[4] = string.Format("{0}%", documento3.get_Comissao());
- strArrays26[5] = "</p></td>";
- str371 = string.Concat(strArrays26);
- }
- else
- {
- string[] description5 = new string[14];
- description5[0] = str371;
- description5[1] = "<td bgcolor='";
- str173 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- description5[2] = str173;
- description5[3] = "'><p align='left'><b>NEGÓCIO CORRETORA: </b>";
- description5[4] = ValidationHelper.GetDescription(documento3.get_NegocioCorretora());
- description5[5] = "</p></td><td bgcolor='";
- str174 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- description5[6] = str174;
- description5[7] = "'><p align='left'><b>STATUS DO SEGURO: </b>";
- description5[8] = ValidationHelper.GetDescription(documento3.get_Situacao());
- description5[9] = "</p></td><td bgcolor='";
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str175 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- description5[10] = str175;
- description5[11] = "'><p align='left'><b>COMISSÃO: </b>";
- description5[12] = string.Format("{0}%", documento3.get_Comissao());
- description5[13] = "</p></td>";
- str371 = string.Concat(description5);
- }
- }
- else if (this.SelectedTipoExtrato != 2)
- {
- string[] description6 = new string[] { str371, "<td bgcolor='", null, null, null, null, null, null, null, null };
- str170 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- description6[2] = str170;
- description6[3] = "'><p align='left'><b>NEGÓCIO CORRETORA: </b>";
- description6[4] = ValidationHelper.GetDescription(documento3.get_NegocioCorretora());
- description6[5] = "</p></td><td bgcolor='";
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str171 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- description6[6] = str171;
- description6[7] = "' colspan='2'><p align='left'><b>STATUS DO SEGURO: </b>";
- description6[8] = ValidationHelper.GetDescription(documento3.get_Situacao());
- description6[9] = "</p></td>";
- str371 = string.Concat(description6);
- }
- string[] strArrays27 = new string[14];
- strArrays27[0] = str371;
- strArrays27[1] = "</tr><tr><td bgcolor='";
- str70 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays27[2] = str70;
- strArrays27[3] = "'><p align='left'><b>VENDEDOR: </b>";
- str71 = (documento3.get_VendedorPrincipal() == null ? "-" : documento3.get_VendedorPrincipal().get_Nome());
- strArrays27[4] = str71;
- strArrays27[5] = "</p></td><td bgcolor='";
- str72 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays27[6] = str72;
- strArrays27[7] = "'><p align='left'><b>REMESSA: </b>";
- clienteDesde = documento3.get_Remessa();
- if (!clienteDesde.HasValue)
- {
- shortDateString4 = "-";
- }
- else
- {
- clienteDesde = documento3.get_Remessa();
- if (clienteDesde.HasValue)
- {
- shortDateString4 = clienteDesde.GetValueOrDefault().ToShortDateString();
- }
- else
- {
- shortDateString4 = null;
- }
- }
- strArrays27[8] = shortDateString4;
- strArrays27[9] = "</p></td><td bgcolor='";
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str73 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays27[10] = str73;
- strArrays27[11] = "'><p align='left'><b>EMISSÃO: </b>";
- clienteDesde = documento3.get_Emissao();
- if (!clienteDesde.HasValue)
- {
- shortDateString5 = "-";
- }
- else
- {
- clienteDesde = documento3.get_Emissao();
- if (clienteDesde.HasValue)
- {
- shortDateString5 = clienteDesde.GetValueOrDefault().ToShortDateString();
- }
- else
- {
- shortDateString5 = null;
- }
- }
- strArrays27[12] = shortDateString5;
- strArrays27[13] = "</p></td></tr>";
- str371 = string.Concat(strArrays27);
- if (this.SelectedTipoExtrato != 2 && !this.ExtratoResumido)
- {
- str371 = string.Concat(str371, "<tr>");
- string str385 = "";
- if (documento3.get_Estipulante1() != null)
- {
- str385 = string.Concat(str385, documento3.get_Estipulante1().get_Nome(), ", ");
- }
- if (documento3.get_Estipulante2() != null)
- {
- str385 = string.Concat(str385, documento3.get_Estipulante2().get_Nome(), ", ");
- }
- if (documento3.get_Estipulante3() != null)
- {
- str385 = string.Concat(str385, documento3.get_Estipulante3().get_Nome(), ", ");
- }
- if (documento3.get_Estipulante4() != null)
- {
- str385 = string.Concat(str385, documento3.get_Estipulante4().get_Nome(), ", ");
- }
- if (documento3.get_Estipulante5() != null)
- {
- str385 = string.Concat(str385, documento3.get_Estipulante5().get_Nome(), ", ");
- }
- if (!string.IsNullOrWhiteSpace(str385))
- {
- int num13 = str385.LastIndexOf(", ", StringComparison.Ordinal);
- str385 = str385.Remove(num13, 2).Insert(num13, ".");
- }
- string[] strArrays28 = new string[] { str371, "<td bgcolor='", null, null, null, null };
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str168 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays28[2] = str168;
- strArrays28[3] = "' colspan='3'><p align='left'><b>ESTIPULANTE(S): </b>";
- str169 = (string.IsNullOrWhiteSpace(str385) ? "-" : str385);
- strArrays28[4] = str169;
- strArrays28[5] = "</p></td></tr>";
- str371 = string.Concat(strArrays28);
- }
- if (this.SelectedTipoExtrato == 2)
- {
- string[] strArrays29 = new string[] { str371, "<tr><td bgcolor='", null, null, null, null };
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str74 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays29[2] = str74;
- strArrays29[3] = "' colspan='3'><p align='left'><b>SEGURADORA: </b>";
- strArrays29[4] = documento3.get_Controle().get_Seguradora().get_Nome();
- strArrays29[5] = "</p></td></tr>";
- str371 = string.Concat(strArrays29);
- }
- else
- {
- string[] strArrays30 = new string[] { str371, "<tr><td bgcolor='", null, null, null, null, null, null, null, null };
- str164 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays30[2] = str164;
- strArrays30[3] = "' colspan='2'><p align='left'><b>SEGURADORA: </b>";
- strArrays30[4] = documento3.get_Controle().get_Seguradora().get_Nome();
- strArrays30[5] = "</p></td><td bgcolor='";
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str165 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays30[6] = str165;
- strArrays30[7] = "'><p align='left'><b>APÓLICE SINISTRADA: </b>";
- str166 = (documento3.get_Sinistro() ? "SIM" : "NÃO");
- strArrays30[8] = str166;
- strArrays30[9] = "</p></td></tr>";
- str371 = string.Concat(strArrays30);
- if (documento3.get_Controle().get_SeguradoraAnterior() != null && !this.ExtratoResumido)
- {
- string[] strArrays31 = new string[] { str371, "<tr><td bgcolor='", null, null, null, null };
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str167 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays31[2] = str167;
- strArrays31[3] = "' colspan='3'><p align='left'><b>SEGURADORA ANTERIOR: </b>";
- strArrays31[4] = documento3.get_Controle().get_SeguradoraAnterior().get_Nome();
- strArrays31[5] = "</p></td></tr>";
- str371 = string.Concat(strArrays31);
- }
- }
- str371 = string.Concat(str371, "</font></table>");
- if (!this.ExtratoResumido && (this.PremioParcela || this.ObsApoliceEnabled))
- {
- str371 = string.Concat(str371, "<table border='1' bordercolor='#ededed' width='999'><font face='Verdana' style='font-size: 12pt; position: absolute; top: 50 %; -moz-transform: translateY(-50 %); -webkit-transform: translateY(-50 %); transform: translateY(-50 %)'>");
- if (this.PremioParcela)
- {
- string[] strArrays32 = new string[24];
- strArrays32[0] = str371;
- strArrays32[1] = "<tr><td bgcolor='";
- str158 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays32[2] = str158;
- strArrays32[3] = "'><p align='left'><b>PRÊMIO LÍQUIDO: </b><br/>";
- premioLiquido = documento3.get_PremioLiquido();
- strArrays32[4] = premioLiquido.ToString("c");
- strArrays32[5] = "</p></td><td bgcolor='";
- str159 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays32[6] = str159;
- strArrays32[7] = "'><p align='left'><b>ADICIONAL: </b><br/>";
- premioLiquido = documento3.get_PremioAdicional();
- strArrays32[8] = premioLiquido.ToString("c");
- strArrays32[9] = "</p></td><td bgcolor='";
- str160 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays32[10] = str160;
- strArrays32[11] = "'><p align='left'><b>CUSTO APÓLICE: </b><br/>";
- premioLiquido = documento3.get_Custo();
- strArrays32[12] = premioLiquido.ToString("c");
- strArrays32[13] = "</p></td><td bgcolor='";
- str161 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays32[14] = str161;
- strArrays32[15] = "'><p align='left'><b>I.O.F.: </b><br/>";
- premioLiquido = documento3.get_Iof();
- strArrays32[16] = premioLiquido.ToString("c");
- strArrays32[17] = "</p></td><td bgcolor='";
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str162 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays32[18] = str162;
- strArrays32[19] = "'";
- str163 = (!this.ComissaoDocumento || !this.ComissaoDocumentoEnabled ? " colspan='2'" : "");
- strArrays32[20] = str163;
- strArrays32[21] = "><p align='left'><b>PRÊMIO TOTAL: </b><br/>";
- premioLiquido = documento3.get_PremioTotal();
- strArrays32[22] = premioLiquido.ToString("c");
- strArrays32[23] = "</p></td>";
- str371 = string.Concat(strArrays32);
- str371 = string.Concat(str371, "</tr>");
- str371 = string.Concat(str371, "</font></table><br>");
- ObservableCollection<Parcela> parcelas = documento3.get_Parcelas();
- if (parcelas != null)
- {
- count = parcelas.Count > 0;
- }
- else
- {
- count = false;
- }
- if (count)
- {
- str371 = string.Concat(str371, "<table border='1' bordercolor='#ededed' width='999'><font face='Verdana' style='font-size: 12pt; position: absolute; top: 50 %; -moz-transform: translateY(-50 %); -webkit-transform: translateY(-50 %); transform: translateY(-50 %)'><tr><td bgcolor='WhiteSmoke'><p align='left'><b><div align='center'>PARCELA</div></b></p></td><td bgcolor='WhiteSmoke'><p align='left'><b><div align='center'>VENCIMENTO</div></b></p></td><td bgcolor='WhiteSmoke'><p align='left'><b><div align='center'>VALOR</div></b></p></td><td bgcolor='WhiteSmoke'><p align='left'><b><div align='center'>FORMA DE PAGAMENTO</div></b></p></td></tr>");
- foreach (Parcela parcela in documento3.get_Parcelas())
- {
- string[] description7 = new string[] { str371, "<tr><td bgcolor='White'><p align='left'><div align='center'>", null, null, null, null, null, null, null, null };
- numeroParcela = parcela.get_NumeroParcela();
- description7[2] = numeroParcela.ToString();
- description7[3] = "</div></p></td><td bgcolor='White'><p align='left'><div align='center'>";
- date = parcela.get_Vencimento();
- description7[4] = date.ToShortDateString();
- description7[5] = "</div></p></td><td bgcolor='White'><p align='left'><div align='center'>";
- description7[6] = string.Format("{0:c}", parcela.get_Valor());
- description7[7] = "</div></p></td><td bgcolor='White'><p align='left'><div align='center'>";
- description7[8] = ValidationHelper.GetDescription(documento3.get_FormaPagamento());
- description7[9] = "</div></p></td></tr>";
- str371 = string.Concat(description7);
- }
- }
- }
- if (this.ObsApolice && this.ObsApoliceEnabled)
- {
- string[] strArrays33 = new string[] { str371, "<tr><td bgcolor='", null, null, null, null };
- str156 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays33[2] = str156;
- strArrays33[3] = "' colspan='6'><p align='left' x-ms-format-detection='none'><b>OBSERVAÇÕES: </b>";
- str157 = (string.IsNullOrWhiteSpace(documento3.get_Observacao()) ? "-" : documento3.get_Observacao());
- strArrays33[4] = str157;
- strArrays33[5] = "</p></td></tr>";
- str371 = string.Concat(strArrays33);
- }
- str371 = string.Concat(str371, "</font></table>");
- }
- if (this.PerfilCondutor && this.PerfilVisibility && documento3.get_Controle().get_Ramo().get_Id() == (long)5 && this.PerfilCondutorEnabled)
- {
- List<Perfil> list1 = perfils.ToList<Perfil>();
- foreach (Perfil perfil in list1)
- {
- num10 = 0;
- if (string.IsNullOrEmpty(perfil.get_Nome()))
- {
- continue;
- }
- string[] description8 = new string[92];
- description8[0] = str371;
- description8[1] = "<hr style='width:999; border-top: 2px solid #ccc'><table border='1' bordercolor='#ededed' width='999'><font face='Verdana' style='font-size: 12pt; position: absolute; top: 50 %; -moz-transform: translateY(-50 %); -webkit-transform: translateY(-50 %); transform: translateY(-50 %)'><tr><td width='333' bgcolor='";
- str115 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- description8[2] = str115;
- description8[3] = "'><p align='left'><b>";
- description8[4] = string.Format("CONDUTOR {0}: ", list1.IndexOf(perfil) + 1);
- description8[5] = "</b>";
- description8[6] = perfil.get_Nome();
- description8[7] = "</p></td><td width='222' bgcolor='";
- str116 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- description8[8] = str116;
- description8[9] = "'><p align='left' x-ms-format-detection='none'><b>CPF: </b>";
- str117 = (string.IsNullOrWhiteSpace(perfil.get_Cpf()) ? "-" : perfil.get_Cpf());
- description8[10] = str117;
- description8[11] = "</p></td><td width='222' bgcolor='";
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str118 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- description8[12] = str118;
- description8[13] = "'><p align='left'><b>NASCIMENTO: </b>";
- clienteDesde = perfil.get_Nascimento();
- if (!clienteDesde.HasValue)
- {
- shortDateString7 = "-";
- }
- else
- {
- clienteDesde = perfil.get_Nascimento();
- if (clienteDesde.HasValue)
- {
- shortDateString7 = clienteDesde.GetValueOrDefault().ToShortDateString();
- }
- else
- {
- shortDateString7 = null;
- }
- }
- description8[14] = shortDateString7;
- description8[15] = "</p></td></tr><tr><td width='333' bgcolor='";
- str119 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- description8[16] = str119;
- description8[17] = "'><p align='left'><b>ESTADO CIVIL: </b>";
- str120 = (!perfil.get_EstadoCivil().HasValue ? "-" : ValidationHelper.GetDescription(perfil.get_EstadoCivil()));
- description8[18] = str120;
- description8[19] = "</p></td><td width='222' bgcolor='";
- str121 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- description8[20] = str121;
- description8[21] = "'><p align='left'><b>SEXO: </b>";
- str122 = (!perfil.get_Sexo().HasValue ? "-" : ValidationHelper.GetDescription(perfil.get_Sexo()));
- description8[22] = str122;
- description8[23] = "</p></td><td width='222' bgcolor='";
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str123 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- description8[24] = str123;
- description8[25] = "'><p align='left'><b>RELAÇÃO SEGURADO/CONDUTOR: </b>";
- description8[26] = ValidationHelper.GetDescription(perfil.get_Relacao());
- description8[27] = "</p></td></tr><tr><td width='333' bgcolor='";
- str124 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- description8[28] = str124;
- description8[29] = "'><p align='left'><b>HABILITAÇÃO: </b>";
- str125 = (string.IsNullOrWhiteSpace(perfil.get_Habilitacao()) ? "-" : perfil.get_Habilitacao());
- description8[30] = str125;
- description8[31] = "</p></td><td width='222' bgcolor='";
- str126 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- description8[32] = str126;
- description8[33] = "'><p align='left'><b>TEMPO DE HABILITAÇÃO: </b>";
- str127 = (!perfil.get_TempoHabilitacao().HasValue ? "-" : ValidationHelper.GetDescription(perfil.get_TempoHabilitacao()));
- description8[34] = str127;
- description8[35] = "</p></td><td width='222' bgcolor='";
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str128 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- description8[36] = str128;
- description8[37] = "'><p align='left'><b>QUATIDADE DE VEÍCULOS: </b>";
- if (!perfil.get_VeiculoResidencia().HasValue)
- {
- str129 = "-";
- }
- else
- {
- numeroParcela = perfil.get_VeiculoResidencia().Value;
- str129 = numeroParcela.ToString();
- }
- description8[38] = str129;
- description8[39] = "</p></td></tr><tr><td width='333' bgcolor='";
- str130 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- description8[40] = str130;
- description8[41] = "'><p align='left'><b>GARAGEM NA RESIDÊNCIA: </b>";
- str131 = (!perfil.get_GaragemResidencia().HasValue ? "-" : ValidationHelper.GetDescription(perfil.get_GaragemResidencia()));
- description8[42] = str131;
- description8[43] = "</p></td><td width='222' bgcolor='";
- str132 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- description8[44] = str132;
- description8[45] = "'><p align='left'><b>GARAGEM NO TRABALHO: </b>";
- str133 = (!perfil.get_GaragemTrabalho().HasValue ? "-" : ValidationHelper.GetDescription(perfil.get_GaragemTrabalho()));
- description8[46] = str133;
- description8[47] = "</p></td><td width='222' bgcolor='";
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str134 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- description8[48] = str134;
- description8[49] = "'><p align='left'><b>GARAGEM NO ESTUDO: </b>";
- str135 = (!perfil.get_GaragemEstudo().HasValue ? "-" : ValidationHelper.GetDescription(perfil.get_GaragemEstudo()));
- description8[50] = str135;
- description8[51] = "</p></td></tr><tr><td width='333' bgcolor='";
- str136 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- description8[52] = str136;
- description8[53] = "'><p align='left'><b>TIPO DE RESIDÊNCIA: </b>";
- str137 = (!perfil.get_TipoResidencia().HasValue ? "-" : ValidationHelper.GetDescription(perfil.get_TipoResidencia()));
- description8[54] = str137;
- description8[55] = "</p></td><td width='222' bgcolor='";
- str138 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- description8[56] = str138;
- description8[57] = "'><p align='left'><b>QUILOMETRAGEM MENSAL: </b>";
- str139 = (string.IsNullOrWhiteSpace(perfil.get_KmMensal()) ? "-" : perfil.get_KmMensal());
- description8[58] = str139;
- description8[59] = "</p></td><td width='222' bgcolor='";
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str140 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- description8[60] = str140;
- description8[61] = "'><p align='left'><b>DISTÂNCIA ATÉ O TRABALHO: </b>";
- str141 = (!perfil.get_DistanciaResidenciaTrabalho().HasValue ? "-" : ValidationHelper.GetDescription(perfil.get_DistanciaResidenciaTrabalho()));
- description8[62] = str141;
- description8[63] = "</p></td></tr><tr><td width='333' bgcolor='";
- str142 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- description8[64] = str142;
- description8[65] = "'><p align='left'><b>USO PROFISSIONAL: </b>";
- str143 = (!perfil.get_UsoProfissional().HasValue || !perfil.get_UsoProfissional().Value ? "NÃO" : "SIM");
- description8[66] = str143;
- description8[67] = "</p></td><td width='222' bgcolor='";
- str144 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- description8[68] = str144;
- description8[69] = "'><p align='left'><b>USO POR DEPENDENTES: </b>";
- str145 = (!perfil.get_UsoDependentes().HasValue ? "-" : ValidationHelper.GetDescription(perfil.get_UsoDependentes()));
- description8[70] = str145;
- description8[71] = "</p></td><td width='222' bgcolor='";
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str146 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- description8[72] = str146;
- description8[73] = "'><p align='left'><b>OCUPAÇÃO: </b>";
- str147 = (!perfil.get_Ocupacao().HasValue ? "-" : ValidationHelper.GetDescription(perfil.get_Ocupacao()));
- description8[74] = str147;
- description8[75] = "</p></td></tr><tr><td width='333' bgcolor='";
- str148 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- description8[76] = str148;
- description8[77] = "'><p align='left'><b>SEGURO VIDA: </b>";
- str149 = (!perfil.get_SeguroVida().HasValue || !perfil.get_SeguroVida().Value ? "NÃO" : "SIM");
- description8[78] = str149;
- description8[79] = "</p></td><td width='222' bgcolor='";
- str150 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- description8[80] = str150;
- description8[81] = "'><p align='left'><b>ISENÇÃO DE IMPOSTOS: </b>";
- str151 = (!perfil.get_Isencao().HasValue || !perfil.get_Isencao().Value ? "NÃO" : "SIM");
- description8[82] = str151;
- description8[83] = "</p></td><td width='222' bgcolor='";
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str152 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- description8[84] = str152;
- description8[85] = "'><p align='left'><b>ANTIFURTO: </b>";
- str153 = (perfil.get_AntiFurto().HasValue ? ValidationHelper.GetDescription(perfil.get_AntiFurto()) : "");
- description8[86] = str153;
- description8[87] = "</p></td></tr><tr><td bgcolor='";
- str154 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- description8[88] = str154;
- description8[89] = "' colspan='3'><p align='left'><b>COBERTURA ESTENDIDA PARA RESIDENTES HABILITADOS: </b>";
- str155 = (!perfil.get_EstenderCobertura().HasValue || !perfil.get_EstenderCobertura().Value ? "NÃO" : "SIM");
- description8[90] = str155;
- description8[91] = "</p></td></tr></font></table>";
- str371 = string.Concat(description8);
- }
- }
- list = items1.ToList<Item>();
- if (list.Count != 0)
- {
- num10 = 0;
- foreach (Item item in list)
- {
- if (item.get_Sinistros().Count > 0)
- {
- item1 = item;
- controleSinistros = await (new SinistroServico()).BuscarControles(item.get_Id());
- item1.set_Sinistros(controleSinistros);
- item1 = null;
- }
- string str386 = str371;
- str75 = (!this.SepararPagina || !this.SepararPaginaEnabled ? "" : "<div style='page-break-before:always;'>");
- str371 = string.Concat(str386, str75);
- string str387 = str371;
- str76 = (this.SelectedTipoExtrato != 2 || list.IndexOf(item) == 0 ? "<br>" : "");
- str371 = string.Concat(str387, str76);
- str371 = string.Concat(str371, "<table border='1' bordercolor='#ededed' width='999'>");
- str371 = string.Concat(str371, "<style> td > p { margin: 2px; }</style>");
- str371 = string.Concat(str371, "<font face='Verdana' style='font-size: 12pt; position: absolute; top: 50 %; -moz-transform: translateY(-50 %); -webkit-transform: translateY(-50 %); transform: translateY(-50 %)'><tr>");
- if (this.SelectedTipoExtrato != 2)
- {
- id = documento3.get_Controle().get_Ramo().get_Id();
- if (id > (long)5)
- {
- if (id == (long)15 || id == (long)18)
- {
- goto Label5;
- }
- if (id == (long)37)
- {
- goto Label3;
- }
- goto Label4;
- }
- else
- {
- if (id - (long)1 <= (long)2)
- {
- goto Label5;
- }
- if (id == (long)5)
- {
- goto Label3;
- }
- goto Label4;
- }
- Label5:
- item1 = item;
- patrimonial = await (new ItemServico()).BuscaPatrimonial(item.get_Id());
- item1.set_Patrimonial(patrimonial);
- item1 = null;
- string[] numero1 = new string[19];
- numero1[0] = str371;
- numero1[1] = "<td bgcolor='";
- str77 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- numero1[2] = str77;
- numero1[3] = "' colspan='4'><p align='left'><b>";
- numero1[4] = string.Format("ITEM {0}: ", item.get_Ordem());
- numero1[5] = "</b>";
- numero1[6] = item.get_Patrimonial().get_Endereco();
- numero1[7] = ", ";
- numero1[8] = item.get_Patrimonial().get_Numero();
- numero1[9] = ", ";
- str78 = (string.IsNullOrWhiteSpace(item.get_Patrimonial().get_Complemento()) ? "" : string.Concat(item.get_Patrimonial().get_Complemento(), ", "));
- numero1[10] = str78;
- numero1[11] = item.get_Patrimonial().get_Bairro();
- numero1[12] = " - ";
- numero1[13] = item.get_Patrimonial().get_Cidade();
- numero1[14] = " - ";
- numero1[15] = item.get_Patrimonial().get_Estado();
- numero1[16] = " - ";
- numero1[17] = item.get_Patrimonial().get_Cep();
- numero1[18] = "</p></td>";
- str371 = string.Concat(numero1);
- }
- else
- {
- string[] descricao2 = new string[] { str371, "<td bgcolor='", null, null, null, null, null, null };
- str114 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- descricao2[2] = str114;
- descricao2[3] = "' colspan='3'><p align='left'><b>";
- descricao2[4] = string.Format("ITEM {0}: ", item.get_Ordem());
- descricao2[5] = "</b>";
- descricao2[6] = item.get_Descricao();
- descricao2[7] = "</p></td>";
- str371 = string.Concat(descricao2);
- }
- Label9:
- if (item.get_Sinistros().Count > 0)
- {
- Item item2 = item;
- if (item2 != null)
- {
- IList<ControleSinistro> sinistros = item2.get_Sinistros();
- if (sinistros != null)
- {
- ControleSinistro controleSinistro = sinistros.LastOrDefault<ControleSinistro>();
- if (controleSinistro != null)
- {
- List<Sinistro> sinistros1 = controleSinistro.get_Sinistros();
- if (sinistros1 != null)
- {
- Sinistro sinistro = sinistros1.LastOrDefault<Sinistro>();
- if (sinistro != null)
- {
- dataReclamacao = sinistro.get_DataReclamacao();
- }
- else
- {
- clienteDesde = null;
- dataReclamacao = clienteDesde;
- }
- }
- else
- {
- clienteDesde = null;
- dataReclamacao = clienteDesde;
- }
- }
- else
- {
- clienteDesde = null;
- dataReclamacao = clienteDesde;
- }
- }
- else
- {
- clienteDesde = null;
- dataReclamacao = clienteDesde;
- }
- }
- else
- {
- clienteDesde = null;
- dataReclamacao = clienteDesde;
- }
- DateTime? nullable3 = dataReclamacao;
- if (nullable3.HasValue)
- {
- date = nullable3.Value;
- shortDateString6 = date.ToShortDateString();
- }
- else
- {
- shortDateString6 = "-";
- }
- string str388 = shortDateString6;
- string[] strArrays34 = new string[18];
- strArrays34[0] = str371;
- strArrays34[1] = "</tr><td bgcolor='";
- numeroParcela = num10 + 1;
- num10 = numeroParcela;
- str107 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays34[2] = str107;
- strArrays34[3] = "'><p align='left'><b>SINISTRO STATUS: </b>";
- Item item3 = item;
- if (item3 != null)
- {
- IList<ControleSinistro> controleSinistros1 = item3.get_Sinistros();
- if (controleSinistros1 != null)
- {
- ControleSinistro controleSinistro1 = controleSinistros1.LastOrDefault<ControleSinistro>();
- if (controleSinistro1 != null)
- {
- List<Sinistro> sinistros2 = controleSinistro1.get_Sinistros();
- if (sinistros2 != null)
- {
- Sinistro sinistro1 = sinistros2.LastOrDefault<Sinistro>();
- if (sinistro1 != null)
- {
- description2 = ValidationHelper.GetDescription(sinistro1.get_StatusSinistro());
- }
- else
- {
- description2 = null;
- }
- }
- else
- {
- description2 = null;
- }
- }
- else
- {
- description2 = null;
- }
- }
- else
- {
- description2 = null;
- }
- }
- else
- {
- description2 = null;
- }
- strArrays34[4] = description2;
- strArrays34[5] = "</p></td><td bgcolor='";
- str108 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays34[6] = str108;
- strArrays34[7] = "'><p align='left'><b>DATA: </b>";
- strArrays34[8] = str388;
- strArrays34[9] = "</p></td><td bgcolor='";
- str109 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays34[10] = str109;
- strArrays34[11] = "'><p align='left'><b>VALOR: </b>";
- Item item4 = item;
- if (item4 != null)
- {
- IList<ControleSinistro> controleSinistros2 = item4.get_Sinistros();
- if (controleSinistros2 != null)
- {
- ControleSinistro controleSinistro2 = controleSinistros2.LastOrDefault<ControleSinistro>();
- if (controleSinistro2 != null)
- {
- List<Sinistro> sinistros3 = controleSinistro2.get_Sinistros();
- if (sinistros3 != null)
- {
- Sinistro sinistro2 = sinistros3.LastOrDefault<Sinistro>();
- if (sinistro2 != null)
- {
- currency = ValidationHelper.ToCurrency<decimal>(sinistro2.get_Valor(), "pt-BR");
- }
- else
- {
- currency = null;
- }
- }
- else
- {
- currency = null;
- }
- }
- else
- {
- currency = null;
- }
- }
- else
- {
- currency = null;
- }
- }
- else
- {
- currency = null;
- }
- strArrays34[12] = currency;
- strArrays34[13] = "</p></td><td bgcolor='";
- str110 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays34[14] = str110;
- strArrays34[15] = "' colspan='3'><p align='left'><b>QTDE SINISTRO(S): </b>";
- numeroParcela = item.get_Sinistros().Count;
- strArrays34[16] = numeroParcela.ToString();
- strArrays34[17] = "</p></td>";
- str371 = string.Concat(strArrays34);
- }
- str371 = string.Concat(str371, "</tr>");
- if (this.SelectedTipoExtrato != 2)
- {
- string[] strArrays35 = new string[] { str371, "<tr><td bgcolor='", null, null, null, null, null, null, null, null };
- numeroParcela = num10 + 1;
- num10 = numeroParcela;
- str80 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays35[2] = str80;
- strArrays35[3] = "' colspan='3'><p align='left'><b>STATUS: </b>";
- str81 = (string.IsNullOrWhiteSpace(item.get_Status()) ? item.get_StatusInclusao() : item.get_Status());
- strArrays35[4] = str81;
- strArrays35[5] = "</p></td><td bgcolor='";
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str82 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays35[6] = str82;
- strArrays35[7] = "'><p align='left'><b>ATIVO: </b>";
- str83 = (!item.get_Substituido().HasValue ? "SIM" : "NÃO");
- strArrays35[8] = str83;
- strArrays35[9] = "</p></td></tr>";
- str371 = string.Concat(strArrays35);
- id = documento3.get_Controle().get_Ramo().get_Id();
- long num14 = id - (long)1;
- if (num14 <= (long)58)
- {
- switch ((uint)num14)
- {
- case 0:
- case 1:
- case 2:
- case 14:
- case 17:
- {
- if (!this.ObsItem || !this.ObsItemEnabled)
- {
- break;
- }
- string[] strArrays36 = new string[] { str371, "<tr><td bgcolor='", null, null, null, null, null, null, null, null };
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str84 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays36[2] = str84;
- strArrays36[3] = "' colspan='3'><p align='left'><b>OBSERVAÇÕES: </b>";
- str85 = (string.IsNullOrWhiteSpace(item.get_Patrimonial().get_Item().get_Observacao()) ? "-" : item.get_Patrimonial().get_Item().get_Observacao());
- strArrays36[4] = str85;
- strArrays36[5] = "</p></td><td bgcolor='";
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str86 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays36[6] = str86;
- strArrays36[7] = "' colspan='3'><p align='left'><b>BENS E INFORMAÇÕES: </b>";
- str87 = (string.IsNullOrWhiteSpace(item.get_Patrimonial().get_Bens()) ? "-" : item.get_Patrimonial().get_Bens());
- strArrays36[8] = str87;
- strArrays36[9] = "</p></td></tr>";
- str371 = string.Concat(strArrays36);
- break;
- }
- case 3:
- case 7:
- case 15:
- case 16:
- case 18:
- case 22:
- case 23:
- case 25:
- case 27:
- case 30:
- case 32:
- case 38:
- case 40:
- case 43:
- case 48:
- case 58:
- {
- item1 = item;
- riscosDiverso = await (new ItemServico()).BuscaRiscosDiversos(item.get_Id());
- item1.set_RiscosDiversos(riscosDiverso);
- item1 = null;
- if (!this.ObsItem || !this.ObsItemEnabled)
- {
- break;
- }
- string[] strArrays37 = new string[] { str371, "<tr><td bgcolor='", null, null, null, null };
- str88 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays37[2] = str88;
- strArrays37[3] = "' colspan='3'><p align='left'><b>OBSERVAÇÕES: </b>";
- str89 = (string.IsNullOrWhiteSpace(item.get_RiscosDiversos().get_Observacao()) ? "-" : item.get_RiscosDiversos().get_Observacao());
- strArrays37[4] = str89;
- strArrays37[5] = "</p></td></tr>";
- str371 = string.Concat(strArrays37);
- break;
- }
- case 4:
- case 36:
- {
- if (this.ObsItem && this.ObsItemEnabled)
- {
- string[] strArrays38 = new string[] { str371, "<tr><td bgcolor='", null, null, null, null };
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str100 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays38[2] = str100;
- strArrays38[3] = "' colspan='3'><p align='left'><b>OBSERVAÇÕES: </b>";
- str101 = (string.IsNullOrWhiteSpace(item.get_Auto().get_Observacao()) ? "-" : item.get_Auto().get_Observacao());
- strArrays38[4] = str101;
- strArrays38[5] = "</p></td></tr>";
- str371 = string.Concat(strArrays38);
- }
- string[] strArrays39 = new string[30];
- strArrays39[0] = str371;
- strArrays39[1] = "<tr><td bgcolor='";
- str90 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays39[2] = str90;
- strArrays39[3] = "' colspan='3'><p align='left'><b>COBERTURA PADRÃO: </b>";
- tipoCobertura = item.get_Auto().get_TipoCobertura();
- if (tipoCobertura.HasValue)
- {
- description = ValidationHelper.GetDescription(tipoCobertura.GetValueOrDefault());
- }
- else
- {
- description = null;
- }
- strArrays39[4] = description;
- strArrays39[5] = "</p></td><td bgcolor='";
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str91 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays39[6] = str91;
- strArrays39[7] = "'><p align='left'><b>BÔNUS: </b>";
- bonus = item.get_Auto().get_Bonus();
- strArrays39[8] = bonus.ToString();
- strArrays39[9] = "</p></td></tr><tr><td bgcolor='";
- str92 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays39[10] = str92;
- strArrays39[11] = "'colspan='2'><p align='left'><b>REGIÃO DE CIRCULAÇÃO: </b>";
- str93 = (string.IsNullOrWhiteSpace(item.get_Auto().get_RegiaoCirculacao()) ? "-" : item.get_Auto().get_RegiaoCirculacao());
- strArrays39[12] = str93;
- strArrays39[13] = "</p></td><td bgcolor='";
- str94 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays39[14] = str94;
- strArrays39[15] = "'><p align='left'><b>TABELA DE REFERÊNCIA: </b>";
- tabelaReferencia = item.get_Auto().get_TabelaReferencia();
- if (tabelaReferencia.HasValue)
- {
- description1 = ValidationHelper.GetDescription(tabelaReferencia.GetValueOrDefault());
- }
- else
- {
- description1 = null;
- }
- strArrays39[16] = description1;
- strArrays39[17] = "</p></td><td bgcolor='";
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str95 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays39[18] = str95;
- strArrays39[19] = "'><p align='left'><b>% DE REFERÊNCIA: </b>";
- strArrays39[20] = string.Format("{0}%", item.get_Auto().get_PorcentagemReferencia());
- strArrays39[21] = "</p></td></tr><tr><td bgcolor='";
- str96 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays39[22] = str96;
- strArrays39[23] = "' colspan='3'><p align='left'><b>CÓDIGO FIPE: </b>";
- str97 = (string.IsNullOrWhiteSpace(item.get_Auto().get_Fipe()) ? "-" : item.get_Auto().get_Fipe());
- strArrays39[24] = str97;
- strArrays39[25] = "</p></td><td bgcolor='";
- str98 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays39[26] = str98;
- strArrays39[27] = "'><p align='left'><b>COR DO VEÍCULO: </b>";
- str99 = (!item.get_Auto().get_Cor().HasValue ? "-" : ValidationHelper.GetDescription(item.get_Auto().get_Cor()));
- strArrays39[28] = str99;
- strArrays39[29] = "</p></td></tr>";
- str371 = string.Concat(strArrays39);
- break;
- }
- case 5:
- case 6:
- case 8:
- case 9:
- case 52:
- {
- item1 = item;
- vida = await (new ItemServico()).BuscaVida(item.get_Id());
- item1.set_Vida(vida);
- item1 = null;
- if (!item.get_Sinistrado() || !this.BeneficiariosItens || !this.BeneficiariosItensEnabled)
- {
- break;
- }
- string str389 = str371;
- str102 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- str371 = string.Concat(str389, "<tr><td bgcolor='", str102, "' colspan='3'><p align='left'><b>BENEFICIÁRIOS: </b>");
- string str390 = "";
- foreach (ControleSinistro sinistro3 in item.get_Sinistros())
- {
- if (sinistro3.get_Sinistros() == null)
- {
- continue;
- }
- foreach (Sinistro sinistro4 in sinistro3.get_Sinistros())
- {
- if (string.IsNullOrWhiteSpace(sinistro4.get_SinistroVida().get_Beneficiario()))
- {
- continue;
- }
- str390 = string.Concat(str390, sinistro4.get_SinistroVida().get_Beneficiario(), ", ");
- }
- }
- if (!string.IsNullOrWhiteSpace(str390))
- {
- int num15 = str390.LastIndexOf(", ", StringComparison.Ordinal);
- str390 = str390.Remove(num15, 2).Insert(num15, ".");
- }
- str371 = string.Concat(str371, str390, "</p></td></tr>");
- break;
- }
- case 12:
- {
- item1 = item;
- aeronautico = await (new ItemServico()).BuscaAeronautico(item.get_Id());
- item1.set_Aeronautico(aeronautico);
- item1 = null;
- if (!this.ObsItem || !this.ObsItemEnabled)
- {
- break;
- }
- string[] strArrays40 = new string[] { str371, "<tr><td bgcolor='", null, null, null, null };
- str103 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays40[2] = str103;
- strArrays40[3] = "' colspan='3'><p align='left'><b>OBSERVAÇÕES: </b>";
- str104 = (string.IsNullOrWhiteSpace(item.get_Aeronautico().get_Observacao()) ? "-" : item.get_Aeronautico().get_Observacao());
- strArrays40[4] = str104;
- strArrays40[5] = "</p></td></tr>";
- str371 = string.Concat(strArrays40);
- break;
- }
- case 19:
- {
- item1 = item;
- granizo = await (new ItemServico()).BuscaGranizo(item.get_Id());
- item1.set_Granizo(granizo);
- item1 = null;
- if (!this.ObsItem || !this.ObsItemEnabled)
- {
- break;
- }
- string[] strArrays41 = new string[] { str371, "<tr><td bgcolor='", null, null, null, null };
- str105 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays41[2] = str105;
- strArrays41[3] = "' colspan='3'><p align='left'><b>OBSERVAÇÕES: </b>";
- str106 = (string.IsNullOrWhiteSpace(item.get_Granizo().get_Observacao()) ? "-" : item.get_Granizo().get_Observacao());
- strArrays41[4] = str106;
- strArrays41[5] = "</p></td></tr>";
- str371 = string.Concat(strArrays41);
- break;
- }
- }
- }
- else
- {
- }
- }
- str371 = string.Concat(str371, "</font></table>");
- if (this.SelectedTipoExtrato != 2)
- {
- ObservableCollection<Cobertura> observableCollection5 = await (new ItemServico()).BuscarCoberturasPorItemAsync(item.get_Id());
- if (observableCollection5.Count > 0 && this.Coberturas)
- {
- str371 = string.Concat(str371, "<br><table border='1' bordercolor='#ededed' width='999'><font face='Verdana' style='font-size: 12pt; position: absolute; top: 50 %; -moz-transform: translateY(-50 %); -webkit-transform: translateY(-50 %); transform: translateY(-50 %)'><tr><td bgcolor='WhiteSmoke'><p align='left'><b><div align='center'>COBERTURA</div></b></p></td><td bgcolor='WhiteSmoke'><p align='left'><b><div align='center'>FRANQUIA</div></b></p></td><td bgcolor='WhiteSmoke'><p align='left'><b><div align='center'>L.M.I.</div></b></p></td><td bgcolor='WhiteSmoke'><p align='left'><b><div align='center'>PRÊMIO</div></b></p></td></tr>");
- foreach (Cobertura cobertura in observableCollection5)
- {
- string[] strArrays42 = new string[] { str371, "<tr><td bgcolor='White'><p align='left'><div align='center'>", cobertura.get_Observacao(), "</div></p></td><td bgcolor='White'><p align='left'><div align='center'>", string.Format("{0:c}", cobertura.get_Franquia()), "</div></p></td><td bgcolor='White'><p align='left'><div align='center'>", string.Format("{0:c}", cobertura.get_Lmi()), "</div></p></td><td bgcolor='White'><p align='left'><div align='center'>", string.Format("{0:c}", cobertura.get_Premio()), "</div></p></td></tr>" };
- str371 = string.Concat(strArrays42);
- }
- str371 = string.Concat(str371, "</font></table>");
- }
- string str391 = str371;
- str79 = (!this.SepararPagina || !this.SepararPaginaEnabled ? "" : "</div>");
- str371 = string.Concat(str391, str79);
- }
- if (this.SelectedTipoExtrato != 2)
- {
- num10 = 0;
- }
- }
- }
- else
- {
- str371 = string.Concat(str371, "<br><p align='center'><b>ESTA APÓLICE NÃO POSSUI ITENS</b></p>");
- }
- list = null;
- }
- else
- {
- variable9 = null;
- return;
- }
- }
- else
- {
- bool flag3 = documento3.get_Controle().get_Cliente().get_PessoaFisica();
- if ((!this.Endossos || !this.SomenteEndossos) && !nums.Any<long>((long x) => x == this.documento.get_Controle().get_Id()))
- {
- string[] strArrays43 = new string[] { str371, "<table border='1' bordercolor='#ededed' width='999'><font face='Verdana' style='font-size: 12pt; position: absolute; top: 50 %; -moz-transform: translateY(-50 %); -webkit-transform: translateY(-50 %); transform: translateY(-50 %)'><tr><td width='333' bgcolor='", null, null, null, null, null, null };
- str332 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays43[2] = str332;
- strArrays43[3] = "' ";
- strArrays43[4] = (flag3 ? "" : "colspan='2'");
- strArrays43[5] = "><p align='left'><b>CLIENTE: </b>";
- strArrays43[6] = documento3.get_Controle().get_Cliente().get_Nome();
- strArrays43[7] = "</p></td>";
- str371 = string.Concat(strArrays43);
- if (flag3)
- {
- string[] strArrays44 = new string[] { str371, "<td bgcolor='", null, null, null, null };
- str357 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays44[2] = str357;
- strArrays44[3] = "'><p align='left' x-ms-format-detection='none'><b>RG: </b>";
- str358 = (!string.IsNullOrWhiteSpace(documento3.get_Controle().get_Cliente().get_Identidade()) ? documento3.get_Controle().get_Cliente().get_Identidade() : "-");
- strArrays44[4] = str358;
- strArrays44[5] = "</p></td>";
- str371 = string.Concat(strArrays44);
- }
- string[] documento7 = new string[] { str371, "<td width='222' bgcolor='", null, null, null, null };
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str333 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- documento7[2] = str333;
- documento7[3] = "' colspan='2'><p align='left' x-ms-format-detection='none'><b>CPF/CNPJ: </b>";
- documento7[4] = documento3.get_Controle().get_Cliente().get_Documento();
- documento7[5] = "</p></td></tr>";
- str371 = string.Concat(documento7);
- if (this.SelectedTipoExtrato != 2)
- {
- str351 = (documento3.get_Controle().get_Cliente().get_Atividade() == null ? "NASCIMENTO" : "ABERTURA");
- string str392 = str351;
- string[] strArrays45 = new string[] { str371, "<tr><td width='222' bgcolor='", null, null, null, null, null, null, null, null };
- str352 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays45[2] = str352;
- strArrays45[3] = "' ";
- strArrays45[4] = (flag3 ? "" : "colspan='2'");
- strArrays45[5] = "><p align='left'><b>";
- strArrays45[6] = str392;
- strArrays45[7] = ": ";
- clienteDesde = documento3.get_Controle().get_Cliente().get_Nascimento();
- if (clienteDesde.HasValue)
- {
- shortDateString17 = clienteDesde.GetValueOrDefault().ToShortDateString();
- }
- else
- {
- shortDateString17 = null;
- }
- strArrays45[8] = shortDateString17;
- strArrays45[9] = "</b></p>";
- str371 = string.Concat(strArrays45);
- if (!flag3)
- {
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- }
- else
- {
- string[] strArrays46 = new string[] { str371, "<td bgcolor='", null, null, null, null, null, null, null, null };
- str353 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays46[2] = str353;
- strArrays46[3] = "'colspan='2'><p align='left'><b>ESTADO CIVIL: </b>";
- if (documento3.get_Controle().get_Cliente().get_EstadoCivil().HasValue)
- {
- estadoCivil = documento3.get_Controle().get_Cliente().get_EstadoCivil();
- str354 = estadoCivil.ToString().ToUpper();
- }
- else
- {
- str354 = "-";
- }
- strArrays46[4] = str354;
- strArrays46[5] = "</p></td><td bgcolor='";
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str355 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays46[6] = str355;
- strArrays46[7] = "' colspan='2'><p align='left'><b>SEXO: </b>";
- if (documento3.get_Controle().get_Cliente().get_Sexo().HasValue)
- {
- sexo = documento3.get_Controle().get_Cliente().get_Sexo();
- str356 = sexo.ToString().ToUpper();
- }
- else
- {
- str356 = "-";
- }
- strArrays46[8] = str356;
- strArrays46[9] = "</p></td></td></tr>";
- str371 = string.Concat(strArrays46);
- }
- }
- if (this.SelectedTipoExtrato != 2)
- {
- string[] strArrays47 = new string[18];
- strArrays47[0] = str371;
- strArrays47[1] = "<tr><td bgcolor='";
- str343 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays47[2] = str343;
- strArrays47[3] = "'><p align='left'><b>BANCO: </b>";
- str344 = (documento3.get_Controle().get_Cliente().get_Banco() != null ? documento3.get_Controle().get_Cliente().get_Banco().get_Nome() : "-");
- strArrays47[4] = str344;
- strArrays47[5] = "</p></td><td bgcolor='";
- str345 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays47[6] = str345;
- strArrays47[7] = "'><p align='left' x-ms-format-detection='none'><b>AGÊNCIA: </b>";
- str346 = (!string.IsNullOrWhiteSpace(documento3.get_Controle().get_Cliente().get_Agencia()) ? documento3.get_Controle().get_Cliente().get_Agencia() : "-");
- strArrays47[8] = str346;
- strArrays47[9] = "</p></td><td bgcolor='";
- str347 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays47[10] = str347;
- strArrays47[11] = "'><p align='left' x-ms-format-detection='none'><b>CONTA: </b>";
- str348 = (!string.IsNullOrWhiteSpace(documento3.get_Controle().get_Cliente().get_Conta()) ? documento3.get_Controle().get_Cliente().get_Conta() : "-");
- strArrays47[12] = str348;
- strArrays47[13] = "</p></td><td bgcolor='";
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str349 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays47[14] = str349;
- strArrays47[15] = "'><p align='left' x-ms-format-detection='none'><b>TIPO: </b>";
- str350 = (!string.IsNullOrWhiteSpace(documento3.get_Controle().get_Cliente().get_TipoConta()) ? documento3.get_Controle().get_Cliente().get_TipoConta() : "-");
- strArrays47[16] = str350;
- strArrays47[17] = "</p></td></tr>";
- str371 = string.Concat(strArrays47);
- }
- if (this.SelectedTipoExtrato != 2)
- {
- str371 = string.Concat(str371, "<tr>");
- string str393 = "";
- if (documento3.get_Controle().get_Cliente().get_Telefones() != null)
- {
- foreach (ClienteTelefone clienteTelefone1 in documento3.get_Controle().get_Cliente().get_Telefones())
- {
- string[] numero2 = new string[] { str393, "<br>", null, null, null, null, null };
- nullable = clienteTelefone1.get_Tipo();
- if (nullable.HasValue)
- {
- tipoTelefone = nullable.GetValueOrDefault();
- str342 = tipoTelefone.ToString().ToUpper();
- }
- else
- {
- str342 = null;
- }
- numero2[2] = str342;
- numero2[3] = " (";
- numero2[4] = clienteTelefone1.get_Prefixo();
- numero2[5] = ") ";
- numero2[6] = clienteTelefone1.get_Numero();
- str393 = string.Concat(numero2);
- }
- }
- string[] strArrays48 = new string[] { str371, "<td bgcolor='", null, null, null, null };
- str335 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays48[2] = str335;
- strArrays48[3] = "' ><p align='left'><b>CONTATOS: </b>";
- str336 = (string.IsNullOrEmpty(str393) ? "-" : str393);
- strArrays48[4] = str336;
- strArrays48[5] = "</p></td>";
- str371 = string.Concat(strArrays48);
- string str394 = "";
- if (documento3.get_Controle().get_Cliente().get_Emails() != null)
- {
- foreach (ClienteEmail clienteEmail1 in documento3.get_Controle().get_Cliente().get_Emails())
- {
- str394 = string.Concat(str394, "<br>", clienteEmail1.get_Email());
- }
- }
- string[] strArrays49 = new string[] { str371, "<td bgcolor='", null, null, null, null };
- str337 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays49[2] = str337;
- strArrays49[3] = "'><p align='left'><b>EMAILS: </b>";
- str338 = (string.IsNullOrEmpty(str394) ? "-" : str394);
- strArrays49[4] = str338;
- strArrays49[5] = "</p></td>";
- str371 = string.Concat(strArrays49);
- string str395 = "";
- if (documento3.get_Controle().get_Cliente().get_Enderecos() != null)
- {
- foreach (ClienteEndereco clienteEndereco3 in documento3.get_Controle().get_Cliente().get_Enderecos())
- {
- string[] cidade1 = new string[] { str395, "<br>", clienteEndereco3.get_Endereco(), ", ", clienteEndereco3.get_Numero(), ", ", null, null, null, null, null, null, null, null };
- str341 = (string.IsNullOrWhiteSpace(clienteEndereco3.get_Complemento()) ? "" : string.Concat(clienteEndereco3.get_Complemento(), ", "));
- cidade1[6] = str341;
- cidade1[7] = clienteEndereco3.get_Bairro();
- cidade1[8] = " - ";
- cidade1[9] = clienteEndereco3.get_Cidade();
- cidade1[10] = " - ";
- cidade1[11] = clienteEndereco3.get_Estado();
- cidade1[12] = " - ";
- cidade1[13] = clienteEndereco3.get_Cep();
- str395 = string.Concat(cidade1);
- }
- }
- string[] strArrays50 = new string[] { str371, "<td bgcolor='", null, null, null, null };
- str339 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays50[2] = str339;
- strArrays50[3] = "' colspan='2'><p align='left'><b>ENDEREÇOS: </b>";
- str340 = (string.IsNullOrEmpty(str395) ? "-" : str395);
- strArrays50[4] = str340;
- strArrays50[5] = "</p></td>";
- str371 = string.Concat(strArrays50);
- str371 = string.Concat(str371, "</tr>");
- }
- str371 = string.Concat(str371, "</font></table>");
- string str396 = str371;
- str334 = (this.ClientePorPaginaVisibility != Visibility.Visible || !this.ClientePorPagina || !this.ClientePorPaginaEnabled ? "" : "</div>");
- str371 = string.Concat(str396, str334);
- }
- else
- {
- string[] documento8 = new string[14];
- documento8[0] = str371;
- documento8[1] = "<table border='1' bordercolor='#ededed' width='999'><font face='Verdana' style='font-size: 12pt; position: absolute; top: 50 %; -moz-transform: translateY(-50 %); -webkit-transform: translateY(-50 %); transform: translateY(-50 %)'><tr><td width='333' bgcolor='";
- str240 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- documento8[2] = str240;
- documento8[3] = "'><p align='left'><b>CLIENTE: </b>";
- documento8[4] = documento3.get_Controle().get_Cliente().get_Nome();
- documento8[5] = "</p></td><td bgcolor='";
- str241 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- documento8[6] = str241;
- documento8[7] = "'><p align='left' x-ms-format-detection='none'><b>RG: </b>";
- str242 = (!string.IsNullOrWhiteSpace(documento3.get_Controle().get_Cliente().get_Identidade()) ? documento3.get_Controle().get_Cliente().get_Identidade() : "-");
- documento8[8] = str242;
- documento8[9] = "</p></td><td width='222' bgcolor='";
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str243 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- documento8[10] = str243;
- documento8[11] = "' colspan='2'><p align='left' x-ms-format-detection='none'><b>CPF/CNPJ: </b>";
- documento8[12] = documento3.get_Controle().get_Cliente().get_Documento();
- documento8[13] = "</p></td></tr></font></table>";
- str371 = string.Concat(documento8);
- }
- if (this.SelectedTipoExtrato != null)
- {
- num10 = 0;
- IList<Documento> documentos2 = documento3.get_Controle().get_Documentos();
- if (documentos2 != null)
- {
- documento = documentos2.LastOrDefault<Documento>((Documento x) => {
- if (x.get_Excluido())
- {
- return false;
- }
- return x.get_Ordem() != 0;
- });
- }
- else
- {
- documento = null;
- }
- Documento documento9 = documento;
- string[] shortDateString19 = new string[26];
- shortDateString19[0] = str371;
- shortDateString19[1] = "<hr style='width:999; border-top: 3px solid #000'><table border='1' bordercolor='#ededed' width='999'><font face='Verdana' style='font-size: 12pt; position: absolute; top: 50 %; -moz-transform: translateY(-50 %); -webkit-transform: translateY(-50 %); transform: translateY(-50 %)'><tr><td bgcolor='";
- str244 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- shortDateString19[2] = str244;
- shortDateString19[3] = "'><p align='left'><b>RAMO: </b>";
- shortDateString19[4] = documento3.get_Controle().get_Ramo().get_Nome();
- shortDateString19[5] = "</p></td><td bgcolor='";
- str245 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- shortDateString19[6] = str245;
- shortDateString19[7] = "'><p align='left' x-ms-format-detection='none'><b>VIGÊNCIA INICIAL: </b>";
- date = documento3.get_Vigencia1();
- shortDateString19[8] = date.ToShortDateString();
- shortDateString19[9] = "</p></td><td bgcolor='";
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str246 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- shortDateString19[10] = str246;
- shortDateString19[11] = "'><p align='left'><b>VIGÊNCIA FINAL: </b>";
- clienteDesde = documento3.get_Vigencia2();
- if (!clienteDesde.HasValue)
- {
- shortDateString14 = "-";
- }
- else
- {
- clienteDesde = documento3.get_Vigencia2();
- if (clienteDesde.HasValue)
- {
- shortDateString14 = clienteDesde.GetValueOrDefault().ToShortDateString();
- }
- else
- {
- shortDateString14 = null;
- }
- }
- shortDateString19[12] = shortDateString14;
- shortDateString19[13] = "</p></td></tr><tr><td bgcolor='";
- str247 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- shortDateString19[14] = str247;
- shortDateString19[15] = "'><p align='left'><b>CONTRATO: </b>";
- str248 = (string.IsNullOrWhiteSpace(documento3.get_Apolice()) ? "-" : documento3.get_Apolice());
- shortDateString19[16] = str248;
- shortDateString19[17] = "</p></td><td bgcolor='";
- str249 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- shortDateString19[18] = str249;
- shortDateString19[19] = "'><p align='left'><b>POSSUI ENDOSSO? </b>";
- str250 = (documento3.get_TemEndosso() ? "SIM" : "NÃO");
- shortDateString19[20] = str250;
- shortDateString19[21] = "</p></td><td bgcolor='";
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str251 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- shortDateString19[22] = str251;
- shortDateString19[23] = "'><p align='left' x-ms-format-detection='none'><b>ADITAMENTO: </b>";
- if (string.IsNullOrWhiteSpace(documento3.get_Endosso()))
- {
- endosso1 = (!flag || documento9 == null ? "-" : documento9.get_Endosso());
- }
- else
- {
- endosso1 = documento3.get_Endosso();
- }
- shortDateString19[24] = endosso1;
- shortDateString19[25] = "</p></td></tr><tr>";
- str371 = string.Concat(shortDateString19);
- if (!documento3.get_NegocioCorretora().HasValue)
- {
- Documento documento10 = documento3;
- negocioCorretora1 = (documento3.get_Situacao() != 2 || !documento3.get_Negocio().HasValue || documento3.get_Negocio().GetValueOrDefault() != 1 ? 0 : 1);
- documento10.set_NegocioCorretora(new NegocioCorretora?(negocioCorretora1));
- }
- if (this.SelectedTipoExtrato != 2)
- {
- string[] description9 = new string[] { str371, "<td bgcolor='", null, null, null, null, null, null, null, null };
- str330 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- description9[2] = str330;
- description9[3] = "'><p align='left'><b>NEGÓCIO CORRETORA: </b>";
- description9[4] = ValidationHelper.GetDescription(documento3.get_NegocioCorretora());
- description9[5] = "</p></td><td bgcolor='";
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str331 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- description9[6] = str331;
- description9[7] = "' colspan='2'><p align='left'><b>STATUS DO SEGURO: </b>";
- description9[8] = ValidationHelper.GetDescription(documento3.get_Situacao());
- description9[9] = "</p></td>";
- str371 = string.Concat(description9);
- }
- string[] strArrays51 = new string[] { str371, "</tr><tr><td bgcolor='", null, null, null, null };
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str252 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays51[2] = str252;
- strArrays51[3] = "' colspan='3'><p align='left'><b>VENDEDOR: </b>";
- str253 = (documento3.get_VendedorPrincipal() == null ? "-" : documento3.get_VendedorPrincipal().get_Nome());
- strArrays51[4] = str253;
- strArrays51[5] = "</p></td></tr>";
- str371 = string.Concat(strArrays51);
- if (this.SelectedTipoExtrato != 2)
- {
- str371 = string.Concat(str371, "<tr>");
- string str397 = "";
- if (documento3.get_Estipulante1() != null)
- {
- str397 = string.Concat(str397, documento3.get_Estipulante1().get_Nome(), ", ");
- }
- if (documento3.get_Estipulante2() != null)
- {
- str397 = string.Concat(str397, documento3.get_Estipulante2().get_Nome(), ", ");
- }
- if (documento3.get_Estipulante3() != null)
- {
- str397 = string.Concat(str397, documento3.get_Estipulante3().get_Nome(), ", ");
- }
- if (documento3.get_Estipulante4() != null)
- {
- str397 = string.Concat(str397, documento3.get_Estipulante4().get_Nome(), ", ");
- }
- if (documento3.get_Estipulante5() != null)
- {
- str397 = string.Concat(str397, documento3.get_Estipulante5().get_Nome(), ", ");
- }
- if (!string.IsNullOrWhiteSpace(str397))
- {
- int num16 = str397.LastIndexOf(", ", StringComparison.Ordinal);
- str397 = str397.Remove(num16, 2).Insert(num16, ".");
- }
- string[] strArrays52 = new string[] { str371, "<td bgcolor='", null, null, null, null };
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str328 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays52[2] = str328;
- strArrays52[3] = "' colspan='3'><p align='left'><b>ESTIPULANTE(S): </b>";
- str329 = (string.IsNullOrWhiteSpace(str397) ? "-" : str397);
- strArrays52[4] = str329;
- strArrays52[5] = "</p></td></tr>";
- str371 = string.Concat(strArrays52);
- }
- if (this.SelectedTipoExtrato == 2)
- {
- string[] strArrays53 = new string[] { str371, "<tr><td bgcolor='", null, null, null, null };
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str254 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays53[2] = str254;
- strArrays53[3] = "' colspan='3'><p align='left'><b>SEGURADORA: </b>";
- strArrays53[4] = documento3.get_Controle().get_Seguradora().get_Nome();
- strArrays53[5] = "</p></td></tr>";
- str371 = string.Concat(strArrays53);
- }
- else
- {
- string[] strArrays54 = new string[] { str371, "<tr><td bgcolor='", null, null, null, null, null, null, null, null };
- str325 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays54[2] = str325;
- strArrays54[3] = "' colspan='2'><p align='left'><b>SEGURADORA: </b>";
- strArrays54[4] = documento3.get_Controle().get_Seguradora().get_Nome();
- strArrays54[5] = "</p></td><td bgcolor='";
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str326 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays54[6] = str326;
- strArrays54[7] = "'><p align='left'><b>APÓLICE SINISTRADA: </b>";
- str327 = (documento3.get_Sinistro() ? "SIM" : "NÃO");
- strArrays54[8] = str327;
- strArrays54[9] = "</p></td></tr>";
- str371 = string.Concat(strArrays54);
- }
- string[] description10 = new string[] { str371, "<tr><td bgcolor='", null, null, null, null };
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str255 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- description10[2] = str255;
- description10[3] = "' colspan='3'><p align='left'><b>FORMA PAGAMENTO: </b>";
- description10[4] = ValidationHelper.GetDescription(documento3.get_FormaPagamento());
- description10[5] = "</p></td></tr>";
- str371 = string.Concat(description10);
- str371 = string.Concat(str371, "</font></table>");
- if (this.PremioParcela || this.ExtratoResumido)
- {
- str371 = string.Concat(str371, "<table border='1' bordercolor='#ededed' width='999'><font face='Verdana' style='font-size: 12pt; position: absolute; top: 50 %; -moz-transform: translateY(-50 %); -webkit-transform: translateY(-50 %); transform: translateY(-50 %)'><tr>");
- if (this.ComissaoDocumento && this.ComissaoDocumentoEnabled || this.ExtratoResumido)
- {
- string[] strArrays55 = new string[] { str371, "<td bgcolor='", null, null, null, null };
- str324 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays55[2] = str324;
- strArrays55[3] = "'><p align='left'><b>COMISSÃO: </b>";
- strArrays55[4] = string.Format("{0:n2}%", Math.Round(documento3.get_Comissao(), 2));
- strArrays55[5] = "</p></td>";
- str371 = string.Concat(strArrays55);
- }
- string[] strArrays56 = new string[26];
- strArrays56[0] = str371;
- strArrays56[1] = "<td bgcolor='";
- str256 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays56[2] = str256;
- strArrays56[3] = "'><p align='left'><b>PRÊMIO LÍQUIDO: </b>";
- strArrays56[4] = string.Format("{0:c}", Math.Round(documento3.get_PremioLiquido(), 2));
- strArrays56[5] = "</p></td><td bgcolor='";
- str257 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays56[6] = str257;
- strArrays56[7] = "'><p align='left'><b>ADICIONAL: </b>";
- strArrays56[8] = string.Format("{0:c}", Math.Round(documento3.get_PremioAdicional(), 2));
- strArrays56[9] = "</p></td><td bgcolor='";
- str258 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays56[10] = str258;
- strArrays56[11] = "'><p align='left'><b>CUSTO APÓLICE: </b>";
- strArrays56[12] = string.Format("{0:c}", Math.Round(documento3.get_Custo(), 2));
- strArrays56[13] = "</p></td><td bgcolor='";
- str259 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays56[14] = str259;
- strArrays56[15] = "'><p align='left'><b>I.O.F.: </b>";
- strArrays56[16] = string.Format("{0:c}", Math.Round(documento3.get_Iof(), 2));
- strArrays56[17] = "</p></td><td bgcolor='";
- str260 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays56[18] = str260;
- strArrays56[19] = "'><p align='left'><b>PRÊMIO TOTAL: </b>";
- strArrays56[20] = string.Format("{0:c}", Math.Round(documento3.get_PremioTotal(), 2));
- strArrays56[21] = "</p></td><td bgcolor='";
- str261 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays56[22] = str261;
- strArrays56[23] = "'><p align='left'><b>Nº PARCELAS: </b>";
- premioLiquido = documento3.get_NumeroParcelas();
- strArrays56[24] = premioLiquido.ToString();
- strArrays56[25] = "</p></td></tr>";
- str371 = string.Concat(strArrays56);
- str371 = string.Concat(str371, "</font></table>");
- }
- if (this.PerfilCondutor && this.PerfilVisibility && documento3.get_Controle().get_Ramo().get_Id() == (long)5 && this.PerfilCondutorEnabled)
- {
- List<Perfil> perfils1 = perfils.ToList<Perfil>();
- foreach (Perfil perfil1 in perfils1)
- {
- num10 = 0;
- if (string.IsNullOrEmpty(perfil1.get_Nome()))
- {
- continue;
- }
- string[] description11 = new string[60];
- description11[0] = str371;
- description11[1] = "<hr style='width:999; border-top: 2px solid #ccc'><table border='1' bordercolor='#ededed' width='999'><font face='Verdana' style='font-size: 12pt; position: absolute; top: 50 %; -moz-transform: translateY(-50 %); -webkit-transform: translateY(-50 %); transform: translateY(-50 %)'><tr><td bgcolor='";
- str299 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- description11[2] = str299;
- description11[3] = "'><p align='left'><b>";
- description11[4] = string.Format("CONDUTOR {0}: ", perfils1.IndexOf(perfil1) + 1);
- description11[5] = "</b>";
- description11[6] = perfil1.get_Nome();
- description11[7] = "</p></td><td bgcolor='";
- str300 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- description11[8] = str300;
- description11[9] = "'><p align='left' x-ms-format-detection='none'><b>CPF: </b>";
- str301 = (string.IsNullOrWhiteSpace(perfil1.get_Cpf()) ? "-" : perfil1.get_Cpf());
- description11[10] = str301;
- description11[11] = "</p></td><td bgcolor='";
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str302 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- description11[12] = str302;
- description11[13] = "'><p align='left'><b>NASCIMENTO: </b>";
- clienteDesde = perfil1.get_Nascimento();
- if (!clienteDesde.HasValue)
- {
- shortDateString16 = "-";
- }
- else
- {
- clienteDesde = perfil1.get_Nascimento();
- if (clienteDesde.HasValue)
- {
- shortDateString16 = clienteDesde.GetValueOrDefault().ToShortDateString();
- }
- else
- {
- shortDateString16 = null;
- }
- }
- description11[14] = shortDateString16;
- description11[15] = "</p></td></tr><tr><td bgcolor='";
- str303 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- description11[16] = str303;
- description11[17] = "'><p align='left'><b>ESTADO CIVIL: </b>";
- str304 = (!perfil1.get_EstadoCivil().HasValue ? "-" : ValidationHelper.GetDescription(perfil1.get_EstadoCivil()));
- description11[18] = str304;
- description11[19] = "</p></td><td bgcolor='";
- str305 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- description11[20] = str305;
- description11[21] = "'><p align='left'><b>SEXO: </b>";
- str306 = (!perfil1.get_Sexo().HasValue ? "-" : ValidationHelper.GetDescription(perfil1.get_Sexo()));
- description11[22] = str306;
- description11[23] = "</p></td><td bgcolor='";
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str307 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- description11[24] = str307;
- description11[25] = "'><p align='left'><b>RELAÇÃO SEGURADO/CONDUTOR: </b>";
- description11[26] = ValidationHelper.GetDescription(perfil1.get_Relacao());
- description11[27] = "</p></td></tr><tr><td bgcolor='";
- str308 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- description11[28] = str308;
- description11[29] = "'><p align='left'><b>GARAGEM NA RESIDÊNCIA: </b>";
- str309 = (!perfil1.get_GaragemResidencia().HasValue ? "-" : ValidationHelper.GetDescription(perfil1.get_GaragemResidencia()));
- description11[30] = str309;
- description11[31] = "</p></td><td bgcolor='";
- str310 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- description11[32] = str310;
- description11[33] = "'><p align='left'><b>GARAGEM NO TRABALHO: </b>";
- str311 = (!perfil1.get_GaragemTrabalho().HasValue ? "-" : ValidationHelper.GetDescription(perfil1.get_GaragemTrabalho()));
- description11[34] = str311;
- description11[35] = "</p></td><td bgcolor='";
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str312 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- description11[36] = str312;
- description11[37] = "'><p align='left'><b>GARAGEM NO ESTUDO: </b>";
- str313 = (!perfil1.get_GaragemEstudo().HasValue ? "-" : ValidationHelper.GetDescription(perfil1.get_GaragemEstudo()));
- description11[38] = str313;
- description11[39] = "</p></td></tr><tr><td bgcolor='";
- str314 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- description11[40] = str314;
- description11[41] = "'><p align='left'><b>TIPO DE RESIDÊNCIA: </b>";
- str315 = (!perfil1.get_TipoResidencia().HasValue ? "-" : ValidationHelper.GetDescription(perfil1.get_TipoResidencia()));
- description11[42] = str315;
- description11[43] = "</p></td><td bgcolor='";
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str316 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- description11[44] = str316;
- description11[45] = "' colspan='2'><p align='left'><b>DISTÂNCIA ATÉ O TRABALHO: </b>";
- str317 = (!perfil1.get_DistanciaResidenciaTrabalho().HasValue ? "-" : ValidationHelper.GetDescription(perfil1.get_DistanciaResidenciaTrabalho()));
- description11[46] = str317;
- description11[47] = "</p></td></tr><tr><td bgcolor='";
- str318 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- description11[48] = str318;
- description11[49] = "' colspan='2'><p align='left'><b>USO PROFISSIONAL: </b>";
- str319 = (!perfil1.get_UsoProfissional().HasValue || !perfil1.get_UsoProfissional().Value ? "NÃO" : "SIM");
- description11[50] = str319;
- description11[51] = "</p></td><td bgcolor='";
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str320 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- description11[52] = str320;
- description11[53] = "'><p align='left'><b>USO POR DEPENDENTES: </b>";
- str321 = (!perfil1.get_UsoDependentes().HasValue ? "-" : ValidationHelper.GetDescription(perfil1.get_UsoDependentes()));
- description11[54] = str321;
- description11[55] = "</p></td></tr><tr><td bgcolor='";
- str322 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- description11[56] = str322;
- description11[57] = "' colspan='3'><p align='left'><b>ISENÇÃO DE IMPOSTOS: </b>";
- str323 = (!perfil1.get_Isencao().HasValue || !perfil1.get_Isencao().Value ? "NÃO" : "SIM");
- description11[58] = str323;
- description11[59] = "</p></td></tr></font></table>";
- str371 = string.Concat(description11);
- }
- }
- list = items1.ToList<Item>();
- if (list.Count != 0)
- {
- num10 = 0;
- foreach (Item item5 in list)
- {
- if (item5.get_Sinistros().Count > 0)
- {
- item1 = item5;
- controleSinistros = await (new SinistroServico()).BuscarControles(item5.get_Id());
- item1.set_Sinistros(controleSinistros);
- item1 = null;
- }
- string str398 = str371;
- str262 = (!this.SepararPagina || !this.SepararPaginaEnabled ? "" : "<div style='page-break-before:always;'>");
- str371 = string.Concat(str398, str262);
- string str399 = str371;
- str263 = (this.SelectedTipoExtrato != 2 || list.IndexOf(item5) == 0 ? "<br>" : "");
- str371 = string.Concat(str399, str263);
- str371 = string.Concat(str371, "<table border='1' bordercolor='#ededed' width='999'>");
- str371 = string.Concat(str371, "<style> td > p { margin: 2px; }</style>");
- str371 = string.Concat(str371, "<font face='Verdana' style='font-size: 12pt; position: absolute; top: 50 %; -moz-transform: translateY(-50 %); -webkit-transform: translateY(-50 %); transform: translateY(-50 %)'><tr>");
- if (this.SelectedTipoExtrato != 2)
- {
- id = documento3.get_Controle().get_Ramo().get_Id();
- if (id > (long)5)
- {
- if (id == (long)15 || id == (long)18)
- {
- goto Label8;
- }
- if (id == (long)37)
- {
- goto Label6;
- }
- goto Label7;
- }
- else
- {
- if (id - (long)1 <= (long)2)
- {
- goto Label8;
- }
- if (id == (long)5)
- {
- goto Label6;
- }
- goto Label7;
- }
- Label8:
- item1 = item5;
- patrimonial = await (new ItemServico()).BuscaPatrimonial(item5.get_Id());
- item1.set_Patrimonial(patrimonial);
- item1 = null;
- string[] estado1 = new string[19];
- estado1[0] = str371;
- estado1[1] = "<td bgcolor='";
- str264 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- estado1[2] = str264;
- estado1[3] = "' colspan='4'><p align='left'><b>";
- estado1[4] = string.Format("ITEM {0}: ", item5.get_Ordem());
- estado1[5] = "</b>";
- estado1[6] = item5.get_Patrimonial().get_Endereco();
- estado1[7] = ", ";
- estado1[8] = item5.get_Patrimonial().get_Numero();
- estado1[9] = ", ";
- str265 = (string.IsNullOrWhiteSpace(item5.get_Patrimonial().get_Complemento()) ? "" : string.Concat(item5.get_Patrimonial().get_Complemento(), ", "));
- estado1[10] = str265;
- estado1[11] = item5.get_Patrimonial().get_Bairro();
- estado1[12] = " - ";
- estado1[13] = item5.get_Patrimonial().get_Cidade();
- estado1[14] = " - ";
- estado1[15] = item5.get_Patrimonial().get_Estado();
- estado1[16] = " - ";
- estado1[17] = item5.get_Patrimonial().get_Cep();
- estado1[18] = "</p></td>";
- str371 = string.Concat(estado1);
- }
- else
- {
- string[] descricao3 = new string[] { str371, "<td bgcolor='", null, null, null, null, null, null };
- str298 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- descricao3[2] = str298;
- descricao3[3] = "'><p align='left'><b>";
- descricao3[4] = string.Format("ITEM {0}: ", item5.get_Ordem());
- descricao3[5] = "</b>";
- descricao3[6] = item5.get_Descricao();
- descricao3[7] = "</p></td>";
- str371 = string.Concat(descricao3);
- }
- Label10:
- if (item5.get_Sinistros().Count > 0)
- {
- Item item6 = item5;
- if (item6 != null)
- {
- IList<ControleSinistro> controleSinistros3 = item6.get_Sinistros();
- if (controleSinistros3 != null)
- {
- ControleSinistro controleSinistro3 = controleSinistros3.LastOrDefault<ControleSinistro>();
- if (controleSinistro3 != null)
- {
- List<Sinistro> sinistros4 = controleSinistro3.get_Sinistros();
- if (sinistros4 != null)
- {
- Sinistro sinistro5 = sinistros4.LastOrDefault<Sinistro>();
- if (sinistro5 != null)
- {
- dataReclamacao1 = sinistro5.get_DataReclamacao();
- }
- else
- {
- clienteDesde = null;
- dataReclamacao1 = clienteDesde;
- }
- }
- else
- {
- clienteDesde = null;
- dataReclamacao1 = clienteDesde;
- }
- }
- else
- {
- clienteDesde = null;
- dataReclamacao1 = clienteDesde;
- }
- }
- else
- {
- clienteDesde = null;
- dataReclamacao1 = clienteDesde;
- }
- }
- else
- {
- clienteDesde = null;
- dataReclamacao1 = clienteDesde;
- }
- DateTime? nullable4 = dataReclamacao1;
- if (nullable4.HasValue)
- {
- date = nullable4.Value;
- shortDateString15 = date.ToShortDateString();
- }
- else
- {
- shortDateString15 = "-";
- }
- string str400 = shortDateString15;
- string[] currency1 = new string[14];
- currency1[0] = str371;
- currency1[1] = "</tr><td bgcolor='";
- numeroParcela = num10 + 1;
- num10 = numeroParcela;
- str292 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- currency1[2] = str292;
- currency1[3] = "' colspan='2'><p align='left'><b>SINISTRO STATUS: </b>";
- currency1[4] = ValidationHelper.GetDescription(item5.get_Sinistros().LastOrDefault<ControleSinistro>().get_Sinistros().LastOrDefault<Sinistro>().get_StatusSinistro());
- currency1[5] = "</p></td><td bgcolor='";
- str293 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- currency1[6] = str293;
- currency1[7] = "'><p align='left'><b>DATA: </b>";
- currency1[8] = str400;
- currency1[9] = "</p></td><td bgcolor='";
- str294 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- currency1[10] = str294;
- currency1[11] = "'><p align='left'><b>VALOR: </b>";
- currency1[12] = ValidationHelper.ToCurrency<decimal>(item5.get_Sinistros().LastOrDefault<ControleSinistro>().get_Sinistros().LastOrDefault<Sinistro>().get_Valor(), "pt-BR");
- currency1[13] = "</p></td>";
- str371 = string.Concat(currency1);
- }
- str371 = string.Concat(str371, "</tr>");
- if (this.SelectedTipoExtrato != 2)
- {
- string[] strArrays57 = new string[] { str371, "<tr><td bgcolor='", null, null, null, null };
- numeroParcela = num10 + 1;
- num10 = numeroParcela;
- str271 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays57[2] = str271;
- strArrays57[3] = "' colspan='4'><p align='left'><b>ATIVO: </b>";
- str272 = (!item5.get_Substituido().HasValue ? "SIM" : "NÃO");
- strArrays57[4] = str272;
- strArrays57[5] = "</p></td></tr>";
- str371 = string.Concat(strArrays57);
- id = documento3.get_Controle().get_Ramo().get_Id();
- long num17 = id - (long)1;
- if (num17 <= (long)58)
- {
- switch ((uint)num17)
- {
- case 0:
- case 1:
- case 2:
- case 14:
- case 17:
- {
- if (!this.ObsItem || !this.ObsItemEnabled)
- {
- break;
- }
- string[] strArrays58 = new string[] { str371, "<tr><td bgcolor='", null, null, null, null };
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str273 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays58[2] = str273;
- strArrays58[3] = "' colspan='3'><p align='left'><b>OBSERVAÇÕES: </b>";
- str274 = (string.IsNullOrWhiteSpace(item5.get_Patrimonial().get_Bens()) ? "-" : item5.get_Patrimonial().get_Bens());
- strArrays58[4] = str274;
- strArrays58[5] = "</p></td></tr>";
- str371 = string.Concat(strArrays58);
- break;
- }
- case 3:
- case 7:
- case 15:
- case 16:
- case 18:
- case 22:
- case 23:
- case 25:
- case 27:
- case 30:
- case 32:
- case 38:
- case 40:
- case 43:
- case 48:
- case 58:
- {
- item1 = item5;
- riscosDiverso = await (new ItemServico()).BuscaRiscosDiversos(item5.get_Id());
- item1.set_RiscosDiversos(riscosDiverso);
- item1 = null;
- if (!this.ObsItem || !this.ObsItemEnabled)
- {
- break;
- }
- string[] strArrays59 = new string[] { str371, "<tr><td bgcolor='", null, null, null, null };
- str275 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays59[2] = str275;
- strArrays59[3] = "' colspan='3'><p align='left'><b>OBSERVAÇÕES: </b>";
- str276 = (string.IsNullOrWhiteSpace(item5.get_RiscosDiversos().get_Observacao()) ? "-" : item5.get_RiscosDiversos().get_Observacao());
- strArrays59[4] = str276;
- strArrays59[5] = "</p></td></tr>";
- str371 = string.Concat(strArrays59);
- break;
- }
- case 4:
- case 36:
- {
- if (this.ObsItem && this.ObsItemEnabled)
- {
- string[] strArrays60 = new string[] { str371, "<tr><td bgcolor='", null, null, null, null };
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str285 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays60[2] = str285;
- strArrays60[3] = "' colspan='3'><p align='left'><b>OBSERVAÇÕES: </b>";
- str286 = (string.IsNullOrWhiteSpace(item5.get_Auto().get_Observacao()) ? "-" : item5.get_Auto().get_Observacao());
- strArrays60[4] = str286;
- strArrays60[5] = "</p></td></tr>";
- str371 = string.Concat(strArrays60);
- }
- string[] strArrays61 = new string[26];
- strArrays61[0] = str371;
- strArrays61[1] = "<tr><td bgcolor='";
- numeroParcela = num10 + 1;
- num10 = numeroParcela;
- str277 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays61[2] = str277;
- strArrays61[3] = "' colspan='2'><p align='left'><b>COBERTURA PADRÃO: </b>";
- tipoCobertura = item5.get_Auto().get_TipoCobertura();
- if (tipoCobertura.HasValue)
- {
- description3 = ValidationHelper.GetDescription(tipoCobertura.GetValueOrDefault());
- }
- else
- {
- description3 = null;
- }
- strArrays61[4] = description3;
- strArrays61[5] = "</p></td><td bgcolor='";
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str278 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays61[6] = str278;
- strArrays61[7] = "' colspan='2'><p align='left'><b>BÔNUS: </b>";
- bonus = item5.get_Auto().get_Bonus();
- strArrays61[8] = bonus.ToString();
- strArrays61[9] = "</p></td></tr><tr><td bgcolor='";
- str279 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays61[10] = str279;
- strArrays61[11] = "'><p align='left'><b>REGIÃO DE CIRCULAÇÃO: </b>";
- str280 = (string.IsNullOrWhiteSpace(item5.get_Auto().get_RegiaoCirculacao()) ? "-" : item5.get_Auto().get_RegiaoCirculacao());
- strArrays61[12] = str280;
- strArrays61[13] = "</p></td><td bgcolor='";
- str281 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays61[14] = str281;
- strArrays61[15] = "'><p align='left'><b>TABELA DE REFERÊNCIA: </b>";
- tabelaReferencia = item5.get_Auto().get_TabelaReferencia();
- if (tabelaReferencia.HasValue)
- {
- description4 = ValidationHelper.GetDescription(tabelaReferencia.GetValueOrDefault());
- }
- else
- {
- description4 = null;
- }
- strArrays61[16] = description4;
- strArrays61[17] = "</p></td><td bgcolor='";
- str282 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays61[18] = str282;
- strArrays61[19] = "'><p align='left'><b>FIPE: </b>";
- str283 = (string.IsNullOrWhiteSpace(item5.get_Auto().get_Fipe()) ? "-" : item5.get_Auto().get_Fipe());
- strArrays61[20] = str283;
- strArrays61[21] = "</p></td><td bgcolor='";
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- str284 = (numeroParcela % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays61[22] = str284;
- strArrays61[23] = "'><p align='left'><b>% DE REFERÊNCIA: </b>";
- strArrays61[24] = string.Format("{0}%", item5.get_Auto().get_PorcentagemReferencia());
- strArrays61[25] = "</p></td></tr></tr>";
- str371 = string.Concat(strArrays61);
- break;
- }
- case 5:
- case 6:
- case 8:
- case 9:
- case 52:
- {
- item1 = item5;
- vida = await (new ItemServico()).BuscaVida(item5.get_Id());
- item1.set_Vida(vida);
- item1 = null;
- if (!item5.get_Sinistrado() || !this.BeneficiariosItens || !this.BeneficiariosItensEnabled)
- {
- break;
- }
- string str401 = str371;
- str287 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- str371 = string.Concat(str401, "<tr><td bgcolor='", str287, "' colspan='3'><p align='left'><b>BENEFICIÁRIOS: </b>");
- string str402 = "";
- foreach (ControleSinistro controleSinistro4 in item5.get_Sinistros())
- {
- if (controleSinistro4.get_Sinistros() == null)
- {
- continue;
- }
- foreach (Sinistro sinistro6 in controleSinistro4.get_Sinistros())
- {
- if (string.IsNullOrWhiteSpace(sinistro6.get_SinistroVida().get_Beneficiario()))
- {
- continue;
- }
- str402 = string.Concat(str402, sinistro6.get_SinistroVida().get_Beneficiario(), ", ");
- }
- }
- if (!string.IsNullOrWhiteSpace(str402))
- {
- int num18 = str402.LastIndexOf(", ", StringComparison.Ordinal);
- str402 = str402.Remove(num18, 2).Insert(num18, ".");
- }
- str371 = string.Concat(str371, str402, "</p></td></tr>");
- break;
- }
- case 12:
- {
- item1 = item5;
- aeronautico = await (new ItemServico()).BuscaAeronautico(item5.get_Id());
- item1.set_Aeronautico(aeronautico);
- item1 = null;
- if (!this.ObsItem || !this.ObsItemEnabled)
- {
- break;
- }
- string[] strArrays62 = new string[] { str371, "<tr><td bgcolor='", null, null, null, null };
- str288 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays62[2] = str288;
- strArrays62[3] = "' colspan='3'><p align='left'><b>OBSERVAÇÕES: </b>";
- str289 = (string.IsNullOrWhiteSpace(item5.get_Aeronautico().get_Observacao()) ? "-" : item5.get_Aeronautico().get_Observacao());
- strArrays62[4] = str289;
- strArrays62[5] = "</p></td></tr>";
- str371 = string.Concat(strArrays62);
- break;
- }
- case 19:
- {
- item1 = item5;
- granizo = await (new ItemServico()).BuscaGranizo(item5.get_Id());
- item1.set_Granizo(granizo);
- item1 = null;
- if (!this.ObsItem || !this.ObsItemEnabled)
- {
- break;
- }
- string[] strArrays63 = new string[] { str371, "<tr><td bgcolor='", null, null, null, null };
- str290 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays63[2] = str290;
- strArrays63[3] = "' colspan='3'><p align='left'><b>OBSERVAÇÕES: </b>";
- str291 = (string.IsNullOrWhiteSpace(item5.get_Granizo().get_Observacao()) ? "-" : item5.get_Granizo().get_Observacao());
- strArrays63[4] = str291;
- strArrays63[5] = "</p></td></tr>";
- str371 = string.Concat(strArrays63);
- break;
- }
- }
- }
- else
- {
- }
- }
- str371 = string.Concat(str371, "</font></table>");
- if (this.SelectedTipoExtrato != 2)
- {
- ObservableCollection<Cobertura> observableCollection6 = await (new ItemServico()).BuscarCoberturasPorItemAsync(item5.get_Id());
- if (observableCollection6.Count > 0 && this.Coberturas)
- {
- str371 = string.Concat(str371, "<br><table border='1' bordercolor='#ededed' width='999'><font face='Verdana' style='font-size: 12pt; position: absolute; top: 50 %; -moz-transform: translateY(-50 %); -webkit-transform: translateY(-50 %); transform: translateY(-50 %)'><tr><td bgcolor='WhiteSmoke'><p align='left'><b><div align='left'>COBERTURA</div></b></p></td><td bgcolor='WhiteSmoke'><p align='left'><b><div align='left'>FRANQUIA</div></b></p></td><td bgcolor='WhiteSmoke'><p align='left'><b><div align='left'>LMI</div></b></p></td><td bgcolor='WhiteSmoke'><p align='left'><b><div align='left'>PRÊMIO</div></b></p></td></tr>");
- foreach (Cobertura cobertura1 in observableCollection6)
- {
- numeroParcela = num10;
- num10 = numeroParcela + 1;
- string[] strArrays64 = new string[18];
- strArrays64[0] = str371;
- strArrays64[1] = "<tr><td bgcolor='";
- str267 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays64[2] = str267;
- strArrays64[3] = "'><p align='left'><div align='left'>";
- strArrays64[4] = cobertura1.get_Observacao();
- strArrays64[5] = "</div></p></td><td style='white-space:nowrap; bgcolor='";
- str268 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays64[6] = str268;
- strArrays64[7] = "'><p align='left'><div align='left'>";
- strArrays64[8] = string.Format("{0:c}", cobertura1.get_Franquia());
- strArrays64[9] = "</div></p></td><td style='white-space:nowrap; bgcolor='";
- str269 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays64[10] = str269;
- strArrays64[11] = "'><p align='left'><div align='left'>";
- strArrays64[12] = string.Format("{0:c}", cobertura1.get_Lmi());
- strArrays64[13] = "</div></p></td><td style='white-space:nowrap; bgcolor='";
- str270 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays64[14] = str270;
- strArrays64[15] = "'><p align='left'><div align='left'>";
- strArrays64[16] = string.Format("{0:c}", cobertura1.get_Premio());
- strArrays64[17] = "</div></p></td></tr>";
- str371 = string.Concat(strArrays64);
- }
- str371 = string.Concat(str371, "</font></table>");
- }
- string str403 = str371;
- str266 = (!this.SepararPagina || !this.SepararPaginaEnabled ? "" : "</div>");
- str371 = string.Concat(str403, str266);
- }
- if (this.SelectedTipoExtrato != 2)
- {
- num10 = 0;
- }
- }
- }
- else
- {
- str371 = string.Concat(str371, "<br><p align='center'><b>ESTA APÓLICE NÃO POSSUI ITENS</b></p>");
- }
- list = null;
- }
- else
- {
- variable9 = null;
- return;
- }
- }
- }
- nums.Add(documento3.get_Controle().get_Id());
- flag1 = false;
- }
- }
- if (this.Prospeccoes != null && this.Prospeccoes.Count > 0)
- {
- foreach (Prospeccao prospecco in this.Prospeccoes)
- {
- int num19 = 0;
- string str404 = str371;
- str19 = (this.ClientePorPaginaVisibility != Visibility.Visible || !this.ClientePorPagina || !this.ClientePorPaginaEnabled ? "" : "<div style='page-break-before:always;'>");
- str371 = string.Concat(str404, str19);
- str371 = string.Concat(str371, "<table border='0' width='999'><td height='20' width='999' bgcolor='black'><h4 style='text-align: center; color: white; background-color: black'>");
- if (this.SelectedTipoExtrato == null)
- {
- str39 = (this.ExtratoResumido ? " RESUMIDO" : "");
- str370 = string.Concat("EXTRATO", str39, " DO CLIENTE: ", prospecco.get_Nome());
- }
- str371 = string.Concat(str371, str370, "</h4></td></table><br>");
- str371 = string.Concat(str371, "<style>td > p {margin: 2px;}</style>");
- if (!this.ExtratoResumido)
- {
- string str405 = "NASCIMENTO";
- string[] documento11 = new string[16];
- documento11[0] = str371;
- documento11[1] = "<table border='1' bordercolor='#ededed' width='999'><font face='Verdana' style='font-size: 12pt; position: absolute; top: 50 %; -moz-transform: translateY(-50 %); -webkit-transform: translateY(-50 %); transform: translateY(-50 %)'><tr><td width='333' bgcolor='";
- str20 = (num19 % 2 == 0 ? "WhiteSmoke" : "White");
- documento11[2] = str20;
- documento11[3] = "'><p align='left'><b>CLIENTE: </b>";
- documento11[4] = prospecco.get_Nome();
- documento11[5] = "</p></td><td width='222' bgcolor='";
- str21 = (num19 % 2 == 0 ? "WhiteSmoke" : "White");
- documento11[6] = str21;
- documento11[7] = "'><p align='left' x-ms-format-detection='none'><b>CPF/CNPJ: </b>";
- documento11[8] = prospecco.get_Documento();
- documento11[9] = "</p></td><td width='222' bgcolor='";
- str22 = (num19 % 2 == 0 ? "WhiteSmoke" : "White");
- documento11[10] = str22;
- documento11[11] = "'><p align='left'><b>";
- documento11[12] = str405;
- documento11[13] = ": </b>";
- clienteDesde = prospecco.get_Nascimento();
- if (clienteDesde.HasValue)
- {
- shortDateString = clienteDesde.GetValueOrDefault().ToShortDateString();
- }
- else
- {
- shortDateString = null;
- }
- documento11[14] = shortDateString;
- documento11[15] = "</p></td></tr>";
- str371 = string.Concat(documento11);
- if ((prospecco.get_Telefone1() != null || prospecco.get_Email() != null) && this.SelectedTipoExtrato != 2)
- {
- str371 = string.Concat(str371, "<tr>");
- if (prospecco.get_Telefone1() != null)
- {
- string str406 = "";
- string[] prefixo1 = new string[] { str406, "<br> (", prospecco.get_Prefixo1(), ") ", prospecco.get_Telefone1() };
- str406 = string.Concat(prefixo1);
- if (prospecco.get_Telefone2() != null)
- {
- string[] prefixo2 = new string[] { str406, "<br> (", prospecco.get_Prefixo2(), ") ", prospecco.get_Telefone2() };
- str406 = string.Concat(prefixo2);
- }
- string[] strArrays65 = new string[] { str371, "<td bgcolor='", null, null, null, null };
- str28 = (num19 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays65[2] = str28;
- strArrays65[3] = "' colspan='2'><p align='left'><b>CONTATOS: </b>";
- strArrays65[4] = str406;
- strArrays65[5] = "</p></td>";
- str371 = string.Concat(strArrays65);
- }
- if (prospecco.get_Email() != null && !this.ExtratoResumido)
- {
- string str407 = "";
- str407 = string.Concat(str407, "<br>", prospecco.get_Email());
- string[] strArrays66 = new string[] { str371, "<td bgcolor='", null, null, null, null };
- str27 = (num19 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays66[2] = str27;
- strArrays66[3] = "' colspan='2'><p align='left'><b>EMAILS: </b>";
- strArrays66[4] = str407;
- strArrays66[5] = "</p></td>";
- str371 = string.Concat(strArrays66);
- }
- num19++;
- str371 = string.Concat(str371, "</font></tr>");
- }
- string str408 = str371;
- str23 = (this.ClientePorPaginaVisibility != Visibility.Visible || !this.ClientePorPagina || !this.ClientePorPaginaEnabled ? "" : "</div>");
- str371 = string.Concat(str408, str23);
- if (this.SelectedTipoExtrato != null)
- {
- num19 = 0;
- string[] strArrays67 = new string[] { str371, "<hr style='width:999; border-top: 3px solid #000'><table border='1' bordercolor='#ededed' width='999'><font face='Verdana' style='font-size: 12pt; position: absolute; top: 50 %; -moz-transform: translateY(-50 %); -webkit-transform: translateY(-50 %); transform: translateY(-50 %)'><tr><td width='222' bgcolor='", null, null, null, null };
- int num20 = num19;
- num19 = num20 + 1;
- str24 = (num20 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays67[2] = str24;
- strArrays67[3] = "'><p align='left'><b>VIGÊNCIA FINAL: </b>";
- clienteDesde = prospecco.get_VigenciaFinal();
- if (!clienteDesde.HasValue)
- {
- shortDateString1 = "-";
- }
- else
- {
- clienteDesde = prospecco.get_VigenciaFinal();
- if (clienteDesde.HasValue)
- {
- shortDateString1 = clienteDesde.GetValueOrDefault().ToShortDateString();
- }
- else
- {
- shortDateString1 = null;
- }
- }
- strArrays67[4] = shortDateString1;
- strArrays67[5] = "</p></td></tr>";
- str371 = string.Concat(strArrays67);
- string[] strArrays68 = new string[] { str371, "</tr><tr><td bgcolor='", null, null, null, null };
- str25 = (num19 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays68[2] = str25;
- strArrays68[3] = "'><p align='left'><b>VENDEDOR: </b>";
- str26 = (prospecco.get_Vendedor() == null ? "-" : prospecco.get_Vendedor().get_Nome());
- strArrays68[4] = str26;
- strArrays68[5] = "</p></td></tr>";
- str371 = string.Concat(strArrays68);
- str371 = string.Concat(str371, "</font></table>");
- }
- else
- {
- variable9 = null;
- return;
- }
- }
- else
- {
- string[] documento12 = new string[] { str371, "<table border='1' bordercolor='#ededed' width='999'><font face='Verdana' style='font-size: 12pt; position: absolute; top: 50 %; -moz-transform: translateY(-50 %); -webkit-transform: translateY(-50 %); transform: translateY(-50 %)'><tr><td width='333' bgcolor='", null, null, null, null, null, null, null, null };
- str29 = (num19 % 2 == 0 ? "WhiteSmoke" : "White");
- documento12[2] = str29;
- documento12[3] = "'><p align='left'><b>CLIENTE: </b>";
- documento12[4] = prospecco.get_Nome();
- documento12[5] = "</p></td><td width='222' bgcolor='";
- int num21 = num19;
- num19 = num21 + 1;
- str30 = (num21 % 2 == 0 ? "WhiteSmoke" : "White");
- documento12[6] = str30;
- documento12[7] = "' colspan='2'><p align='left' x-ms-format-detection='none'><b>CPF/CNPJ: </b>";
- documento12[8] = prospecco.get_Documento();
- documento12[9] = "</p></td></tr>";
- str371 = string.Concat(documento12);
- if (this.SelectedTipoExtrato != 2)
- {
- str371 = string.Concat(str371, "<tr>");
- string str409 = "";
- if (prospecco.get_Telefone1() != null)
- {
- string[] prefixo11 = new string[] { str409, "<br> (", prospecco.get_Prefixo1(), ") ", prospecco.get_Telefone1() };
- str409 = string.Concat(prefixo11);
- }
- if (prospecco.get_Telefone2() != null)
- {
- string[] prefixo21 = new string[] { str409, "<br> (", prospecco.get_Prefixo2(), ") ", prospecco.get_Telefone2() };
- str409 = string.Concat(prefixo21);
- }
- string[] strArrays69 = new string[] { str371, "<td bgcolor='", null, null, null, null };
- str35 = (num19 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays69[2] = str35;
- strArrays69[3] = "'><p align='left'><b>CONTATOS: </b>";
- str36 = (string.IsNullOrEmpty(str409) ? "-" : str409);
- strArrays69[4] = str36;
- strArrays69[5] = "</p></td>";
- str371 = string.Concat(strArrays69);
- string str410 = "";
- if (prospecco.get_Email() != null)
- {
- str410 = string.Concat("<br>", prospecco.get_Email());
- }
- string[] strArrays70 = new string[] { str371, "<td bgcolor='", null, null, null, null };
- str37 = (num19 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays70[2] = str37;
- strArrays70[3] = "'><p align='left'><b>EMAILS: </b>";
- str38 = (string.IsNullOrEmpty(str410) ? "-" : str410);
- strArrays70[4] = str38;
- strArrays70[5] = "</p></td>";
- str371 = string.Concat(strArrays70);
- }
- str371 = string.Concat(str371, "</font></table>");
- string str411 = str371;
- str31 = (this.ClientePorPaginaVisibility != Visibility.Visible || !this.ClientePorPagina || !this.ClientePorPaginaEnabled ? "" : "</div>");
- str371 = string.Concat(str411, str31);
- if (this.SelectedTipoExtrato != null)
- {
- num19 = 0;
- string[] strArrays71 = new string[] { str371, "<hr style='width:999; border-top: 3px solid #000'><table border='1' bordercolor='#ededed' width='999'><font face='Verdana' style='font-size: 12pt; position: absolute; top: 50 %; -moz-transform: translateY(-50 %); -webkit-transform: translateY(-50 %); transform: translateY(-50 %)'><tr><td width='222' bgcolor='", null, null, null, null };
- int num22 = num19;
- num19 = num22 + 1;
- str32 = (num22 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays71[2] = str32;
- strArrays71[3] = "'><p align='left'><b>VIGÊNCIA FINAL: </b>";
- clienteDesde = prospecco.get_VigenciaFinal();
- if (!clienteDesde.HasValue)
- {
- shortDateString2 = "-";
- }
- else
- {
- clienteDesde = prospecco.get_VigenciaFinal();
- if (clienteDesde.HasValue)
- {
- shortDateString2 = clienteDesde.GetValueOrDefault().ToShortDateString();
- }
- else
- {
- shortDateString2 = null;
- }
- }
- strArrays71[4] = shortDateString2;
- strArrays71[5] = "</p></td></tr>";
- str371 = string.Concat(strArrays71);
- string[] strArrays72 = new string[] { str371, "</tr><tr><td bgcolor='", null, null, null, null };
- int num23 = num19;
- num19 = num23 + 1;
- str33 = (num23 % 2 == 0 ? "WhiteSmoke" : "White");
- strArrays72[2] = str33;
- strArrays72[3] = "' colspan='3'><p align='left'><b>VENDEDOR: </b>";
- str34 = (prospecco.get_Vendedor() == null ? "-" : prospecco.get_Vendedor().get_Nome());
- strArrays72[4] = str34;
- strArrays72[5] = "</p></td></tr>";
- str371 = string.Concat(strArrays72);
- str371 = string.Concat(str371, "</font></table>");
- }
- else
- {
- variable9 = null;
- return;
- }
- }
- }
- }
- DateTime dateTime = Funcoes.GetNetworkTime();
- string[] shortDateString20 = new string[] { str371, "<br><font face='Verdana' size='1'><br>", Recursos.Usuario.get_Nome(), " - ", null, null };
- date = dateTime.Date;
- shortDateString20[4] = date.ToShortDateString();
- shortDateString20[5] = "</font></div><script src='https://code.jquery.com/jquery-3.3.1.slim.min.js' integrity='sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo' crossorigin='anonymous'></script><script src='https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js' integrity='sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1' crossorigin='anonymous'></script><script src='https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js' integrity='sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM' crossorigin='anonymous'></script></body></html>";
- str371 = string.Concat(shortDateString20);
- string tempPath1 = Path.GetTempPath();
- string str412 = string.Format("{0}{1}_{2:ddMMyyyyhhmmss}.html", tempPath1, (TipoExtrato)0, dateTime);
- if (!pdf)
- {
- StreamWriter streamWriter1 = new StreamWriter(str412, true, Encoding.UTF8);
- streamWriter1.Write(str371);
- streamWriter1.Close();
- }
- else
- {
- str412 = string.Format("{0}{1}_{2:ddMMyyyyhhmmss}.pdf", tempPath1, (TipoExtrato)0, dateTime);
- File.WriteAllBytes(str412, (new NRecoHtmlToPdfConverter()).GeneratePdf(str371));
- }
- Process.Start(str412);
- if (this.Documentos != null && this.Documentos.Count > 1)
- {
- ExtratosViewModel extratosViewModel1 = this;
- str17 = (this.ExtratoResumido ? " RESUMIDO" : "");
- if (this.Documentos != null)
- {
- str18 = (this.Documentos.Count > 1 ? string.Format("DE {0} DOCUMENTOS", this.Documentos.Count) : string.Format("DO DOCUMENTO {0}", this.Documentos[0].get_Id()));
- }
- else
- {
- str18 = "";
- }
- string str413 = string.Concat("GEROU O EXTRATO", str17, " ", str18);
- long num24 = (long)0;
- TipoTela? nullable5 = new TipoTela?(23);
- List<Documento> documentos3 = this.Documentos;
- extratosViewModel1.RegistrarAcao(str413, num24, nullable5, string.Concat("IDS DOS DOCUMENTOS:\n", string.Join<long>("\n",
- from x in documentos3
- select x.get_Id()), this.GerarOpcoes()));
- }
- if (this.Prospeccoes != null && this.Prospeccoes.Count > 1)
- {
- ExtratosViewModel extratosViewModel2 = this;
- str15 = (this.ExtratoResumido ? " RESUMIDO" : "");
- if (this.Prospeccoes != null)
- {
- str16 = (this.Prospeccoes.Count > 1 ? string.Format("DE {0} PROSPECÇÕES", this.Prospeccoes.Count) : string.Format("DA PROSPÇÃO{0}", this.Prospeccoes[0].get_Id()));
- }
- else
- {
- str16 = "";
- }
- string str414 = string.Concat("GEROU O EXTRATO", str15, " ", str16);
- long num25 = (long)0;
- TipoTela? nullable6 = new TipoTela?(23);
- List<Prospeccao> prospeccoes = this.Prospeccoes;
- extratosViewModel2.RegistrarAcao(str414, num25, nullable6, string.Concat("IDS DOS DOCUMENTOS:\n", string.Join<long>("\n",
- from x in prospeccoes
- select x.get_Id()), this.GerarOpcoes()));
- }
- this.Documentos = null;
- this.Clientes = null;
- this.Prospeccoes = null;
- nums = null;
- }
- variable9 = null;
- return;
- Label3:
- item1 = item;
- auto = await (new ItemServico()).BuscaAuto(item.get_Id());
- item1.set_Auto(auto);
- item1 = null;
- string[] modelo = new string[26];
- modelo[0] = str371;
- modelo[1] = "<td bgcolor='";
- str111 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- modelo[2] = str111;
- modelo[3] = "' colspan='4'><p align='left'><b>";
- modelo[4] = string.Format("ITEM {0}: ", item.get_Ordem());
- modelo[5] = "</b><br>";
- Fabricante fabricante = item.get_Auto().get_Fabricante();
- if (fabricante != null)
- {
- descricao = fabricante.get_Descricao();
- }
- else
- {
- descricao = null;
- }
- modelo[6] = descricao;
- modelo[7] = " ";
- modelo[8] = item.get_Auto().get_Modelo();
- modelo[9] = " (";
- modelo[10] = item.get_Auto().get_AnoFabricacao();
- modelo[11] = "/";
- modelo[12] = item.get_Auto().get_AnoModelo();
- modelo[13] = ")<br>PLACA: ";
- modelo[14] = item.get_Auto().get_Placa();
- modelo[15] = ", CHASSI: ";
- modelo[16] = item.get_Auto().get_Chassi();
- modelo[17] = "<br>C.I.: ";
- modelo[18] = item.get_Auto().get_Ci();
- modelo[19] = ", RENAVAM: ";
- modelo[20] = item.get_Auto().get_Renavam();
- modelo[21] = ", CEP PERNOITE: ";
- modelo[22] = item.get_Auto().get_CepPernoite();
- modelo[23] = "<br>FINANCIADO: ";
- str112 = (item.get_Auto().get_Financiado().GetValueOrDefault() ? "SIM" : "NÃO");
- modelo[24] = str112;
- modelo[25] = "</p></td>";
- str371 = string.Concat(modelo);
- goto Label9;
- Label4:
- string[] descricao4 = new string[] { str371, "<td bgcolor='", null, null, null, null, null, null, null, null };
- str113 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- descricao4[2] = str113;
- descricao4[3] = "' colspan='4'><p align='left'><b>";
- descricao4[4] = string.Format("ITEM {0}: ", item.get_Ordem());
- descricao4[5] = "</b>";
- descricao4[6] = item.get_Descricao();
- descricao4[7] = "</p>QTDE SINISTRO(S): </b>";
- numeroParcela = item.get_Sinistros().Count;
- descricao4[8] = numeroParcela.ToString();
- descricao4[9] = "</p></td>";
- str371 = string.Concat(descricao4);
- goto Label9;
- Label6:
- item1 = item;
- auto = await (new ItemServico()).BuscaAuto(item.get_Id());
- item1.set_Auto(auto);
- item1 = null;
- string[] anoFabricacao = new string[26];
- anoFabricacao[0] = str371;
- anoFabricacao[1] = "<td bgcolor='";
- str295 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- anoFabricacao[2] = str295;
- anoFabricacao[3] = "' colspan='4'><p align='left'><b>";
- anoFabricacao[4] = string.Format("ITEM {0}: ", item.get_Ordem());
- anoFabricacao[5] = "</b><br>";
- Fabricante fabricante1 = item.get_Auto().get_Fabricante();
- if (fabricante1 != null)
- {
- descricao1 = fabricante1.get_Descricao();
- }
- else
- {
- descricao1 = null;
- }
- anoFabricacao[6] = descricao1;
- anoFabricacao[7] = " ";
- anoFabricacao[8] = item.get_Auto().get_Modelo();
- anoFabricacao[9] = " (";
- anoFabricacao[10] = item.get_Auto().get_AnoFabricacao();
- anoFabricacao[11] = "/";
- anoFabricacao[12] = item.get_Auto().get_AnoModelo();
- anoFabricacao[13] = ")<br>PLACA: ";
- anoFabricacao[14] = item.get_Auto().get_Placa();
- anoFabricacao[15] = ", CHASSI: ";
- anoFabricacao[16] = item.get_Auto().get_Chassi();
- anoFabricacao[17] = "<br>C.I.: ";
- anoFabricacao[18] = item.get_Auto().get_Ci();
- anoFabricacao[19] = ", RENAVAM: ";
- anoFabricacao[20] = item.get_Auto().get_Renavam();
- anoFabricacao[21] = ", CEP PERNOITE: ";
- anoFabricacao[22] = item.get_Auto().get_CepPernoite();
- anoFabricacao[23] = "<br>FINANCIADO: ";
- str296 = (item.get_Auto().get_Financiado().GetValueOrDefault() ? "SIM" : "NÃO");
- anoFabricacao[24] = str296;
- anoFabricacao[25] = "</p></td>";
- str371 = string.Concat(anoFabricacao);
- goto Label10;
- Label7:
- string[] descricao5 = new string[] { str371, "<td bgcolor='", null, null, null, null, null, null };
- str297 = (num10 % 2 == 0 ? "WhiteSmoke" : "White");
- descricao5[2] = str297;
- descricao5[3] = "' colspan='4'><p align='left'><b>";
- descricao5[4] = string.Format("ITEM {0}: ", item.get_Ordem());
- descricao5[5] = "</b>";
- descricao5[6] = item.get_Descricao();
- descricao5[7] = "</p></td>";
- str371 = string.Concat(descricao5);
- goto Label10;
- }
-
- public string GerarOpcoes()
- {
- string str = "";
- if (this.ClienteVisibility && this.ObsCliente && this.ObsClienteEnabled)
- {
- str = string.Concat(str, "\nOBSERVAÇÕES DO CLIENTE");
- }
- if (this.ClientePorPaginaVisibility == Visibility.Visible && this.ClientePorPagina && this.ClientePorPaginaEnabled)
- {
- str = string.Concat(str, "\nSEPARAR CLIENTES POR PÁGINA");
- }
- if (this.DocumentoVisibility)
- {
- if (this.ComissaoDocumentoEnabled && this.ComissaoDocumento)
- {
- str = string.Concat(str, "\nCOMISSÕES DO DOCUMENTO");
- }
- if (this.ObsApoliceEnabled && this.ObsApolice)
- {
- str = string.Concat(str, "\nOBSERVAÇÕES DA APÓLICE");
- }
- if (this.SegurosVigentesVisibility == Visibility.Visible && this.SegurosVigentes)
- {
- str = string.Concat(str, "\nAPENAS SEGUROS VIGENTES");
- }
- }
- if (this.ItemVisibility)
- {
- if (this.SelecionarItensVisibility == Visibility.Visible && this.SelecionarItens)
- {
- str = string.Concat(str, "\nSELECIONAR ITENS");
- }
- if (this.BeneficiariosItensEnabled && this.BeneficiariosItens)
- {
- str = string.Concat(str, "\nBENEFICIÁRIOS DOS ITENS");
- }
- if (this.ObsItemEnabled && this.ObsItem)
- {
- str = string.Concat(str, "\nOBSERVAÇÕES DO ITEM");
- }
- if (this.SepararPaginaEnabled && this.SepararPagina)
- {
- str = string.Concat(str, "\nSEPARAR ITENS POR PÁGINA");
- }
- }
- if (this.PerfilCondutor && this.PerfilVisibility && this.PerfilCondutorEnabled)
- {
- str = string.Concat(str, "\nPERFIL DO CONDUTOR");
- }
- if (string.IsNullOrWhiteSpace(str))
- {
- return "";
- }
- return string.Concat("\n\nOPÇÕES:", str);
- }
-
- public async Task PrepararExtrato(List<ClientesAtivosInativos> clientes, List<Documento> documentos, List<Prospeccao> prospeccoes, Relatorio? tipoRelatorio = null, List<long> selecionadosDoc = null, List<long> selecionadosPros = null, bool pdf = false)
- {
- ObservableCollection<ClienteEndereco> observableCollection;
- ObservableCollection<ClienteEmail> observableCollection1;
- ObservableCollection<ClienteTelefone> observableCollection2;
- ObservableCollection<MaisContato> observableCollection3;
- ObservableCollection<ClienteVinculo> observableCollection4;
- bool count;
- List<Documento> documentos1;
- bool flag;
- List<Cliente> clientes1;
- Cliente cliente;
- Cliente cliente1;
- List<Documento> documentos2;
- this.Carregando = true;
- Relatorio? nullable = tipoRelatorio;
- if (nullable.GetValueOrDefault() != 0 | !nullable.HasValue && tipoRelatorio.GetValueOrDefault() != 1)
- {
- if ((documentos == null || documentos.Count == 0) && (prospeccoes == null || prospeccoes.Count == 0))
- {
- await base.ShowMessage("É NECESSÁRIO HAVER AO MENOS UM DOCUMENTO OU PROSPECÇÃO", "OK", "", false);
- this.Carregando = false;
- return;
- }
- else
- {
- List<Documento> documentos3 = documentos;
- if (documentos3 != null)
- {
- count = documentos3.Count > 200;
- }
- else
- {
- count = false;
- }
- if (!count)
- {
- List<Prospeccao> prospeccaos = prospeccoes;
- if (prospeccaos != null)
- {
- flag = prospeccaos.Count > 200;
- }
- else
- {
- flag = false;
- }
- if (!flag)
- {
- goto Label1;
- }
- }
- if (!await base.ShowMessage("A SELEÇÃO DE MUITOS EXTRATOS PODE DEMORAR MAIS DE 30 MINUTOS! CONTINUAR?", "SIM", "NÃO", false))
- {
- this.Carregando = false;
- return;
- }
- Label1:
- switch (this.SelectedTipoExtrato)
- {
- case 0:
- {
- if (selecionadosDoc == null || selecionadosDoc.Count == 0)
- {
- await base.ShowMessage("É NECESSÁRIO HAVER AO MENOS UM DOCUMENTO SELECIONADO", "OK", "", false);
- this.Carregando = false;
- return;
- }
- else
- {
- clientes1 = new List<Cliente>();
- foreach (Documento documento in documentos)
- {
- cliente = await (new ClienteServico()).BuscarCliente(documento.get_Controle().get_Cliente().get_Id());
- cliente1 = cliente;
- observableCollection = await this._clienteServico.BuscarEnderecosAsync(cliente.get_Id());
- cliente1.set_Enderecos(observableCollection);
- cliente1 = null;
- cliente1 = cliente;
- observableCollection1 = await this._clienteServico.BuscarEmailsAsync(cliente.get_Id());
- cliente1.set_Emails(observableCollection1);
- cliente1 = null;
- cliente1 = cliente;
- observableCollection2 = await this._clienteServico.BuscarTelefonesAsync(cliente.get_Id());
- cliente1.set_Telefones(observableCollection2);
- cliente1 = null;
- cliente1 = cliente;
- observableCollection3 = await this._clienteServico.BuscarContatosAsync(cliente.get_Id());
- cliente1.set_Contatos(observableCollection3);
- cliente1 = null;
- cliente1 = cliente;
- observableCollection4 = await this._clienteServico.BuscarVinculosAsync(cliente.get_Id());
- cliente1.set_Vinculos(observableCollection4);
- cliente1 = null;
- clientes1.Add(cliente);
- cliente = null;
- }
- this.Clientes = clientes1;
- this.Prospeccoes = prospeccoes;
- break;
- }
- }
- case 1:
- {
- if ((selecionadosDoc == null || selecionadosDoc.Count == 0) && (selecionadosPros == null || selecionadosPros.Count == 0))
- {
- await base.ShowMessage("É NECESSÁRIO HAVER AO MENOS UM DOCUMENTO SELECIONADO", "OK", "", false);
- this.Carregando = false;
- return;
- }
- else
- {
- this.Documentos = new List<Documento>();
- this.Prospeccoes = new List<Prospeccao>();
- if (selecionadosDoc != null)
- {
- foreach (long num in selecionadosDoc)
- {
- Documento documento1 = await (new ApoliceServico()).BuscarApoliceAsync(num, false, true);
- Documento documento2 = documento1;
- documentos1 = (!this.SomenteEndossos || documento2.get_Ordem() == 1 ? new List<Documento>()
- {
- documento2
- } : new List<Documento>());
- List<Documento> documentos4 = documentos1;
- if (this.SomenteEndossos)
- {
- IEnumerable<Documento> documentos5 = documento2.get_Controle().get_Documentos().Where<Documento>((Documento x) => {
- if (x.get_Excluido() || x.get_Ordem() == 0)
- {
- return false;
- }
- return !documentos4.Any<Documento>((Documento y) => y.get_Id() == x.get_Id());
- });
- foreach (Documento documento3 in documentos5)
- {
- documento3.set_Sinistro(documento2.get_Sinistro());
- }
- documentos4.AddRange(documentos5);
- }
- else if (this.Endossos)
- {
- IEnumerable<Documento> documentos6 = documento2.get_Controle().get_Documentos().Where<Documento>((Documento x) => {
- if (x.get_Id() == documento2.get_Id())
- {
- return false;
- }
- return !x.get_Excluido();
- });
- foreach (Documento documento4 in documentos6)
- {
- documento4.set_Sinistro(documento2.get_Sinistro());
- }
- documentos4.AddRange(documentos6);
- }
- if (documento2.get_Controle().get_Documentos().Any<Documento>((Documento x) => {
- if (x.get_Id() == documento2.get_Id() || x.get_Excluido())
- {
- return false;
- }
- return x.get_Ordem() > documento2.get_Ordem();
- }))
- {
- documento2.set_TemEndosso(true);
- }
- List<ConfiguracaoSistema> configuracoes = Recursos.Configuracoes;
- if (configuracoes.Any<ConfiguracaoSistema>((ConfiguracaoSistema x) => x.get_Configuracao() == 31) && documento2.get_TemEndosso())
- {
- Documento documento5 = documento2;
- IList<Documento> documentos7 = documento2.get_Controle().get_Documentos();
- IEnumerable<Documento> excluido =
- from x in documentos7
- where !x.get_Excluido()
- select x;
- documento5.set_PremioTotal(excluido.Sum<Documento>((Documento x) => x.get_PremioTotal()));
- Documento documento6 = documento2;
- IList<Documento> documentos8 = documento2.get_Controle().get_Documentos();
- IEnumerable<Documento> excluido1 =
- from x in documentos8
- where !x.get_Excluido()
- select x;
- documento6.set_Iof(excluido1.Sum<Documento>((Documento x) => x.get_Iof()));
- Documento documento7 = documento2;
- IList<Documento> documentos9 = documento2.get_Controle().get_Documentos();
- IEnumerable<Documento> excluido2 =
- from x in documentos9
- where !x.get_Excluido()
- select x;
- documento7.set_Custo(excluido2.Sum<Documento>((Documento x) => x.get_Custo()));
- Documento documento8 = documento2;
- IList<Documento> documentos10 = documento2.get_Controle().get_Documentos();
- IEnumerable<Documento> excluido3 =
- from x in documentos10
- where !x.get_Excluido()
- select x;
- documento8.set_PremioLiquido(excluido3.Sum<Documento>((Documento x) => x.get_PremioLiquido()));
- Documento documento9 = documento2;
- IList<Documento> documentos11 = documento2.get_Controle().get_Documentos();
- IEnumerable<Documento> excluido4 =
- from x in documentos11
- where !x.get_Excluido()
- select x;
- documento9.set_PremioAdicional(excluido4.Sum<Documento>((Documento x) => x.get_PremioAdicional()));
- }
- List<Documento> documentos12 = this.Documentos;
- List<Documento> documentos13 = documentos4;
- documentos12.AddRange((
- from x in documentos13
- orderby x.get_Ordem()
- select x).ToList<Documento>());
- }
- }
- if (selecionadosPros != null)
- {
- foreach (long selecionadosPro in selecionadosPros)
- {
- Prospeccao prospeccao = await (new ProspeccaoServico()).BuscarProspeccao(selecionadosPro);
- this.Prospeccoes.Add(prospeccao);
- }
- }
- if (this.SelecionarItensVisibility == Visibility.Visible && this.SelecionarItens && this.Documentos != null && this.Documentos.Count > 0)
- {
- ObservableCollection<Item> observableCollection5 = await base.ShowSelecionarItensDialog(this.Documentos.First<Documento>().get_Controle().get_Id());
- ExtratosViewModel list = this;
- ObservableCollection<Item> observableCollection6 = observableCollection5;
- list._itensSelecionados = (
- from x in observableCollection6
- where x.get_Selecionado()
- select x).ToList<Item>();
- }
- if (this.Documentos != null && this.Documentos.Count != 0 || this.Prospeccoes != null && this.Prospeccoes.Count != 0)
- {
- break;
- }
- if (!this.SomenteEndossos)
- {
- await base.ShowMessage("É NECESSÁRIO HAVER AO MENOS UM DOCUMENTO OU PROSPECÇÃO SELECIONADO", "OK", "", false);
- }
- else
- {
- await base.ShowMessage("É NECESSÁRIO HAVER AO MENOS UM ENDOSSO OU PROSPECÇÃO SELECIONADO", "OK", "", false);
- }
- this.Carregando = false;
- return;
- }
- }
- case 2:
- {
- documentos2 = new List<Documento>();
- ApoliceServico apoliceServico = new ApoliceServico();
- long id = documentos.First<Documento>().get_Controle().get_Cliente().get_Id();
- FiltroStatusDocumento statusSelecionado = MainViewModel.StatusSelecionado;
- List<VendedorUsuario> vendedorUsuarios = await base.VerificaVinculoVendedor(Recursos.Usuario);
- ObservableCollection<Documento> observableCollection7 = await apoliceServico.BuscarApolicesAsync(id, statusSelecionado, vendedorUsuarios);
- apoliceServico = null;
- this.Documentos = new List<Documento>(observableCollection7);
- foreach (Documento documento10 in this.Documentos)
- {
- foreach (Documento documento11 in documento10.get_Controle().get_Documentos())
- {
- if (documento11.get_Tipo() != 1)
- {
- continue;
- }
- documentos2.Add(documento11);
- documento10.set_TemEndosso(true);
- }
- }
- this.Documentos.AddRange(documentos2);
- break;
- }
- }
- documentos2 = null;
- clientes1 = null;
- }
- }
- else if (clientes == null || clientes.Count == 0)
- {
- await base.ShowMessage("É NECESSÁRIO HAVER AO MENOS UM CLIENTE", "OK", "", false);
- this.Carregando = false;
- return;
- }
- else
- {
- if (clientes.Count > 200)
- {
- if (!await base.ShowMessage("A SELEÇÃO DE MUITOS EXTRATOS PODE DEMORAR MAIS DE 30 MINUTOS! CONTINUAR?", "SIM", "NÃO", false))
- {
- this.Carregando = false;
- return;
- }
- }
- clientes1 = new List<Cliente>();
- List<ClientesAtivosInativos> clientesAtivosInativos = clientes;
- foreach (ClientesAtivosInativos clientesAtivosInativo in
- from x in clientesAtivosInativos
- where x.get_Selecionado()
- select x)
- {
- cliente = await (new ClienteServico()).BuscarCliente(clientesAtivosInativo.get_Id());
- cliente1 = cliente;
- observableCollection = await this._clienteServico.BuscarEnderecosAsync(cliente.get_Id());
- cliente1.set_Enderecos(observableCollection);
- cliente1 = null;
- cliente1 = cliente;
- observableCollection1 = await this._clienteServico.BuscarEmailsAsync(cliente.get_Id());
- cliente1.set_Emails(observableCollection1);
- cliente1 = null;
- cliente1 = cliente;
- observableCollection2 = await this._clienteServico.BuscarTelefonesAsync(cliente.get_Id());
- cliente1.set_Telefones(observableCollection2);
- cliente1 = null;
- cliente1 = cliente;
- observableCollection3 = await this._clienteServico.BuscarContatosAsync(cliente.get_Id());
- cliente1.set_Contatos(observableCollection3);
- cliente1 = null;
- cliente1 = cliente;
- observableCollection4 = await this._clienteServico.BuscarVinculosAsync(cliente.get_Id());
- cliente1.set_Vinculos(observableCollection4);
- cliente1 = null;
- clientes1.Add(cliente);
- cliente = null;
- }
- this.Clientes = clientes1;
- clientes1 = null;
- }
- if (this.SegurosVigentesVisibility == Visibility.Visible && this.SegurosVigentes)
- {
- ExtratosViewModel extratosViewModel = this;
- List<Documento> documentos14 = this.Documentos;
- extratosViewModel.Documentos = documentos14.Where<Documento>((Documento x) => {
- DateTime? vigencia2 = x.get_Vigencia2();
- DateTime dateTime = Funcoes.GetNetworkTime().Date.AddDays(-5);
- if ((vigencia2.HasValue ? vigencia2.GetValueOrDefault() <= dateTime : true))
- {
- vigencia2 = x.get_Vigencia2();
- if (vigencia2.HasValue)
- {
- return false;
- }
- }
- return x.get_Situacao() != 7;
- }).ToList<Documento>();
- }
- await this.Gerar(tipoRelatorio, pdf);
- this.Carregando = false;
- }
-
- private void RelacaoApolices()
- {
- this.SetAllFalse();
- this.ComissaoDocumentoEnabled = true;
- this.PerfilCondutorEnabled = true;
- }
-
- private void SetAllFalse()
- {
- this.ObsClienteEnabled = false;
- this.ClientePorPaginaEnabled = false;
- this.ComissaoDocumentoEnabled = false;
- this.ObsApoliceEnabled = false;
- this.BeneficiariosItensEnabled = false;
- this.ObsItemEnabled = false;
- this.SepararPaginaEnabled = false;
- this.CoberturasEnabled = false;
- this.PerfilCondutorEnabled = false;
- this.EndossoEnabled = false;
- }
- }
-} \ No newline at end of file