From 674ca83ba9243a9e95a7568c797668dab6aee26a Mon Sep 17 00:00:00 2001 From: Lucas Faria Mendes Date: Mon, 30 Mar 2026 10:35:25 -0300 Subject: feat: upload files --- Gestor.Model/Model.Domain.Seguros/Sinistro.cs | 1132 +++++++++++++++++++++++++ 1 file changed, 1132 insertions(+) create mode 100644 Gestor.Model/Model.Domain.Seguros/Sinistro.cs (limited to 'Gestor.Model/Model.Domain.Seguros/Sinistro.cs') diff --git a/Gestor.Model/Model.Domain.Seguros/Sinistro.cs b/Gestor.Model/Model.Domain.Seguros/Sinistro.cs new file mode 100644 index 0000000..21cb5c2 --- /dev/null +++ b/Gestor.Model/Model.Domain.Seguros/Sinistro.cs @@ -0,0 +1,1132 @@ +using Gestor.Model.Attributes; +using Gestor.Model.Common; +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 Sinistro : DomainBase, IDomain + { + private string _numero; + + private DateTime? _dataReclamacao; + + private string _itemSinistrado; + + private string _descricao; + + private string _observacao; + + private string _motivo; + + private string _auxiliar; + + private string _observacaoInterna; + + private DateTime? _horaReclamacao; + + public bool Ativo + { + get; + set; + } + + [Description("AUXILIAR")] + [Log(true)] + public string Auxiliar + { + get + { + string str = this._auxiliar; + if (str != null) + { + return str.ToUpper(); + } + return null; + } + set + { + this._auxiliar = value; + } + } + + public Gestor.Model.Domain.Seguros.ControleSinistro ControleSinistro + { + get; + set; + } + + [Description("DATA CRIAÇÃO")] + [Log(true)] + public DateTime? DataAlteracao + { + get; + set; + } + + [Description("DATA CRIACAO")] + [Log(true)] + public DateTime? DataCriacao + { + get; + set; + } + + [Description("DATA LIQUIDAÇÃO")] + [Log(true)] + public DateTime? DataLiquidacao + { + get; + set; + } + + [Description("DATA RECLAMAÇÃO")] + [Log(true)] + public DateTime? DataReclamacao + { + get + { + return this._dataReclamacao; + } + set + { + if (!value.HasValue) + { + this._dataReclamacao = null; + return; + } + if (!this.HoraReclamacao.HasValue) + { + this.HoraReclamacao = value; + } + object obj = value.Value; + DateTime? horaReclamacao = this.HoraReclamacao; + this._dataReclamacao = new DateTime?(DateTime.Parse(string.Format("{0:d} {1:T}", obj, horaReclamacao.Value))); + } + } + + [Description("DESCRIÇÃO")] + [Log(true)] + public string Descricao + { + get + { + string str = this._descricao; + if (str != null) + { + return str.ToUpper(); + } + return null; + } + set + { + this._descricao = value; + } + } + + public DateTime? HoraReclamacao + { + get + { + return this._horaReclamacao; + } + set + { + DateTime? nullable; + this._horaReclamacao = value; + if (!value.HasValue) + { + return; + } + DateTime? dataReclamacao = this.DataReclamacao; + if (dataReclamacao.HasValue) + { + dataReclamacao = this.DataReclamacao; + nullable = new DateTime?(DateTime.Parse(string.Format("{0:d} {1:T}", dataReclamacao.Value, value))); + } + else + { + dataReclamacao = null; + nullable = dataReclamacao; + } + this.DataReclamacao = nullable; + } + } + + [Description("USUARIO ALTERACAO")] + [Log(true)] + public long IdUsuarioAlteracao + { + get; + set; + } + + [Description("USUARIO CRIACAO")] + [Log(true)] + public long IdUsuarioCriacao + { + get; + set; + } + + [Description("ITEM SINISTRADO")] + [Log(true)] + public string ItemSinistrado + { + get + { + string str = this._itemSinistrado; + if (str != null) + { + return str.ToUpper(); + } + return null; + } + set + { + this._itemSinistrado = value; + } + } + + [Description("MOTIVO")] + [Log(true)] + public string Motivo + { + get + { + string str = this._motivo; + if (str != null) + { + return str.ToUpper(); + } + return null; + } + set + { + this._motivo = value; + } + } + + [Log(true)] + public string Numero + { + get + { + string str = this._numero; + if (str != null) + { + return str.ToUpper(); + } + return null; + } + set + { + this._numero = value; + } + } + + public string Observacao + { + get + { + return this._observacao; + } + set + { + this._observacao = value; + } + } + + public string ObservacaoInterna + { + get + { + return this._observacaoInterna; + } + set + { + this._observacaoInterna = value; + } + } + + [Log(true)] + public Gestor.Model.Domain.Seguros.SinistroAuto SinistroAuto + { + get; + set; + } + + [Log(true)] + public Gestor.Model.Domain.Seguros.SinistroVida SinistroVida + { + get; + set; + } + + [Description("STATUS PERSONALIZADO")] + [Log(true)] + public string StatusPersonalizado + { + get; + set; + } + + [Description("STATUS")] + [Log(true)] + public Gestor.Model.Common.StatusSinistro? StatusSinistro + { + get; + set; + } + + [Description("TIPO")] + [Log(true)] + public Gestor.Model.Common.TipoSinistro? TipoSinistro + { + get; + set; + } + + [JsonIgnore] + public Func>> ValidationEvent + { + get + { + Sinistro sinistro = this; + return new Func>>(sinistro.Validate); + } + } + + [Description("VALOR")] + [Log(true)] + public decimal Valor + { + get; + set; + } + + [Description("VALOR FRANQUIA")] + [Log(true)] + public decimal ValorFranquia + { + get; + set; + } + + [Description("VALOR LIBERADO")] + [Log(true)] + public decimal ValorLiberado + { + get; + set; + } + + [Description("VALOR ORÇADO")] + [Log(true)] + public decimal ValorOrcado + { + get; + set; + } + + [Description("VALOR PAGO")] + [Log(true)] + public decimal ValorPago + { + get; + set; + } + + [Description("VALOR SALVADO")] + [Log(true)] + public decimal? ValorSalvado + { + get; + set; + } + + public Sinistro() + { + } + + public List Log() + { + DateTime? dataSinistro; + TipoPerda? tipoPerda; + bool? culpado; + EstadoCivil? estadoCivil; + string description; + string shortDateString; + string shortTimeString; + string str; + string shortTimeString1; + string shortDateString1; + string description1; + bool hasValue; + string str1; + bool flag; + string str2; + bool hasValue1; + string description2; + string certObito; + string certObito1; + string beneficiario; + string beneficiario1; + bool? nullable; + string numeroBo; + string numeroBo1; + string description3; + string str3; + string shortDateString2; + string endereco; + string endereco1; + string envolvido; + string envolvido1; + string motorista; + string motorista1; + string ddd; + string ddd1; + string telefone; + string telefone1; + string email; + string email1; + string str4; + bool parceiroMecanica; + string nome; + string str5; + bool parceiroFunilaria; + string nome1; + bool valueOrDefault; + List tupleLists = new List(); + TupleList tupleList = new TupleList(); + ObservableCollection> observableCollection = new ObservableCollection>(); + Gestor.Model.Common.TipoSinistro? tipoSinistro = this.TipoSinistro; + if (!tipoSinistro.HasValue) + { + description = ""; + } + else + { + tipoSinistro = this.TipoSinistro; + if (tipoSinistro.HasValue) + { + description = tipoSinistro.GetValueOrDefault().GetDescription(); + } + else + { + description = null; + } + } + observableCollection.Add(new Tuple("TIPO DO SINISTRO", description, "")); + observableCollection.Add(new Tuple("ITEM SINISTRADO", (string.IsNullOrWhiteSpace(this.ItemSinistrado) ? "" : this.ItemSinistrado), "")); + observableCollection.Add(new Tuple("NÚMERO DO SINISTRO", (string.IsNullOrWhiteSpace(this.Numero) ? "" : this.Numero), "")); + if (this.ControleSinistro == null) + { + shortDateString = ""; + } + else + { + Gestor.Model.Domain.Seguros.ControleSinistro controleSinistro = this.ControleSinistro; + if (controleSinistro != null) + { + dataSinistro = controleSinistro.DataSinistro; + if (dataSinistro.HasValue) + { + shortDateString = dataSinistro.GetValueOrDefault().ToShortDateString(); + } + else + { + shortDateString = null; + } + } + else + { + shortDateString = null; + } + } + observableCollection.Add(new Tuple("DATA DO SINISTRO", shortDateString, "")); + if (this.ControleSinistro == null) + { + shortTimeString = ""; + } + else + { + Gestor.Model.Domain.Seguros.ControleSinistro controleSinistro1 = this.ControleSinistro; + if (controleSinistro1 != null) + { + dataSinistro = controleSinistro1.HoraSinistro; + if (dataSinistro.HasValue) + { + shortTimeString = dataSinistro.GetValueOrDefault().ToShortTimeString(); + } + else + { + shortTimeString = null; + } + } + else + { + shortTimeString = null; + } + } + observableCollection.Add(new Tuple("HORA DO SINISTRO", shortTimeString, "")); + dataSinistro = this.DataReclamacao; + if (!dataSinistro.HasValue) + { + str = ""; + } + else + { + dataSinistro = this.DataReclamacao; + if (dataSinistro.HasValue) + { + str = dataSinistro.GetValueOrDefault().ToShortDateString(); + } + else + { + str = null; + } + } + observableCollection.Add(new Tuple("DATA DA RECLAMAÇÃO", str, "")); + dataSinistro = this.HoraReclamacao; + if (!dataSinistro.HasValue) + { + shortTimeString1 = ""; + } + else + { + dataSinistro = this.HoraReclamacao; + if (dataSinistro.HasValue) + { + shortTimeString1 = dataSinistro.GetValueOrDefault().ToShortTimeString(); + } + else + { + shortTimeString1 = null; + } + } + observableCollection.Add(new Tuple("HORA DA RECLAMAÇÃO", shortTimeString1, "")); + dataSinistro = this.DataLiquidacao; + if (!dataSinistro.HasValue) + { + shortDateString1 = ""; + } + else + { + dataSinistro = this.DataLiquidacao; + if (dataSinistro.HasValue) + { + shortDateString1 = dataSinistro.GetValueOrDefault().ToShortDateString(); + } + else + { + shortDateString1 = null; + } + } + observableCollection.Add(new Tuple("DATA DE LIQUIDAÇÃO", shortDateString1, "")); + Gestor.Model.Common.StatusSinistro? statusSinistro = this.StatusSinistro; + if (!statusSinistro.HasValue) + { + description1 = ""; + } + else + { + statusSinistro = this.StatusSinistro; + if (statusSinistro.HasValue) + { + description1 = statusSinistro.GetValueOrDefault().GetDescription(); + } + else + { + description1 = null; + } + } + observableCollection.Add(new Tuple("SITUAÇÃO", description1, "")); + decimal valor = this.Valor; + observableCollection.Add(new Tuple("VALOR", valor.ToString(new CultureInfo("pt-BR")), "")); + valor = this.ValorOrcado; + observableCollection.Add(new Tuple("VALOR ORÇADO", valor.ToString(new CultureInfo("pt-BR")), "")); + valor = this.ValorLiberado; + observableCollection.Add(new Tuple("VALOR LIBERADO", valor.ToString(new CultureInfo("pt-BR")), "")); + valor = this.ValorPago; + observableCollection.Add(new Tuple("VALOR PAGO", valor.ToString(new CultureInfo("pt-BR")), "")); + decimal? valorSalvado = this.ValorSalvado; + observableCollection.Add(new Tuple("VALOR SALVADO", valorSalvado.ToString(), "")); + valor = this.ValorFranquia; + observableCollection.Add(new Tuple("VALOR FRANQUIA", valor.ToString(new CultureInfo("pt-BR")), "")); + observableCollection.Add(new Tuple("MOTIVO", (string.IsNullOrWhiteSpace(this.Motivo) ? "" : this.Motivo), "")); + observableCollection.Add(new Tuple("AUXILIAR", (string.IsNullOrWhiteSpace(this.Auxiliar) ? "" : this.Auxiliar), "")); + observableCollection.Add(new Tuple("DESCRIÇÃO", (string.IsNullOrWhiteSpace(this.Descricao) ? "" : this.Descricao), "")); + tupleList.Tuples = observableCollection; + tupleLists.Add(tupleList); + List tupleLists1 = tupleLists; + if (this.SinistroAuto != null) + { + ObservableCollection> tuples = tupleLists1[0].Tuples; + Gestor.Model.Domain.Seguros.SinistroAuto sinistroAuto = this.SinistroAuto; + if (sinistroAuto != null) + { + numeroBo = sinistroAuto.NumeroBo; + } + else + { + numeroBo = null; + } + if (string.IsNullOrWhiteSpace(numeroBo)) + { + numeroBo1 = ""; + } + else + { + Gestor.Model.Domain.Seguros.SinistroAuto sinistroAuto1 = this.SinistroAuto; + if (sinistroAuto1 != null) + { + numeroBo1 = sinistroAuto1.NumeroBo; + } + else + { + numeroBo1 = null; + } + } + tuples.Add(new Tuple("NÚMERO DO B.O.", numeroBo1, "")); + ObservableCollection> tuples1 = tupleLists1[0].Tuples; + tipoPerda = this.SinistroAuto.TipoPerda; + if (!tipoPerda.HasValue) + { + description3 = ""; + } + else + { + Gestor.Model.Domain.Seguros.SinistroAuto sinistroAuto2 = this.SinistroAuto; + if (sinistroAuto2 != null) + { + tipoPerda = sinistroAuto2.TipoPerda; + if (tipoPerda.HasValue) + { + description3 = tipoPerda.GetValueOrDefault().GetDescription(); + } + else + { + description3 = null; + } + } + else + { + description3 = null; + } + } + tuples1.Add(new Tuple("TIPO DE PERDA", description3, "")); + ObservableCollection> observableCollection1 = tupleLists1[0].Tuples; + culpado = this.SinistroAuto.Culpado; + if (culpado.HasValue) + { + Gestor.Model.Domain.Seguros.SinistroAuto sinistroAuto3 = this.SinistroAuto; + if (sinistroAuto3 != null) + { + culpado = sinistroAuto3.Culpado; + bool flag1 = false; + valueOrDefault = culpado.GetValueOrDefault() == flag1 & culpado.HasValue; + } + else + { + valueOrDefault = false; + } + if (valueOrDefault) + { + goto Label1; + } + str3 = "SIM"; + goto Label0; + } + Label1: + str3 = "NÃO"; + Label0: + observableCollection1.Add(new Tuple("CONSIDERA-SE CULPADO?", str3, "")); + ObservableCollection> tuples2 = tupleLists1[0].Tuples; + dataSinistro = this.SinistroAuto.UltimoDocEnviado; + if (!dataSinistro.HasValue) + { + shortDateString2 = ""; + } + else + { + Gestor.Model.Domain.Seguros.SinistroAuto sinistroAuto4 = this.SinistroAuto; + if (sinistroAuto4 != null) + { + dataSinistro = sinistroAuto4.UltimoDocEnviado; + if (dataSinistro.HasValue) + { + shortDateString2 = dataSinistro.GetValueOrDefault().ToShortDateString(); + } + else + { + shortDateString2 = null; + } + } + else + { + shortDateString2 = null; + } + } + tuples2.Add(new Tuple("ÚLTIMO DOC. ENVIADO", shortDateString2, "")); + ObservableCollection> observableCollection2 = tupleLists1[0].Tuples; + Gestor.Model.Domain.Seguros.SinistroAuto sinistroAuto5 = this.SinistroAuto; + if (sinistroAuto5 != null) + { + endereco = sinistroAuto5.Endereco; + } + else + { + endereco = null; + } + if (string.IsNullOrWhiteSpace(endereco)) + { + endereco1 = ""; + } + else + { + Gestor.Model.Domain.Seguros.SinistroAuto sinistroAuto6 = this.SinistroAuto; + if (sinistroAuto6 != null) + { + endereco1 = sinistroAuto6.Endereco; + } + else + { + endereco1 = null; + } + } + observableCollection2.Add(new Tuple("ENDEREÇO", endereco1, "")); + ObservableCollection> tuples3 = tupleLists1[0].Tuples; + Gestor.Model.Domain.Seguros.SinistroAuto sinistroAuto7 = this.SinistroAuto; + if (sinistroAuto7 != null) + { + envolvido = sinistroAuto7.Envolvido; + } + else + { + envolvido = null; + } + if (string.IsNullOrWhiteSpace(envolvido)) + { + envolvido1 = ""; + } + else + { + Gestor.Model.Domain.Seguros.SinistroAuto sinistroAuto8 = this.SinistroAuto; + if (sinistroAuto8 != null) + { + envolvido1 = sinistroAuto8.Envolvido; + } + else + { + envolvido1 = null; + } + } + tuples3.Add(new Tuple("ENVOLVIDO/PROPRIETÁRIO", envolvido1, "")); + ObservableCollection> observableCollection3 = tupleLists1[0].Tuples; + Gestor.Model.Domain.Seguros.SinistroAuto sinistroAuto9 = this.SinistroAuto; + if (sinistroAuto9 != null) + { + motorista = sinistroAuto9.Motorista; + } + else + { + motorista = null; + } + if (string.IsNullOrWhiteSpace(motorista)) + { + motorista1 = ""; + } + else + { + Gestor.Model.Domain.Seguros.SinistroAuto sinistroAuto10 = this.SinistroAuto; + if (sinistroAuto10 != null) + { + motorista1 = sinistroAuto10.Motorista; + } + else + { + motorista1 = null; + } + } + observableCollection3.Add(new Tuple("MOTORISTA", motorista1, "")); + ObservableCollection> tuples4 = tupleLists1[0].Tuples; + Gestor.Model.Domain.Seguros.SinistroAuto sinistroAuto11 = this.SinistroAuto; + if (sinistroAuto11 != null) + { + ddd = sinistroAuto11.Ddd; + } + else + { + ddd = null; + } + if (string.IsNullOrWhiteSpace(ddd)) + { + ddd1 = ""; + } + else + { + Gestor.Model.Domain.Seguros.SinistroAuto sinistroAuto12 = this.SinistroAuto; + if (sinistroAuto12 != null) + { + ddd1 = sinistroAuto12.Ddd; + } + else + { + ddd1 = null; + } + } + tuples4.Add(new Tuple("DDD", ddd1, "")); + ObservableCollection> observableCollection4 = tupleLists1[0].Tuples; + Gestor.Model.Domain.Seguros.SinistroAuto sinistroAuto13 = this.SinistroAuto; + if (sinistroAuto13 != null) + { + telefone = sinistroAuto13.Telefone; + } + else + { + telefone = null; + } + if (string.IsNullOrWhiteSpace(telefone)) + { + telefone1 = ""; + } + else + { + Gestor.Model.Domain.Seguros.SinistroAuto sinistroAuto14 = this.SinistroAuto; + if (sinistroAuto14 != null) + { + telefone1 = sinistroAuto14.Telefone; + } + else + { + telefone1 = null; + } + } + observableCollection4.Add(new Tuple("TELEFONE", telefone1, "")); + ObservableCollection> tuples5 = tupleLists1[0].Tuples; + Gestor.Model.Domain.Seguros.SinistroAuto sinistroAuto15 = this.SinistroAuto; + if (sinistroAuto15 != null) + { + email = sinistroAuto15.Email; + } + else + { + email = null; + } + if (string.IsNullOrWhiteSpace(email)) + { + email1 = ""; + } + else + { + Gestor.Model.Domain.Seguros.SinistroAuto sinistroAuto16 = this.SinistroAuto; + if (sinistroAuto16 != null) + { + email1 = sinistroAuto16.Email; + } + else + { + email1 = null; + } + } + tuples5.Add(new Tuple("E-MAIL", email1, "")); + ObservableCollection> observableCollection5 = tupleLists1[0].Tuples; + Gestor.Model.Domain.Seguros.SinistroAuto sinistroAuto17 = this.SinistroAuto; + if (sinistroAuto17 != null) + { + valor = sinistroAuto17.ValorMecanica; + str4 = valor.ToString(new CultureInfo("pt-BR")); + } + else + { + str4 = null; + } + observableCollection5.Add(new Tuple("VALOR MECÂNICA", str4, "")); + ObservableCollection> tuples6 = tupleLists1[0].Tuples; + Gestor.Model.Domain.Seguros.SinistroAuto sinistroAuto18 = this.SinistroAuto; + if (sinistroAuto18 != null) + { + parceiroMecanica = sinistroAuto18.ParceiroMecanica; + } + else + { + parceiroMecanica = false; + } + if (!parceiroMecanica) + { + nome = ""; + } + else + { + Gestor.Model.Domain.Seguros.SinistroAuto sinistroAuto19 = this.SinistroAuto; + if (sinistroAuto19 != null) + { + Parceiro parceiro = sinistroAuto19.ParceiroMecanica; + if (parceiro != null) + { + nome = parceiro.Nome; + } + else + { + nome = null; + } + } + else + { + nome = null; + } + } + tuples6.Add(new Tuple("PARCEIRO MECÂNICA", nome, "")); + ObservableCollection> observableCollection6 = tupleLists1[0].Tuples; + Gestor.Model.Domain.Seguros.SinistroAuto sinistroAuto20 = this.SinistroAuto; + if (sinistroAuto20 != null) + { + valor = sinistroAuto20.ValorFunilaria; + str5 = valor.ToString(new CultureInfo("pt-BR")); + } + else + { + str5 = null; + } + observableCollection6.Add(new Tuple("VALOR FUNILARIA", str5, "")); + ObservableCollection> tuples7 = tupleLists1[0].Tuples; + Gestor.Model.Domain.Seguros.SinistroAuto sinistroAuto21 = this.SinistroAuto; + if (sinistroAuto21 != null) + { + parceiroFunilaria = sinistroAuto21.ParceiroFunilaria; + } + else + { + parceiroFunilaria = false; + } + if (!parceiroFunilaria) + { + nome1 = ""; + } + else + { + Gestor.Model.Domain.Seguros.SinistroAuto sinistroAuto22 = this.SinistroAuto; + if (sinistroAuto22 != null) + { + Parceiro parceiroFunilaria1 = sinistroAuto22.ParceiroFunilaria; + if (parceiroFunilaria1 != null) + { + nome1 = parceiroFunilaria1.Nome; + } + else + { + nome1 = null; + } + } + else + { + nome1 = null; + } + } + tuples7.Add(new Tuple("PARCEIRO FUNILARIA", nome1, "")); + } + if (this.SinistroVida != null) + { + ObservableCollection> observableCollection7 = tupleLists1[0].Tuples; + Gestor.Model.Domain.Seguros.SinistroVida sinistroVida = this.SinistroVida; + if (sinistroVida != null) + { + tipoPerda = sinistroVida.TipoPerda; + hasValue = !tipoPerda.HasValue; + } + else + { + hasValue = true; + } + if (hasValue) + { + str1 = ""; + } + else + { + Gestor.Model.Domain.Seguros.SinistroVida sinistroVida1 = this.SinistroVida; + if (sinistroVida1 != null) + { + tipoPerda = sinistroVida1.TipoPerda; + if (tipoPerda.HasValue) + { + str1 = tipoPerda.GetValueOrDefault().GetDescription(); + } + else + { + str1 = null; + } + } + else + { + str1 = null; + } + } + observableCollection7.Add(new Tuple("TIPO DE PERDA", str1, "")); + ObservableCollection> tuples8 = tupleLists1[0].Tuples; + Gestor.Model.Domain.Seguros.SinistroVida sinistroVida2 = this.SinistroVida; + if (sinistroVida2 != null) + { + culpado = sinistroVida2.AuxFuneral; + flag = !culpado.HasValue; + } + else + { + flag = true; + } + if (flag) + { + str2 = ""; + } + else + { + Gestor.Model.Domain.Seguros.SinistroVida sinistroVida3 = this.SinistroVida; + if (sinistroVida3 != null) + { + culpado = sinistroVida3.AuxFuneral; + nullable = new bool?(culpado.Value); + } + else + { + culpado = null; + nullable = culpado; + } + culpado = nullable; + str2 = (culpado.Value ? "SIM" : "NÃO"); + } + tuples8.Add(new Tuple("AUXÍLIO FUNERAL", str2, "")); + ObservableCollection> observableCollection8 = tupleLists1[0].Tuples; + Gestor.Model.Domain.Seguros.SinistroVida sinistroVida4 = this.SinistroVida; + if (sinistroVida4 != null) + { + estadoCivil = sinistroVida4.EstadoCivil; + hasValue1 = !estadoCivil.HasValue; + } + else + { + hasValue1 = true; + } + if (hasValue1) + { + description2 = ""; + } + else + { + Gestor.Model.Domain.Seguros.SinistroVida sinistroVida5 = this.SinistroVida; + if (sinistroVida5 != null) + { + estadoCivil = sinistroVida5.EstadoCivil; + if (estadoCivil.HasValue) + { + description2 = estadoCivil.GetValueOrDefault().GetDescription(); + } + else + { + description2 = null; + } + } + else + { + description2 = null; + } + } + observableCollection8.Add(new Tuple("ESTADO CIVIL", description2, "")); + ObservableCollection> tuples9 = tupleLists1[0].Tuples; + Gestor.Model.Domain.Seguros.SinistroVida sinistroVida6 = this.SinistroVida; + if (sinistroVida6 != null) + { + certObito = sinistroVida6.CertObito; + } + else + { + certObito = null; + } + if (string.IsNullOrWhiteSpace(certObito)) + { + certObito1 = ""; + } + else + { + Gestor.Model.Domain.Seguros.SinistroVida sinistroVida7 = this.SinistroVida; + if (sinistroVida7 != null) + { + certObito1 = sinistroVida7.CertObito; + } + else + { + certObito1 = null; + } + } + tuples9.Add(new Tuple("CERTIDÃO DE ÓBITO", certObito1, "")); + ObservableCollection> observableCollection9 = tupleLists1[0].Tuples; + Gestor.Model.Domain.Seguros.SinistroVida sinistroVida8 = this.SinistroVida; + if (sinistroVida8 != null) + { + beneficiario = sinistroVida8.Beneficiario; + } + else + { + beneficiario = null; + } + if (string.IsNullOrWhiteSpace(beneficiario)) + { + beneficiario1 = ""; + } + else + { + Gestor.Model.Domain.Seguros.SinistroVida sinistroVida9 = this.SinistroVida; + if (sinistroVida9 != null) + { + beneficiario1 = sinistroVida9.Beneficiario; + } + else + { + beneficiario1 = null; + } + } + observableCollection9.Add(new Tuple("BENEFICIÁRIO", beneficiario1, "")); + } + return tupleLists1; + } + + public List> Validate() + { + List> keyValuePairs = ValidationHelper.AddValue(); + if (this.DataReclamacao.HasValue && (DateTime.Compare(this.DataReclamacao.Value, new DateTime(1753, 1, 1)) < 0 || DateTime.Compare(this.DataReclamacao.Value, new DateTime(9999, 12, 31)) > 0)) + { + keyValuePairs.AddValue("DataReclamacao", string.Format(Messages.DataInvalida, Array.Empty()), true); + } + if (this.HoraReclamacao.HasValue && (DateTime.Compare(this.HoraReclamacao.Value, new DateTime(1753, 1, 1)) < 0 || DateTime.Compare(this.HoraReclamacao.Value, new DateTime(9999, 12, 31)) > 0)) + { + keyValuePairs.AddValue("HoraReclamacao", string.Format(Messages.DataInvalida, Array.Empty()), true); + } + if (this.DataLiquidacao.HasValue && (DateTime.Compare(this.DataLiquidacao.Value, new DateTime(1753, 1, 1)) < 0 || DateTime.Compare(this.DataLiquidacao.Value, new DateTime(9999, 12, 31)) > 0)) + { + keyValuePairs.AddValue("DataLiquidacao", string.Format(Messages.DataInvalida, Array.Empty()), true); + } + if (this.ControleSinistro != null) + { + keyValuePairs.AddRange(this.ControleSinistro.Validate()); + } + if (!this.DataReclamacao.HasValue) + { + keyValuePairs.AddValue("DataReclamacao", Messages.Obrigatorio, true); + } + if (this.StatusSinistro.GetValueOrDefault() != Gestor.Model.Common.StatusSinistro.EmAndamento && !this.DataLiquidacao.HasValue) + { + keyValuePairs.AddValue("DataLiquidacao", Messages.Obrigatorio, true); + } + return keyValuePairs; + } + } +} \ No newline at end of file -- cgit v1.2.3