summaryrefslogtreecommitdiff
path: root/Codemerx/Gestor.Model/Model.Domain.Seguros/Cliente.cs
diff options
context:
space:
mode:
authorLucas Faria Mendes <lucas.fariamo08@gmail.com>2026-03-30 13:38:18 +0000
committerLucas Faria Mendes <lucas.fariamo08@gmail.com>2026-03-30 13:38:18 +0000
commit1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1 (patch)
treee1c3b20ea08f0cf71122a1e73f0d395f8fd83874 /Codemerx/Gestor.Model/Model.Domain.Seguros/Cliente.cs
parent674ca83ba9243a9e95a7568c797668dab6aee26a (diff)
downloadgestor-1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1.tar.gz
gestor-1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1.zip
chore: location
Diffstat (limited to 'Codemerx/Gestor.Model/Model.Domain.Seguros/Cliente.cs')
-rw-r--r--Codemerx/Gestor.Model/Model.Domain.Seguros/Cliente.cs1193
1 files changed, 1193 insertions, 0 deletions
diff --git a/Codemerx/Gestor.Model/Model.Domain.Seguros/Cliente.cs b/Codemerx/Gestor.Model/Model.Domain.Seguros/Cliente.cs
new file mode 100644
index 0000000..7da5b5d
--- /dev/null
+++ b/Codemerx/Gestor.Model/Model.Domain.Seguros/Cliente.cs
@@ -0,0 +1,1193 @@
+using Gestor.Model.Attributes;
+using Gestor.Model.Common;
+using Gestor.Model.Domain.Common;
+using Gestor.Model.Domain.Ferramentas;
+using Gestor.Model.Domain.Generic;
+using Gestor.Model.Helper;
+using Gestor.Model.Resources;
+using Gestor.Model.Validation;
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.ComponentModel;
+using System.Globalization;
+using System.Runtime.CompilerServices;
+
+namespace Gestor.Model.Domain.Seguros
+{
+ public class Cliente : DomainBase, IDomain
+ {
+ private string _nome;
+
+ private string _documento;
+
+ private string _identidade;
+
+ private string _emissor;
+
+ private string _estadoEmissor;
+
+ private string _habilitacao;
+
+ private string _categoriaHabilitacao;
+
+ private string _pasta;
+
+ private string _cei;
+
+ private string _rne;
+
+ private string _agencia;
+
+ private string _tipoConta;
+
+ private string _conta;
+
+ private string _caepf;
+
+ private bool? _malaDireta = new bool?(true);
+
+ private string _nomeSocialRg;
+
+ [Description("AGÊNCIA")]
+ [Log(true)]
+ public string Agencia
+ {
+ get
+ {
+ string str = this._agencia;
+ if (str == null)
+ {
+ return null;
+ }
+ return str.ToUpper().Trim();
+ }
+ set
+ {
+ this._agencia = value;
+ }
+ }
+
+ public Gestor.Model.Domain.Common.Atividade Atividade
+ {
+ get;
+ set;
+ }
+
+ public Gestor.Model.Domain.Common.Banco Banco
+ {
+ get;
+ set;
+ }
+
+ [Log(true)]
+ public string Caepf
+ {
+ get
+ {
+ string str = this._caepf;
+ if (str == null)
+ {
+ return null;
+ }
+ return str.ToUpper().Trim();
+ }
+ set
+ {
+ this._caepf = value;
+ }
+ }
+
+ [Description("CATEGORIA HABILITAÇÃO")]
+ [Log(true)]
+ public string CategoriaHabilitacao
+ {
+ get
+ {
+ string str = this._categoriaHabilitacao;
+ if (str == null)
+ {
+ return null;
+ }
+ return str.ToUpper().Trim();
+ }
+ set
+ {
+ this._categoriaHabilitacao = value;
+ }
+ }
+
+ [Log(true)]
+ public string Cei
+ {
+ get
+ {
+ string str = this._cei;
+ if (str == null)
+ {
+ return null;
+ }
+ return str.ToUpper().Trim();
+ }
+ set
+ {
+ this._cei = value;
+ }
+ }
+
+ [Description("CLIENTE DESDE")]
+ [Log(true)]
+ public DateTime? ClienteDesde
+ {
+ get;
+ set;
+ }
+
+ [Log(true)]
+ public string Conta
+ {
+ get
+ {
+ string str = this._conta;
+ if (str == null)
+ {
+ return null;
+ }
+ return str.ToUpper().Trim();
+ }
+ set
+ {
+ this._conta = value;
+ }
+ }
+
+ public ObservableCollection<MaisContato> Contatos
+ {
+ get;
+ set;
+ }
+
+ [Log(true)]
+ public string Documento
+ {
+ get
+ {
+ string str = this._documento;
+ if (str == null)
+ {
+ return null;
+ }
+ return str.ToUpper().Trim();
+ }
+ set
+ {
+ this._documento = value;
+ }
+ }
+
+ [Description("DOCUMENTO PRINCIPAL")]
+ [Log(true)]
+ public TipoDocumento? DocumentoPrincipal
+ {
+ get;
+ set;
+ }
+
+ public ObservableCollection<ClienteEmail> Emails
+ {
+ get;
+ set;
+ }
+
+ [Log(true)]
+ public string Emissor
+ {
+ get
+ {
+ string str = this._emissor;
+ if (str == null)
+ {
+ return null;
+ }
+ return str.ToUpper().Trim();
+ }
+ set
+ {
+ this._emissor = value;
+ }
+ }
+
+ public ObservableCollection<ClienteEndereco> Enderecos
+ {
+ get;
+ set;
+ }
+
+ [Description("ESTADO CIVIL")]
+ [Log(true)]
+ public Gestor.Model.Common.EstadoCivil? EstadoCivil
+ {
+ get;
+ set;
+ }
+
+ [Description("ESTADO EMISSOR")]
+ [Log(true)]
+ public string EstadoEmissor
+ {
+ get
+ {
+ string str = this._estadoEmissor;
+ if (str == null)
+ {
+ return null;
+ }
+ return str.ToUpper().Trim();
+ }
+ set
+ {
+ this._estadoEmissor = value;
+ }
+ }
+
+ public bool EstaNaCentralSegurado
+ {
+ get;
+ set;
+ }
+
+ [Log(true)]
+ public bool Excluido
+ {
+ get;
+ set;
+ }
+
+ [Description("EXPEDIÇÃO")]
+ [Log(true)]
+ public DateTime? Expedicao
+ {
+ get;
+ set;
+ }
+
+ [Log(true)]
+ public bool Falecido
+ {
+ get;
+ set;
+ }
+
+ [Description("HABILITAÇÃO")]
+ [Log(true)]
+ public string Habilitacao
+ {
+ get
+ {
+ string str = this._habilitacao;
+ if (str == null)
+ {
+ return null;
+ }
+ return str.ToUpper().Trim();
+ }
+ set
+ {
+ this._habilitacao = value;
+ }
+ }
+
+ public long IdEmpresa
+ {
+ get;
+ set;
+ }
+
+ [Log(true)]
+ public string Identidade
+ {
+ get
+ {
+ string str = this._identidade;
+ if (str == null)
+ {
+ return null;
+ }
+ return str.ToUpper().Trim();
+ }
+ set
+ {
+ this._identidade = value;
+ }
+ }
+
+ [Description("DESEJA RECEBER MALA DIRETA")]
+ [Log(true)]
+ public bool? MalaDireta
+ {
+ get
+ {
+ return new bool?(this._malaDireta.GetValueOrDefault(true));
+ }
+ set
+ {
+ this._malaDireta = new bool?(value.GetValueOrDefault(true));
+ }
+ }
+
+ [Log(true)]
+ public DateTime? Nascimento
+ {
+ get;
+ set;
+ }
+
+ [Log(true)]
+ [Name(true)]
+ public string Nome
+ {
+ get
+ {
+ string str = this._nome;
+ if (str != null)
+ {
+ return str.ToUpper();
+ }
+ return null;
+ }
+ set
+ {
+ object upper;
+ this._nome = value;
+ if (value != null)
+ {
+ upper = value.ToUpper();
+ }
+ else
+ {
+ upper = null;
+ }
+ this.NomeSocial = string.Format("{0} - {1}", upper, base.Id);
+ }
+ }
+
+ public string NomeSocial
+ {
+ get;
+ set;
+ }
+
+ public string NomeSocialRg
+ {
+ get
+ {
+ string str = this._nomeSocialRg;
+ if (str != null)
+ {
+ return str.ToUpper();
+ }
+ return null;
+ }
+ set
+ {
+ this._nomeSocialRg = value;
+ }
+ }
+
+ [Description("OBSERVAÇÃO")]
+ [Log(true)]
+ public string Observacao
+ {
+ get;
+ set;
+ }
+
+ public List<OrigemCliente> Origens
+ {
+ get;
+ set;
+ }
+
+ [Log(true)]
+ public string Pasta
+ {
+ get
+ {
+ string str = this._pasta;
+ if (str != null)
+ {
+ return str.ToUpper();
+ }
+ return null;
+ }
+ set
+ {
+ this._pasta = value;
+ }
+ }
+
+ public bool PessoaFisica
+ {
+ get
+ {
+ return this.Documento.Clear().Length < 12;
+ }
+ }
+
+ [Description("PRIMEIRA HABILITAÇÃO")]
+ [Log(true)]
+ public DateTime? PrimeiraHabilitacao
+ {
+ get;
+ set;
+ }
+
+ [Description("PROFISSÃO")]
+ public Gestor.Model.Domain.Common.Profissao Profissao
+ {
+ get;
+ set;
+ }
+
+ [Description("RENDA MENSAL")]
+ [Log(true)]
+ public decimal RendaMensal
+ {
+ get;
+ set;
+ }
+
+ [Log(true)]
+ public Gestor.Model.Domain.Seguros.ResponsavelAssinatura ResponsavelAssinatura
+ {
+ get;
+ set;
+ }
+
+ [Log(true)]
+ public string Rne
+ {
+ get
+ {
+ string str = this._rne;
+ if (str == null)
+ {
+ return null;
+ }
+ return str.ToUpper().Trim();
+ }
+ set
+ {
+ this._rne = value;
+ }
+ }
+
+ [Log(true)]
+ public Gestor.Model.Common.Sexo? Sexo
+ {
+ get;
+ set;
+ }
+
+ [Log(true)]
+ public string Status
+ {
+ get;
+ set;
+ }
+
+ public ObservableCollection<ClienteTelefone> Telefones
+ {
+ get;
+ set;
+ }
+
+ [Description("TIPO CONTA")]
+ [Log(true)]
+ public string TipoConta
+ {
+ get
+ {
+ string str = this._tipoConta;
+ if (str != null)
+ {
+ return str.ToUpper();
+ }
+ return null;
+ }
+ set
+ {
+ this._tipoConta = value;
+ }
+ }
+
+ [JsonIgnore]
+ public Func<List<KeyValuePair<string, string>>> ValidationEvent
+ {
+ get
+ {
+ Cliente cliente = this;
+ return new Func<List<KeyValuePair<string, string>>>(cliente.Validate);
+ }
+ }
+
+ [Description("VENCIMENTO HABILITAÇÃO")]
+ [Log(true)]
+ public DateTime? VencimentoHabilitacao
+ {
+ get;
+ set;
+ }
+
+ public ObservableCollection<ClienteVinculo> Vinculos
+ {
+ get;
+ set;
+ }
+
+ public Cliente()
+ {
+ }
+
+ public List<TupleList> Log()
+ {
+ TipoTelefone? tipo;
+ string description;
+ string str;
+ string shortDateString;
+ string shortDateString1;
+ string str1;
+ string shortDateString2;
+ string description1;
+ string description2;
+ string str2;
+ string shortDateString3;
+ string description3;
+ string str3;
+ string description4;
+ List<TupleList> tupleLists = new List<TupleList>();
+ TupleList tupleList = new TupleList();
+ ObservableCollection<Tuple<string, string, string>> observableCollection = new ObservableCollection<Tuple<string, string, string>>();
+ TipoDocumento? documentoPrincipal = this.DocumentoPrincipal;
+ if (!documentoPrincipal.HasValue)
+ {
+ description = "";
+ }
+ else
+ {
+ documentoPrincipal = this.DocumentoPrincipal;
+ if (documentoPrincipal.HasValue)
+ {
+ description = documentoPrincipal.GetValueOrDefault().GetDescription();
+ }
+ else
+ {
+ description = null;
+ }
+ }
+ observableCollection.Add(new Tuple<string, string, string>("TIPO DO DOCUMENTO PRINCIPAL", description, ""));
+ observableCollection.Add(new Tuple<string, string, string>("DOCUMENTO PRINCIPAL", (string.IsNullOrWhiteSpace(this.Documento) ? "" : this.Documento), ""));
+ observableCollection.Add(new Tuple<string, string, string>("CLIENTE", (string.IsNullOrWhiteSpace(this.Nome) ? "" : this.Nome.ToUpper()), ""));
+ str = (this.Documento.OnlyNumber().Length > 11 ? "FUNDAÇÃO" : "NASCIMENTO");
+ DateTime? nascimento = this.Nascimento;
+ if (!nascimento.HasValue)
+ {
+ shortDateString = "";
+ }
+ else
+ {
+ nascimento = this.Nascimento;
+ if (nascimento.HasValue)
+ {
+ shortDateString = nascimento.GetValueOrDefault().ToShortDateString();
+ }
+ else
+ {
+ shortDateString = null;
+ }
+ }
+ observableCollection.Add(new Tuple<string, string, string>(str, shortDateString, ""));
+ tupleList.Tuples = observableCollection;
+ tupleLists.Add(tupleList);
+ List<TupleList> tupleLists1 = tupleLists;
+ if (this.Documento == null || this.Documento.OnlyNumber().Length <= 11)
+ {
+ tupleLists1[0].Tuples.Add(new Tuple<string, string, string>("IDENTIDADE", (string.IsNullOrWhiteSpace(this.Identidade) ? "" : this.Identidade), ""));
+ tupleLists1[0].Tuples.Add(new Tuple<string, string, string>("ÓRGÃO EMISSOR", (string.IsNullOrWhiteSpace(this.Emissor) ? "" : this.Emissor.ToUpper()), ""));
+ tupleLists1[0].Tuples.Add(new Tuple<string, string, string>("ESTADO EMISSOR", (string.IsNullOrWhiteSpace(this.EstadoEmissor) ? "" : this.EstadoEmissor.ToUpper()), ""));
+ ObservableCollection<Tuple<string, string, string>> tuples = tupleLists1[0].Tuples;
+ nascimento = this.Expedicao;
+ if (!nascimento.HasValue)
+ {
+ shortDateString1 = "";
+ }
+ else
+ {
+ nascimento = this.Expedicao;
+ if (nascimento.HasValue)
+ {
+ shortDateString1 = nascimento.GetValueOrDefault().ToShortDateString();
+ }
+ else
+ {
+ shortDateString1 = null;
+ }
+ }
+ tuples.Add(new Tuple<string, string, string>("DATA DE EXPEDIÇÃO", shortDateString1, ""));
+ tupleLists1[0].Tuples.Add(new Tuple<string, string, string>("HABILITAÇÃO", (string.IsNullOrWhiteSpace(this.Habilitacao) ? "" : this.Habilitacao.ToUpper()), ""));
+ tupleLists1[0].Tuples.Add(new Tuple<string, string, string>("CATEGORIA", (string.IsNullOrWhiteSpace(this.CategoriaHabilitacao) ? "" : this.CategoriaHabilitacao.ToUpper()), ""));
+ ObservableCollection<Tuple<string, string, string>> tuples1 = tupleLists1[0].Tuples;
+ nascimento = this.PrimeiraHabilitacao;
+ if (!nascimento.HasValue)
+ {
+ str1 = "";
+ }
+ else
+ {
+ nascimento = this.PrimeiraHabilitacao;
+ if (nascimento.HasValue)
+ {
+ str1 = nascimento.GetValueOrDefault().ToShortDateString();
+ }
+ else
+ {
+ str1 = null;
+ }
+ }
+ tuples1.Add(new Tuple<string, string, string>("PRIMEIRA HABILITAÇÃO", str1, ""));
+ ObservableCollection<Tuple<string, string, string>> observableCollection1 = tupleLists1[0].Tuples;
+ nascimento = this.VencimentoHabilitacao;
+ if (!nascimento.HasValue)
+ {
+ shortDateString2 = "";
+ }
+ else
+ {
+ nascimento = this.VencimentoHabilitacao;
+ if (nascimento.HasValue)
+ {
+ shortDateString2 = nascimento.GetValueOrDefault().ToShortDateString();
+ }
+ else
+ {
+ shortDateString2 = null;
+ }
+ }
+ observableCollection1.Add(new Tuple<string, string, string>("VENCIMENTO DA HABILITAÇÃO", shortDateString2, ""));
+ ObservableCollection<Tuple<string, string, string>> tuples2 = tupleLists1[0].Tuples;
+ Gestor.Model.Common.Sexo? sexo = this.Sexo;
+ if (!sexo.HasValue)
+ {
+ description1 = "";
+ }
+ else
+ {
+ sexo = this.Sexo;
+ if (sexo.HasValue)
+ {
+ description1 = sexo.GetValueOrDefault().GetDescription();
+ }
+ else
+ {
+ description1 = null;
+ }
+ }
+ tuples2.Add(new Tuple<string, string, string>("SEXO", description1, ""));
+ ObservableCollection<Tuple<string, string, string>> observableCollection2 = tupleLists1[0].Tuples;
+ Gestor.Model.Common.EstadoCivil? estadoCivil = this.EstadoCivil;
+ if (!estadoCivil.HasValue)
+ {
+ description2 = "";
+ }
+ else
+ {
+ estadoCivil = this.EstadoCivil;
+ if (estadoCivil.HasValue)
+ {
+ description2 = estadoCivil.GetValueOrDefault().GetDescription();
+ }
+ else
+ {
+ description2 = null;
+ }
+ }
+ observableCollection2.Add(new Tuple<string, string, string>("ESTADO CIVIL", description2, ""));
+ tupleLists1[0].Tuples.Add(new Tuple<string, string, string>("PROFISSÃO DO CLIENTE", (this.Profissao == null ? "" : this.Profissao.Nome.ToUpper()), ""));
+ }
+ else
+ {
+ tupleLists1[0].Tuples.Add(new Tuple<string, string, string>("RAMO DE ATIVIDADE", (string.IsNullOrWhiteSpace(this.Atividade.Nome) ? "" : this.Atividade.Nome), ""));
+ }
+ ObservableCollection<Tuple<string, string, string>> tuples3 = tupleLists1[0].Tuples;
+ nascimento = this.ClienteDesde;
+ if (!nascimento.HasValue)
+ {
+ str2 = "";
+ }
+ else
+ {
+ nascimento = this.ClienteDesde;
+ if (nascimento.HasValue)
+ {
+ str2 = nascimento.GetValueOrDefault().ToShortDateString();
+ }
+ else
+ {
+ str2 = null;
+ }
+ }
+ tuples3.Add(new Tuple<string, string, string>("CLIENTE DESDE", str2, ""));
+ tupleLists1[0].Tuples.Add(new Tuple<string, string, string>("PASTA", (string.IsNullOrWhiteSpace(this.Pasta) ? "" : this.Pasta.ToUpper()), ""));
+ tupleLists1[0].Tuples.Add(new Tuple<string, string, string>("BANCO", (this.Banco == null ? "" : this.Banco.Nome.ToUpper()), ""));
+ tupleLists1[0].Tuples.Add(new Tuple<string, string, string>("AGÊNCIA", (string.IsNullOrWhiteSpace(this.Agencia) ? "" : this.Agencia.ToUpper()), ""));
+ tupleLists1[0].Tuples.Add(new Tuple<string, string, string>("TIPO DE CONTA", (string.IsNullOrWhiteSpace(this.TipoConta) ? "" : this.TipoConta.ToUpper()), ""));
+ tupleLists1[0].Tuples.Add(new Tuple<string, string, string>("NÚMERO DA CONTA", (string.IsNullOrWhiteSpace(this.Conta) ? "" : this.Conta.ToUpper()), ""));
+ tupleLists1[0].Tuples.Add(new Tuple<string, string, string>("FALECIDO", (this.Falecido ? "SIM" : "NÃO"), ""));
+ tupleLists1[0].Tuples.Add(new Tuple<string, string, string>("ÓRGÃO EMISSOR", (string.IsNullOrWhiteSpace(this.Emissor) ? "" : this.Emissor.ToUpper()), ""));
+ ObservableCollection<Tuple<string, string, string>> observableCollection3 = tupleLists1[0].Tuples;
+ decimal rendaMensal = this.RendaMensal;
+ observableCollection3.Add(new Tuple<string, string, string>("RENDA MENSAL", rendaMensal.ToString("C", new CultureInfo("pt-BR", false)), ""));
+ ObservableCollection<Tuple<string, string, string>> observableCollection4 = new ObservableCollection<Tuple<string, string, string>>()
+ {
+ new Tuple<string, string, string>("TELEFONES$", "", "")
+ };
+ if (this.Telefones != null && this.Telefones.Count > 0)
+ {
+ foreach (ClienteTelefone telefone in this.Telefones)
+ {
+ observableCollection4.Add(new Tuple<string, string, string>(string.Format(" TELEFONE {0}$", this.Telefones.IndexOf(telefone) + 1), "", ""));
+ ObservableCollection<Tuple<string, string, string>> observableCollection5 = observableCollection4;
+ tipo = telefone.Tipo;
+ if (!tipo.HasValue)
+ {
+ description4 = "";
+ }
+ else
+ {
+ tipo = telefone.Tipo;
+ if (tipo.HasValue)
+ {
+ description4 = tipo.GetValueOrDefault().GetDescription();
+ }
+ else
+ {
+ description4 = null;
+ }
+ }
+ observableCollection5.Add(new Tuple<string, string, string>(" TIPO", description4, ""));
+ observableCollection4.Add(new Tuple<string, string, string>(" PREFIXO", (string.IsNullOrWhiteSpace(telefone.Prefixo) ? "" : telefone.Prefixo.ToUpper()), ""));
+ observableCollection4.Add(new Tuple<string, string, string>(" NÚMERO", (string.IsNullOrWhiteSpace(telefone.Numero) ? "" : telefone.Numero), ""));
+ observableCollection4.Add(new Tuple<string, string, string>(" ORDEM", (!telefone.Ordem.HasValue ? "" : telefone.Ordem.ToString()), ""));
+ }
+ }
+ tupleLists1.Add(new TupleList()
+ {
+ Tuples = observableCollection4
+ });
+ ObservableCollection<Tuple<string, string, string>> observableCollection6 = new ObservableCollection<Tuple<string, string, string>>()
+ {
+ new Tuple<string, string, string>("EMAILS$", "", "")
+ };
+ if (this.Emails != null && this.Emails.Count > 0)
+ {
+ foreach (ClienteEmail email in this.Emails)
+ {
+ observableCollection6.Add(new Tuple<string, string, string>(string.Format(" EMAIL {0}$", this.Emails.IndexOf(email) + 1), "", ""));
+ observableCollection6.Add(new Tuple<string, string, string>(" ENDEREÇO DE EMAIL", (string.IsNullOrWhiteSpace(email.Email) ? "" : email.Email), ""));
+ observableCollection6.Add(new Tuple<string, string, string>(" ORDEM", (!email.Ordem.HasValue ? "" : email.Ordem.ToString()), ""));
+ }
+ }
+ tupleLists1.Add(new TupleList()
+ {
+ Tuples = observableCollection6
+ });
+ ObservableCollection<Tuple<string, string, string>> observableCollection7 = new ObservableCollection<Tuple<string, string, string>>()
+ {
+ new Tuple<string, string, string>("ENDEREÇOS$", "", "")
+ };
+ if (this.Enderecos != null && this.Enderecos.Count > 0)
+ {
+ foreach (ClienteEndereco endereco in this.Enderecos)
+ {
+ observableCollection7.Add(new Tuple<string, string, string>(string.Format(" ENDEREÇO {0}$", this.Enderecos.IndexOf(endereco) + 1), "", ""));
+ observableCollection7.Add(new Tuple<string, string, string>(" LOGRADOURO", (string.IsNullOrWhiteSpace(endereco.Endereco) ? "" : endereco.Endereco), ""));
+ observableCollection7.Add(new Tuple<string, string, string>(" NÚMERO", (string.IsNullOrWhiteSpace(endereco.Numero) ? "" : endereco.Numero), ""));
+ observableCollection7.Add(new Tuple<string, string, string>(" COMPLEMENTO", (string.IsNullOrWhiteSpace(endereco.Complemento) ? "" : endereco.Complemento), ""));
+ observableCollection7.Add(new Tuple<string, string, string>(" BAIRRO", (string.IsNullOrWhiteSpace(endereco.Bairro) ? "" : endereco.Bairro), ""));
+ observableCollection7.Add(new Tuple<string, string, string>(" CIDADE", (string.IsNullOrWhiteSpace(endereco.Cidade) ? "" : endereco.Cidade), ""));
+ observableCollection7.Add(new Tuple<string, string, string>(" ESTADO", (string.IsNullOrWhiteSpace(endereco.Estado) ? "" : endereco.Estado), ""));
+ observableCollection7.Add(new Tuple<string, string, string>(" CEP", (string.IsNullOrWhiteSpace(endereco.Cep) ? "" : endereco.Cep), ""));
+ observableCollection7.Add(new Tuple<string, string, string>(" ORDEM", (!endereco.Ordem.HasValue ? "" : endereco.Ordem.ToString()), ""));
+ }
+ }
+ tupleLists1.Add(new TupleList()
+ {
+ Tuples = observableCollection7
+ });
+ ObservableCollection<Tuple<string, string, string>> observableCollection8 = new ObservableCollection<Tuple<string, string, string>>()
+ {
+ new Tuple<string, string, string>("CONTATOS$", "", "")
+ };
+ if (this.Contatos != null && this.Contatos.Count > 0)
+ {
+ foreach (MaisContato contato in this.Contatos)
+ {
+ observableCollection8.Add(new Tuple<string, string, string>(string.Format(" CONTATO {0}$", this.Contatos.IndexOf(contato) + 1), "", ""));
+ observableCollection8.Add(new Tuple<string, string, string>(" DOCUMENTO", (string.IsNullOrWhiteSpace(contato.Documento) ? "" : contato.Documento), ""));
+ ObservableCollection<Tuple<string, string, string>> observableCollection9 = observableCollection8;
+ nascimento = contato.Nascimento;
+ if (!nascimento.HasValue)
+ {
+ shortDateString3 = "";
+ }
+ else
+ {
+ nascimento = contato.Nascimento;
+ if (nascimento.HasValue)
+ {
+ shortDateString3 = nascimento.GetValueOrDefault().ToShortDateString();
+ }
+ else
+ {
+ shortDateString3 = null;
+ }
+ }
+ observableCollection9.Add(new Tuple<string, string, string>(" NASCIMENTO", shortDateString3, ""));
+ ObservableCollection<Tuple<string, string, string>> observableCollection10 = observableCollection8;
+ Parentesco? parentesco = contato.Parentesco;
+ if (!parentesco.HasValue)
+ {
+ description3 = "";
+ }
+ else
+ {
+ parentesco = contato.Parentesco;
+ if (parentesco.HasValue)
+ {
+ description3 = parentesco.GetValueOrDefault().GetDescription();
+ }
+ else
+ {
+ description3 = null;
+ }
+ }
+ observableCollection10.Add(new Tuple<string, string, string>(" PARENTESCO", description3, ""));
+ observableCollection8.Add(new Tuple<string, string, string>(" BANCO", (string.IsNullOrWhiteSpace(contato.Banco) ? "" : contato.Banco), ""));
+ observableCollection8.Add(new Tuple<string, string, string>(" AGÊNCIA", (string.IsNullOrWhiteSpace(contato.Agencia) ? "" : contato.Agencia), ""));
+ observableCollection8.Add(new Tuple<string, string, string>(" CONTA", (string.IsNullOrWhiteSpace(contato.Conta) ? "" : contato.Conta), ""));
+ ObservableCollection<Tuple<string, string, string>> observableCollection11 = observableCollection8;
+ tipo = contato.Tipo;
+ if (!tipo.HasValue)
+ {
+ str3 = "";
+ }
+ else
+ {
+ tipo = contato.Tipo;
+ if (tipo.HasValue)
+ {
+ str3 = tipo.GetValueOrDefault().GetDescription();
+ }
+ else
+ {
+ str3 = null;
+ }
+ }
+ observableCollection11.Add(new Tuple<string, string, string>(" TIPO DO TELEFONE", str3, ""));
+ observableCollection8.Add(new Tuple<string, string, string>(" PREFIXO", (string.IsNullOrWhiteSpace(contato.Prefixo) ? "" : contato.Prefixo), ""));
+ observableCollection8.Add(new Tuple<string, string, string>(" NÚMERO", (string.IsNullOrWhiteSpace(contato.Telefone) ? "" : contato.Telefone), ""));
+ observableCollection8.Add(new Tuple<string, string, string>(" EMAIL", (string.IsNullOrWhiteSpace(contato.Email) ? "" : contato.Email), ""));
+ }
+ }
+ tupleLists1.Add(new TupleList()
+ {
+ Tuples = observableCollection8
+ });
+ ObservableCollection<Tuple<string, string, string>> observableCollection12 = new ObservableCollection<Tuple<string, string, string>>()
+ {
+ new Tuple<string, string, string>("VÍNCULOS$", "", "")
+ };
+ if (this.Vinculos == null)
+ {
+ this.Vinculos = new ObservableCollection<ClienteVinculo>();
+ }
+ if (this.Vinculos != null && this.Vinculos.Count > 0)
+ {
+ foreach (ClienteVinculo vinculo in this.Vinculos)
+ {
+ observableCollection12.Add(new Tuple<string, string, string>(string.Format(" VÍNCULO {0}$", this.Vinculos.IndexOf(vinculo) + 1), "", ""));
+ observableCollection12.Add(new Tuple<string, string, string>(" COM CLIENTE", (vinculo.Cliente1.Id != base.Id ? vinculo.Cliente1.Nome : vinculo.Cliente2.Nome), ""));
+ observableCollection12.Add(new Tuple<string, string, string>(" PARENTESCO", (vinculo.Cliente1.Id == base.Id ? vinculo.Parentesco.GetDescription() : Funcoes.ParentescoInverso(vinculo.Parentesco).GetDescription()), ""));
+ }
+ }
+ tupleLists1.Add(new TupleList()
+ {
+ Tuples = observableCollection12
+ });
+ return tupleLists1;
+ }
+
+ public List<KeyValuePair<string, string>> Validate()
+ {
+ int? nullable;
+ DateTime? primeiraHabilitacao;
+ int? nullable1;
+ List<KeyValuePair<string, string>> keyValuePairs = ValidationHelper.AddValue();
+ string nome = this.Nome;
+ if (nome != null)
+ {
+ nullable1 = new int?((int)nome.Trim().Split(new char[] { ' ' }).Length);
+ }
+ else
+ {
+ nullable = null;
+ nullable1 = nullable;
+ }
+ int? nullable2 = nullable1;
+ if (nullable2.HasValue)
+ {
+ nullable = nullable2;
+ if (nullable.GetValueOrDefault() <= 1 & nullable.HasValue)
+ {
+ keyValuePairs.AddValue<string, string>("Nome", Messages.NomeInvalido, true);
+ }
+ }
+ else
+ {
+ keyValuePairs.AddValue<string, string>("Nome", Messages.Obrigatorio, true);
+ }
+ TipoDocumento? documentoPrincipal = this.DocumentoPrincipal;
+ if (!documentoPrincipal.HasValue)
+ {
+ keyValuePairs.AddValue<string, string>("DocumentoPrincipal|DOCUMENTO PRINCIPAL", string.Format(Messages.Obrigatorio, Array.Empty<object>()), true);
+ }
+ DateTime? clienteDesde = this.ClienteDesde;
+ if (clienteDesde.HasValue)
+ {
+ clienteDesde = this.ClienteDesde;
+ if (DateTime.Compare(clienteDesde.Value, new DateTime(1753, 1, 1)) >= 0)
+ {
+ clienteDesde = this.ClienteDesde;
+ if (DateTime.Compare(clienteDesde.Value, new DateTime(9999, 12, 31)) <= 0)
+ {
+ goto Label0;
+ }
+ }
+ keyValuePairs.AddValue<string, string>("ClienteDesde|CLIENTE DESDE", string.Format(Messages.DataInvalida, Array.Empty<object>()), true);
+ }
+ Label0:
+ DateTime networkTime = Funcoes.GetNetworkTime();
+ DateTime date = networkTime.Date;
+ clienteDesde = this.Nascimento;
+ if (clienteDesde.HasValue)
+ {
+ clienteDesde = this.Nascimento;
+ networkTime = date;
+ if ((clienteDesde.HasValue ? clienteDesde.GetValueOrDefault() > networkTime : false))
+ {
+ keyValuePairs.AddValue<string, string>(string.Concat("Nascimento|", (this.Documento.OnlyNumber().Length > 11 ? "FUNDAÇÃO" : "NASCIMENTO")), Messages.Invalido, true);
+ }
+ }
+ clienteDesde = this.Nascimento;
+ if (clienteDesde.HasValue)
+ {
+ clienteDesde = this.Nascimento;
+ if (DateTime.Compare(clienteDesde.Value, new DateTime(1753, 1, 1)) >= 0)
+ {
+ clienteDesde = this.Nascimento;
+ if (DateTime.Compare(clienteDesde.Value, new DateTime(9999, 12, 31)) <= 0)
+ {
+ goto Label1;
+ }
+ }
+ keyValuePairs.AddValue<string, string>(string.Concat("Nascimento|", (this.Documento.OnlyNumber().Length > 11 ? "FUNDAÇÃO" : "NASCIMENTO")), string.Format(Messages.DataInvalida, Array.Empty<object>()), true);
+ }
+ if (string.IsNullOrWhiteSpace(this.Documento))
+ {
+ keyValuePairs.AddValue<string, string>("Documento", Messages.Obrigatorio, true);
+ }
+ else if (!this.Documento.ValidacaoDocumento())
+ {
+ keyValuePairs.AddValue<string, string>("Documento", Messages.Invalido, true);
+ }
+ documentoPrincipal = this.DocumentoPrincipal;
+ if (documentoPrincipal.HasValue)
+ {
+ switch (documentoPrincipal.GetValueOrDefault())
+ {
+ case TipoDocumento.Rne:
+ {
+ if (!string.IsNullOrWhiteSpace(this.Rne))
+ {
+ if (this.Rne.ValidacaoRne())
+ {
+ break;
+ }
+ keyValuePairs.AddValue<string, string>("Rne", Messages.Invalido, true);
+ break;
+ }
+ else
+ {
+ keyValuePairs.AddValue<string, string>("Rne", Messages.Obrigatorio, true);
+ break;
+ }
+ }
+ case TipoDocumento.Cei:
+ {
+ if (!string.IsNullOrWhiteSpace(this.Cei))
+ {
+ if (this.Cei.ValidacaoCei())
+ {
+ break;
+ }
+ keyValuePairs.AddValue<string, string>("Cei", Messages.Invalido, true);
+ break;
+ }
+ else
+ {
+ keyValuePairs.AddValue<string, string>("Cei", Messages.Obrigatorio, true);
+ break;
+ }
+ }
+ case TipoDocumento.Caepf:
+ {
+ if (!string.IsNullOrWhiteSpace(this.Caepf))
+ {
+ if (this.Caepf.ValidateCaepf())
+ {
+ break;
+ }
+ keyValuePairs.AddValue<string, string>("Caepf", Messages.Invalido, true);
+ break;
+ }
+ else
+ {
+ keyValuePairs.AddValue<string, string>("Caepf", Messages.Obrigatorio, true);
+ break;
+ }
+ }
+ }
+ }
+ if (this.Documento == null || this.Documento.OnlyNumber().Length <= 11)
+ {
+ clienteDesde = this.PrimeiraHabilitacao;
+ if (clienteDesde.HasValue)
+ {
+ clienteDesde = this.PrimeiraHabilitacao;
+ networkTime = date;
+ if ((clienteDesde.HasValue ? clienteDesde.GetValueOrDefault() > networkTime : false))
+ {
+ keyValuePairs.AddValue<string, string>("PrimeiraHabilitacao|PRIMEIRA HABILITAÇÃO", Messages.Invalido, true);
+ }
+ }
+ clienteDesde = this.PrimeiraHabilitacao;
+ if (clienteDesde.HasValue)
+ {
+ clienteDesde = this.PrimeiraHabilitacao;
+ if (DateTime.Compare(clienteDesde.Value, new DateTime(1753, 1, 1)) >= 0)
+ {
+ clienteDesde = this.PrimeiraHabilitacao;
+ if (DateTime.Compare(clienteDesde.Value, new DateTime(9999, 12, 31)) <= 0)
+ {
+ goto Label2;
+ }
+ }
+ keyValuePairs.AddValue<string, string>("PrimeiraHabilitacao|PRIMEIRA HABILITAÇÃO", string.Format(Messages.DataInvalida, Array.Empty<object>()), true);
+ }
+ Label2:
+ clienteDesde = this.VencimentoHabilitacao;
+ if (clienteDesde.HasValue)
+ {
+ clienteDesde = this.VencimentoHabilitacao;
+ primeiraHabilitacao = this.PrimeiraHabilitacao;
+ if ((clienteDesde.HasValue & primeiraHabilitacao.HasValue ? clienteDesde.GetValueOrDefault() <= primeiraHabilitacao.GetValueOrDefault() : false))
+ {
+ keyValuePairs.AddValue<string, string>("VencimentoHabilitacao|VENCIMENTO HABILITAÇÃO", Messages.Invalido, true);
+ }
+ }
+ primeiraHabilitacao = this.VencimentoHabilitacao;
+ if (primeiraHabilitacao.HasValue)
+ {
+ primeiraHabilitacao = this.VencimentoHabilitacao;
+ if (DateTime.Compare(primeiraHabilitacao.Value, new DateTime(1753, 1, 1)) >= 0)
+ {
+ primeiraHabilitacao = this.VencimentoHabilitacao;
+ if (DateTime.Compare(primeiraHabilitacao.Value, new DateTime(9999, 12, 31)) <= 0)
+ {
+ goto Label3;
+ }
+ }
+ keyValuePairs.AddValue<string, string>("VencimentoHabilitacao|VENCIMENTO HABILITAÇÃO", string.Format(Messages.DataInvalida, Array.Empty<object>()), true);
+ }
+ Label3:
+ primeiraHabilitacao = this.Expedicao;
+ if (primeiraHabilitacao.HasValue)
+ {
+ primeiraHabilitacao = this.Expedicao;
+ if (DateTime.Compare(primeiraHabilitacao.Value, new DateTime(1753, 1, 1)) >= 0)
+ {
+ primeiraHabilitacao = this.Expedicao;
+ if (DateTime.Compare(primeiraHabilitacao.Value, new DateTime(9999, 12, 31)) <= 0)
+ {
+ goto Label4;
+ }
+ }
+ keyValuePairs.AddValue<string, string>("Expedicao|EXPEDIÇÃO", string.Format(Messages.DataInvalida, Array.Empty<object>()), true);
+ }
+ Label4:
+ primeiraHabilitacao = this.Expedicao;
+ if (primeiraHabilitacao.HasValue)
+ {
+ primeiraHabilitacao = this.Expedicao;
+ networkTime = date;
+ if ((primeiraHabilitacao.HasValue ? primeiraHabilitacao.GetValueOrDefault() > networkTime : false))
+ {
+ keyValuePairs.AddValue<string, string>("Expedicao|EXPEDIÇÃO", Messages.Invalido, true);
+ }
+ }
+ if (!string.IsNullOrWhiteSpace(this.Identidade) && this.Identidade.Length > 14)
+ {
+ keyValuePairs.AddValue<string, string>("Identidade", string.Format(Messages.MaiorQueLimite, 14), true);
+ }
+ if (!string.IsNullOrWhiteSpace(this.Habilitacao) && this.Habilitacao.Length > 15)
+ {
+ keyValuePairs.AddValue<string, string>("Habilitacao|HABILITAÇÃO", string.Format(Messages.MaiorQueLimite, 15), true);
+ }
+ if (!string.IsNullOrWhiteSpace(this.CategoriaHabilitacao) && this.CategoriaHabilitacao.Length > 10)
+ {
+ keyValuePairs.AddValue<string, string>("CategoriaHabilitacao|CATEGORIA HABILITAÇÃO", string.Format(Messages.MaiorQueLimite, 10), true);
+ }
+ if (!string.IsNullOrWhiteSpace(this.Emissor) && !this.Emissor.ValidacaoOrgao())
+ {
+ keyValuePairs.AddValue<string, string>("Emissor|EMISSOR", string.Format(Messages.MaiorQueLimite, 6), true);
+ }
+ if (!string.IsNullOrWhiteSpace(this.EstadoEmissor) && !this.EstadoEmissor.ValidacaoEstado())
+ {
+ keyValuePairs.AddValue<string, string>("EstadoEmissor|ESTADO EMISSOR", Messages.Invalido, true);
+ }
+ }
+ if (!string.IsNullOrWhiteSpace(this.Pasta) && this.Pasta.Length > 8)
+ {
+ keyValuePairs.AddValue<string, string>("Pasta", string.Format(Messages.MaiorQueLimite, 8), true);
+ }
+ if (!string.IsNullOrWhiteSpace(this.Agencia) && this.Agencia.Length > 8)
+ {
+ keyValuePairs.AddValue<string, string>("Agencia|AGÊNCIA", string.Format(Messages.MaiorQueLimite, 8), true);
+ }
+ if (!string.IsNullOrWhiteSpace(this.TipoConta) && this.TipoConta.Length > 20)
+ {
+ keyValuePairs.AddValue<string, string>("TipoConta|TIPO CONTA", string.Format(Messages.MaiorQueLimite, 20), true);
+ }
+ if (!string.IsNullOrWhiteSpace(this.Conta) && this.Conta.Length > 12)
+ {
+ keyValuePairs.AddValue<string, string>("Conta", string.Format(Messages.MaiorQueLimite, 12), true);
+ }
+ if (this.ResponsavelAssinatura != null)
+ {
+ keyValuePairs.AddRange(this.ResponsavelAssinatura.Validate());
+ }
+ return keyValuePairs;
+ }
+ }
+} \ No newline at end of file