diff options
| author | Lucas Faria Mendes <lucas.fariamo08@gmail.com> | 2026-03-30 13:38:18 +0000 |
|---|---|---|
| committer | Lucas Faria Mendes <lucas.fariamo08@gmail.com> | 2026-03-30 13:38:18 +0000 |
| commit | 1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1 (patch) | |
| tree | e1c3b20ea08f0cf71122a1e73f0d395f8fd83874 /Codemerx/Gestor.Model/Model.Domain.Seguros/Usuario.cs | |
| parent | 674ca83ba9243a9e95a7568c797668dab6aee26a (diff) | |
| download | gestor-1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1.tar.gz gestor-1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1.zip | |
chore: location
Diffstat (limited to 'Codemerx/Gestor.Model/Model.Domain.Seguros/Usuario.cs')
| -rw-r--r-- | Codemerx/Gestor.Model/Model.Domain.Seguros/Usuario.cs | 872 |
1 files changed, 872 insertions, 0 deletions
diff --git a/Codemerx/Gestor.Model/Model.Domain.Seguros/Usuario.cs b/Codemerx/Gestor.Model/Model.Domain.Seguros/Usuario.cs new file mode 100644 index 0000000..39c6cc1 --- /dev/null +++ b/Codemerx/Gestor.Model/Model.Domain.Seguros/Usuario.cs @@ -0,0 +1,872 @@ +using Gestor.Model.API;
+using Gestor.Model.Attributes;
+using Gestor.Model.Common;
+using Gestor.Model.Domain.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.Runtime.CompilerServices;
+using System.Text.RegularExpressions;
+
+namespace Gestor.Model.Domain.Seguros
+{
+ public class Usuario : EnderecoBase, IDomain
+ {
+ private string _nome;
+
+ private string _prefixo;
+
+ private string _telefone;
+
+ private string _prefixo2;
+
+ private string _telefone2;
+
+ private string _email;
+
+ private string _documento;
+
+ private string _identidade;
+
+ private string _estadoEmissor;
+
+ private string _agencia;
+
+ private string _conta;
+
+ private string _login;
+
+ private bool? _segunda;
+
+ private bool? _terca;
+
+ private bool? _quarta;
+
+ private bool? _quinta;
+
+ private bool? _sexta;
+
+ private bool? _sabado;
+
+ private bool? _domingo;
+
+ private bool? _dashboard;
+
+ private TipoTelaInicial? _telaInicial;
+
+ [Log(true)]
+ public bool Administrador
+ {
+ get;
+ set;
+ }
+
+ [Description("PERMISSÃO ADMINISTRADOR CENTRAL SEGURADO")]
+ [Log(true)]
+ public bool AdministradorCentralSegurado
+ {
+ get;
+ set;
+ }
+
+ [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 bool Aggilizador
+ {
+ get;
+ set;
+ }
+
+ [Log(true)]
+ public Gestor.Model.Domain.Common.Banco Banco
+ {
+ get;
+ set;
+ }
+
+ [Log(true)]
+ public string Cargo
+ {
+ 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;
+ }
+ }
+
+ [Description("ACESSO AO DASHBOARD")]
+ [Log(true)]
+ public bool? Dashboard
+ {
+ get
+ {
+ return this._dashboard;
+ }
+ set
+ {
+ this._dashboard = new bool?(value.GetValueOrDefault(true));
+ }
+ }
+
+ [Log(true)]
+ public string Documento
+ {
+ get
+ {
+ string str = this._documento;
+ if (str == null)
+ {
+ return null;
+ }
+ return str.ToUpper().Trim();
+ }
+ set
+ {
+ this._documento = value;
+ }
+ }
+
+ [Description("ACESSO AOS DOMINGOS")]
+ [Log(true)]
+ public bool? Domingo
+ {
+ get
+ {
+ return this._domingo;
+ }
+ set
+ {
+ this._domingo = new bool?(value.GetValueOrDefault(true));
+ }
+ }
+
+ [Log(true)]
+ public string Email
+ {
+ get
+ {
+ string str = this._email;
+ if (str == null)
+ {
+ return null;
+ }
+ return str.ToLower().Trim();
+ }
+ set
+ {
+ this._email = value;
+ }
+ }
+
+ [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 Excluido
+ {
+ get;
+ set;
+ }
+
+ [Description("DATA DE EXPEDIÇÃO")]
+ [Log(true)]
+ public DateTime? Expedicao
+ {
+ get;
+ set;
+ }
+
+ [Description("FILTRO INICIAL")]
+ [Log(true)]
+ public TipoFiltroCliente? FiltroInicial
+ {
+ get;
+ set;
+ }
+
+ [Description("FIM DO ACESSO")]
+ public DateTime? FimAcesso
+ {
+ get;
+ set;
+ }
+
+ 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("INÍCIO DO ACESSO")]
+ public DateTime? InicioAcesso
+ {
+ get;
+ set;
+ }
+
+ [Log(true)]
+ public string Login
+ {
+ get
+ {
+ string str = this._login;
+ if (str != null)
+ {
+ return str.ToUpper();
+ }
+ return null;
+ }
+ set
+ {
+ this._login = value;
+ }
+ }
+
+ [Description("ACESSO AO MOBILE")]
+ [Log(true)]
+ public bool Mobile
+ {
+ get;
+ set;
+ }
+
+ [Description("DATA DE NASCIMENTO")]
+ [Log(true)]
+ public DateTime? Nascimento
+ {
+ get;
+ set;
+ }
+
+ [Log(true)]
+ [Name(true)]
+ public string Nome
+ {
+ get
+ {
+ return this._nome;
+ }
+ set
+ {
+ this._nome = value;
+ }
+ }
+
+ [Description("PERMISSÃO ACESSO AGGILIZADOR")]
+ [Log(true)]
+ public long? PermissaoAggilizador
+ {
+ get;
+ set;
+ }
+
+ [Description("PREFIXO TELEFONE 1")]
+ [Log(true)]
+ public string Prefixo
+ {
+ get
+ {
+ string str = this._prefixo;
+ if (str == null)
+ {
+ return null;
+ }
+ return str.ToUpper().Trim();
+ }
+ set
+ {
+ this._prefixo = value;
+ }
+ }
+
+ [Description("PREFIXO TELEFONE 2")]
+ [Log(true)]
+ public string Prefixo2
+ {
+ get
+ {
+ string str = this._prefixo2;
+ if (str == null)
+ {
+ return null;
+ }
+ return str.ToUpper().Trim();
+ }
+ set
+ {
+ this._prefixo2 = value;
+ }
+ }
+
+ [Description("ACESSO ÁS QUARTAS-FEIRAS")]
+ [Log(true)]
+ public bool? Quarta
+ {
+ get
+ {
+ return this._quarta;
+ }
+ set
+ {
+ this._quarta = new bool?(value.GetValueOrDefault(true));
+ }
+ }
+
+ [Description("ACESSO ÁS QUINTAS-FEIRAS")]
+ [Log(true)]
+ public bool? Quinta
+ {
+ get
+ {
+ return this._quinta;
+ }
+ set
+ {
+ this._quinta = new bool?(value.GetValueOrDefault(true));
+ }
+ }
+
+ [Description("ACESSO AOS RESULTADOS MOBILE")]
+ [Log(true)]
+ public bool Resultados
+ {
+ get;
+ set;
+ }
+
+ [Description("ACESSO AOS SÁBADOS")]
+ [Log(true)]
+ public bool? Sabado
+ {
+ get
+ {
+ return this._sabado;
+ }
+ set
+ {
+ this._sabado = new bool?(value.GetValueOrDefault(true));
+ }
+ }
+
+ [Description("ACESSO ÀS SEGUNDAS-FEIRAS")]
+ [Log(true)]
+ public bool? Segunda
+ {
+ get
+ {
+ return this._segunda;
+ }
+ set
+ {
+ this._segunda = new bool?(value.GetValueOrDefault(true));
+ }
+ }
+
+ public bool Selecionado
+ {
+ get;
+ set;
+ }
+
+ public string Senha
+ {
+ get;
+ set;
+ }
+
+ public string SenhaAnterior { get; set; } = string.Empty;
+
+ [Log(true)]
+ public Gestor.Model.Common.Sexo Sexo
+ {
+ get;
+ set;
+ }
+
+ [Description("ACESSO ÁS SEXTAS-FEIRAS")]
+ [Log(true)]
+ public bool? Sexta
+ {
+ get
+ {
+ return this._sexta;
+ }
+ set
+ {
+ this._sexta = new bool?(value.GetValueOrDefault(true));
+ }
+ }
+
+ public string SsoId
+ {
+ get;
+ set;
+ }
+
+ [Log(true)]
+ public TipoTelaInicial? TelaInicial
+ {
+ get
+ {
+ return new TipoTelaInicial?(this._telaInicial.GetValueOrDefault());
+ }
+ set
+ {
+ this._telaInicial = new TipoTelaInicial?(value.GetValueOrDefault());
+ }
+ }
+
+ [Description("TELEFONE 1")]
+ [Log(true)]
+ public string Telefone
+ {
+ get
+ {
+ string str = this._telefone;
+ if (str == null)
+ {
+ return null;
+ }
+ return str.ToUpper().Trim();
+ }
+ set
+ {
+ this._telefone = value;
+ }
+ }
+
+ [Description("TELEFONE 2")]
+ [Log(true)]
+ public string Telefone2
+ {
+ get
+ {
+ string str = this._telefone2;
+ if (str == null)
+ {
+ return null;
+ }
+ return str.ToUpper().Trim();
+ }
+ set
+ {
+ this._telefone2 = value;
+ }
+ }
+
+ [Description("ACESSO ÀS TERÇAS-FEIRAS")]
+ [Log(true)]
+ public bool? Terca
+ {
+ get
+ {
+ return this._terca;
+ }
+ set
+ {
+ this._terca = new bool?(value.GetValueOrDefault(true));
+ }
+ }
+
+ [Description("TIPO DO TELEFONE 1")]
+ [Log(true)]
+ public Gestor.Model.Common.TipoTelefone? TipoTelefone
+ {
+ get;
+ set;
+ }
+
+ [Description("TIPO DO TELEFONE 2")]
+ [Log(true)]
+ public Gestor.Model.Common.TipoTelefone? TipoTelefone2
+ {
+ get;
+ set;
+ }
+
+ public string TokenSso
+ {
+ get;
+ set;
+ }
+
+ [JsonIgnore]
+ public Func<List<KeyValuePair<string, string>>> ValidationEvent
+ {
+ get
+ {
+ Usuario usuario = this;
+ return new Func<List<KeyValuePair<string, string>>>(usuario.Validate);
+ }
+ }
+
+ public string Visita
+ {
+ get;
+ set;
+ }
+
+ public Usuario()
+ {
+ }
+
+ public List<TupleList> Log()
+ {
+ string shortDateString;
+ string str;
+ string nome;
+ string shortTimeString;
+ string shortTimeString1;
+ List<TupleList> tupleLists = new List<TupleList>();
+ TupleList tupleList = new TupleList();
+ ObservableCollection<Tuple<string, string, string>> observableCollection = new ObservableCollection<Tuple<string, string, string>>()
+ {
+ new Tuple<string, string, string>("NOME", (string.IsNullOrWhiteSpace(this.Nome) ? "" : this.Nome), ""),
+ new Tuple<string, string, string>("CPF/CNPJ", (string.IsNullOrWhiteSpace(this.Documento) ? "" : this.Documento), ""),
+ new Tuple<string, string, string>("USUÁRIO", (string.IsNullOrWhiteSpace(this.Login) ? "" : this.Login), ""),
+ new Tuple<string, string, string>("IDENTIDADE", (string.IsNullOrWhiteSpace(this.Identidade) ? "" : this.Identidade), ""),
+ new Tuple<string, string, string>("ESTADO EMISSOR", (string.IsNullOrWhiteSpace(this.EstadoEmissor) ? "" : this.EstadoEmissor), "")
+ };
+ DateTime? expedicao = this.Expedicao;
+ if (!expedicao.HasValue)
+ {
+ shortDateString = "";
+ }
+ else
+ {
+ expedicao = this.Expedicao;
+ if (expedicao.HasValue)
+ {
+ shortDateString = expedicao.GetValueOrDefault().ToShortDateString();
+ }
+ else
+ {
+ shortDateString = null;
+ }
+ }
+ observableCollection.Add(new Tuple<string, string, string>("DATA DE EXPEDIÇÃO", shortDateString, ""));
+ observableCollection.Add(new Tuple<string, string, string>("SEXO", this.Sexo.GetDescription(), ""));
+ expedicao = this.Nascimento;
+ if (!expedicao.HasValue)
+ {
+ str = "";
+ }
+ else
+ {
+ expedicao = this.Nascimento;
+ if (expedicao.HasValue)
+ {
+ str = expedicao.GetValueOrDefault().ToShortDateString();
+ }
+ else
+ {
+ str = null;
+ }
+ }
+ observableCollection.Add(new Tuple<string, string, string>("DATA DE NASCIMENTO", str, ""));
+ if (this.Banco == null)
+ {
+ nome = "";
+ }
+ else
+ {
+ Gestor.Model.Domain.Common.Banco banco = this.Banco;
+ if (banco != null)
+ {
+ nome = banco.Nome;
+ }
+ else
+ {
+ nome = null;
+ }
+ }
+ observableCollection.Add(new Tuple<string, string, string>("BANCO", nome, ""));
+ observableCollection.Add(new Tuple<string, string, string>("AGÊNCIA", (string.IsNullOrWhiteSpace(this.Agencia) ? "" : this.Agencia), ""));
+ observableCollection.Add(new Tuple<string, string, string>("CONTA", (string.IsNullOrWhiteSpace(this.Conta) ? "" : this.Conta), ""));
+ observableCollection.Add(new Tuple<string, string, string>("ENDEREÇO", (string.IsNullOrWhiteSpace(base.Endereco) ? "" : base.Endereco), ""));
+ observableCollection.Add(new Tuple<string, string, string>("NÚMERO", (string.IsNullOrWhiteSpace(base.Numero) ? "" : base.Numero), ""));
+ observableCollection.Add(new Tuple<string, string, string>("COMPLEMENTO", (string.IsNullOrWhiteSpace(base.Complemento) ? "" : base.Complemento), ""));
+ observableCollection.Add(new Tuple<string, string, string>("BAIRRO", (string.IsNullOrWhiteSpace(base.Bairro) ? "" : base.Bairro), ""));
+ observableCollection.Add(new Tuple<string, string, string>("CIDADE", (string.IsNullOrWhiteSpace(base.Cidade) ? "" : base.Cidade), ""));
+ observableCollection.Add(new Tuple<string, string, string>("ESTADO", (string.IsNullOrWhiteSpace(base.Estado) ? "" : base.Estado), ""));
+ observableCollection.Add(new Tuple<string, string, string>("CEP", (string.IsNullOrWhiteSpace(base.Cep) ? "" : base.Cep), ""));
+ observableCollection.Add(new Tuple<string, string, string>("TIPO TELEFONE", (!this.TipoTelefone.HasValue ? "" : this.TipoTelefone.GetDescription()), ""));
+ observableCollection.Add(new Tuple<string, string, string>("PRIMEIRO PREFIXO", (string.IsNullOrWhiteSpace(this.Prefixo) ? "" : this.Prefixo), ""));
+ observableCollection.Add(new Tuple<string, string, string>("PRIMEIRO TELEFONE", (string.IsNullOrWhiteSpace(this.Telefone) ? "" : this.Telefone), ""));
+ observableCollection.Add(new Tuple<string, string, string>("TIPO TELEFONE", (!this.TipoTelefone2.HasValue ? "" : this.TipoTelefone2.GetDescription()), ""));
+ observableCollection.Add(new Tuple<string, string, string>("SEGUNDO PREFIXO", (string.IsNullOrWhiteSpace(this.Prefixo2) ? "" : this.Prefixo2), ""));
+ observableCollection.Add(new Tuple<string, string, string>("SEGUNDO TELEFONE", (string.IsNullOrWhiteSpace(this.Telefone2) ? "" : this.Telefone2), ""));
+ observableCollection.Add(new Tuple<string, string, string>("EMAIL", (string.IsNullOrWhiteSpace(this.Email) ? "" : this.Email), ""));
+ observableCollection.Add(new Tuple<string, string, string>("ACESSO MOBILE", (this.Mobile ? "SIM" : "NÃO"), ""));
+ observableCollection.Add(new Tuple<string, string, string>("ACESSO RESULTADOS", (this.Resultados ? "SIM" : "NÃO"), ""));
+ observableCollection.Add(new Tuple<string, string, string>("ACESSO INDIVIDUAL AGGILIZADOR", (this.Aggilizador ? "SIM" : "NÃO"), ""));
+ expedicao = this.InicioAcesso;
+ if (!expedicao.HasValue)
+ {
+ shortTimeString = "";
+ }
+ else
+ {
+ expedicao = this.InicioAcesso;
+ if (expedicao.HasValue)
+ {
+ shortTimeString = expedicao.GetValueOrDefault().ToShortTimeString();
+ }
+ else
+ {
+ shortTimeString = null;
+ }
+ }
+ observableCollection.Add(new Tuple<string, string, string>("INÍCIO DO ACESSO", shortTimeString, ""));
+ expedicao = this.FimAcesso;
+ if (!expedicao.HasValue)
+ {
+ shortTimeString1 = "";
+ }
+ else
+ {
+ expedicao = this.FimAcesso;
+ if (expedicao.HasValue)
+ {
+ shortTimeString1 = expedicao.GetValueOrDefault().ToShortTimeString();
+ }
+ else
+ {
+ shortTimeString1 = null;
+ }
+ }
+ observableCollection.Add(new Tuple<string, string, string>("FIM DO ACESSO", shortTimeString1, ""));
+ observableCollection.Add(new Tuple<string, string, string>("ADMINISTRADOR CENTRAL SEGURADO", (this.AdministradorCentralSegurado ? "SIM" : "NÃO"), ""));
+ tupleList.Tuples = observableCollection;
+ tupleLists.Add(tupleList);
+ return tupleLists;
+ }
+
+ public UserSso ToUserSso(string serial, string documentoEmpresa, string ssoId = null)
+ {
+ return new UserSso()
+ {
+ Id = ssoId,
+ Name = this.Nome,
+ Username = this.Login,
+ Password = this.Senha,
+ Serial = serial,
+ CustomerDocument = documentoEmpresa,
+ IdEmpresa = this.IdEmpresa,
+ Document = this.Documento,
+ IsDeleted = false,
+ Email = this.Email ?? string.Empty,
+ Phone = (string.IsNullOrEmpty(this.Prefixo) || string.IsNullOrEmpty(this.Telefone) ? string.Empty : string.Concat(this.Prefixo.Clear(), this.Telefone.Clear()))
+ };
+ }
+
+ public List<KeyValuePair<string, string>> Validate()
+ {
+ List<KeyValuePair<string, string>> keyValuePairs = ValidationHelper.AddValue();
+ if (this.Expedicao.HasValue && (DateTime.Compare(this.Expedicao.Value, new DateTime(1753, 1, 1)) < 0 || DateTime.Compare(this.Expedicao.Value, new DateTime(9999, 12, 31)) > 0))
+ {
+ keyValuePairs.AddValue<string, string>("Expedicao", string.Format(Messages.DataInvalida, Array.Empty<object>()), true);
+ }
+ if (this.Nascimento.HasValue && (DateTime.Compare(this.Nascimento.Value, new DateTime(1753, 1, 1)) < 0 || DateTime.Compare(this.Nascimento.Value, new DateTime(9999, 12, 31)) > 0))
+ {
+ keyValuePairs.AddValue<string, string>("Nascimento", string.Format(Messages.DataInvalida, Array.Empty<object>()), true);
+ }
+ if (this.InicioAcesso.HasValue && this.FimAcesso.HasValue && this.InicioAcesso.Value.TimeOfDay > this.FimAcesso.Value.TimeOfDay)
+ {
+ keyValuePairs.AddValue<string, string>("FimAcesso|FIM DO ACESSO", "O HORÁRIO DO FIM DO ACESSO NÃO PODE SER ANTERIOR AO HORÁRIO DO INICIO DO ACESSO", true);
+ }
+ if (string.IsNullOrEmpty(this.Nome))
+ {
+ keyValuePairs.AddValue<string, string>("Nome", Messages.Obrigatorio, true);
+ }
+ else if (this.Nome.Length > 50)
+ {
+ keyValuePairs.AddValue<string, string>("Nome", string.Format(Messages.MaiorQueLimite, 50), true);
+ }
+ if (!string.IsNullOrEmpty(this.Documento) && !this.Documento.ValidacaoDocumento())
+ {
+ keyValuePairs.AddValue<string, string>("Documento", Messages.Invalido, true);
+ }
+ if (string.IsNullOrEmpty(this.Login))
+ {
+ keyValuePairs.AddValue<string, string>("Login", Messages.Obrigatorio, true);
+ }
+ else if (this.Login.Length > 30)
+ {
+ keyValuePairs.AddValue<string, string>("Login", string.Format(Messages.MaiorQueLimite, 30), true);
+ }
+ if (!string.IsNullOrEmpty(this.Login) && !Regex.IsMatch(this.Login, "^(?!.* {2})[a-zA-Z0-9](?:[a-zA-Z0-9 .]{0,49}[a-zA-Z0-9])?$"))
+ {
+ keyValuePairs.AddValue<string, string>("Login|USUARIO", "USUARIO INVALIDO,\nUSUARIO SOMENTE DEVE CONTER LETRAS E NUMEROS,\nNÃO DEVE CONTER MAIS DE UM ESPAÇO,\nNÃO DEVE TER ESPAÇO NO INICIO E NO FIM.\nEXEMPLO VALIDO:\nUSUARIO01 OU USUARIO 02 OU USUARIO.03", true);
+ }
+ if (string.IsNullOrEmpty(this.Senha))
+ {
+ keyValuePairs.AddValue<string, string>("Senha", Messages.Obrigatorio, true);
+ }
+ if (string.IsNullOrEmpty(this.Email))
+ {
+ keyValuePairs.AddValue<string, string>("Email", Messages.Obrigatorio, true);
+ }
+ if (!string.IsNullOrEmpty(this.EstadoEmissor) && !this.EstadoEmissor.ValidacaoEstado())
+ {
+ keyValuePairs.AddValue<string, string>("EstadoEmissor", Messages.Invalido, true);
+ }
+ if (this.Expedicao.HasValue && !this.Expedicao.ValidacaoDataPassada())
+ {
+ keyValuePairs.AddValue<string, string>("Expedicao", Messages.Invalido, true);
+ }
+ if (this.Nascimento.HasValue && !this.Nascimento.ValidacaoDataPassada())
+ {
+ keyValuePairs.AddValue<string, string>("Nascimento", Messages.Invalido, true);
+ }
+ if (!string.IsNullOrEmpty(base.Cep) && !base.Cep.ValidacaoCep())
+ {
+ keyValuePairs.AddValue<string, string>("Cep", Messages.Invalido, true);
+ }
+ if (!string.IsNullOrEmpty(base.Endereco) && base.Endereco.Length > 60)
+ {
+ keyValuePairs.AddValue<string, string>("Endereco", string.Format(Messages.MaiorQueLimite, 60), true);
+ }
+ if (!string.IsNullOrEmpty(base.Numero) && base.Numero.Length > 5)
+ {
+ keyValuePairs.AddValue<string, string>("Numero", string.Format(Messages.MaiorQueLimite, 5), true);
+ }
+ if (!string.IsNullOrEmpty(base.Bairro) && base.Bairro.Length > 60)
+ {
+ keyValuePairs.AddValue<string, string>("Bairro", string.Format(Messages.MaiorQueLimite, 60), true);
+ }
+ if (!string.IsNullOrEmpty(base.Cidade) && base.Cidade.Length > 30)
+ {
+ keyValuePairs.AddValue<string, string>("Cidade", string.Format(Messages.MaiorQueLimite, 30), true);
+ }
+ if (!string.IsNullOrEmpty(base.Estado) && !base.Estado.ValidacaoEstado())
+ {
+ keyValuePairs.AddValue<string, string>("Estado", Messages.Invalido, true);
+ }
+ if (!string.IsNullOrEmpty(base.Cep) || !string.IsNullOrEmpty(base.Numero) || !string.IsNullOrEmpty(base.Complemento) || !string.IsNullOrEmpty(base.Endereco) || !string.IsNullOrEmpty(base.Bairro) || !string.IsNullOrEmpty(base.Cidade) || !string.IsNullOrEmpty(base.Estado))
+ {
+ if (string.IsNullOrEmpty(base.Cep))
+ {
+ keyValuePairs.AddValue<string, string>("Cep", Messages.Obrigatorio, true);
+ }
+ if (string.IsNullOrEmpty(base.Endereco))
+ {
+ keyValuePairs.AddValue<string, string>("Endereco", Messages.Obrigatorio, true);
+ }
+ if (string.IsNullOrEmpty(base.Numero))
+ {
+ keyValuePairs.AddValue<string, string>("Numero", Messages.Obrigatorio, true);
+ }
+ if (string.IsNullOrEmpty(base.Bairro))
+ {
+ keyValuePairs.AddValue<string, string>("Bairro", Messages.Obrigatorio, true);
+ }
+ if (string.IsNullOrEmpty(base.Cidade))
+ {
+ keyValuePairs.AddValue<string, string>("Cidade", Messages.Obrigatorio, true);
+ }
+ if (string.IsNullOrEmpty(base.Estado))
+ {
+ keyValuePairs.AddValue<string, string>("Estado", Messages.Obrigatorio, true);
+ }
+ }
+ if (this.AdministradorCentralSegurado && string.IsNullOrEmpty(this.Documento))
+ {
+ keyValuePairs.AddValue<string, string>("Documento", Messages.Obrigatorio, true);
+ }
+ if (this.AdministradorCentralSegurado && string.IsNullOrEmpty(this.Prefixo))
+ {
+ keyValuePairs.AddValue<string, string>("Prefixo", Messages.Obrigatorio, true);
+ }
+ if (this.AdministradorCentralSegurado && string.IsNullOrEmpty(this.Telefone))
+ {
+ keyValuePairs.AddValue<string, string>("Telefone", Messages.Obrigatorio, true);
+ }
+ if (this.AdministradorCentralSegurado && string.IsNullOrEmpty(this.Email))
+ {
+ keyValuePairs.AddValue<string, string>("Email", Messages.Obrigatorio, true);
+ }
+ if (this.InicioAcesso.HasValue && this.FimAcesso.HasValue && this.FimAcesso.Value.TimeOfDay == this.InicioAcesso.Value.TimeOfDay)
+ {
+ keyValuePairs.AddValue<string, string>("InicioAcesso", Messages.Invalido, true);
+ keyValuePairs.AddValue<string, string>("FimAcesso", Messages.Invalido, true);
+ }
+ if (this.Documento == null || string.IsNullOrEmpty(this.Documento))
+ {
+ keyValuePairs.AddValue<string, string>("Documento", Messages.Obrigatorio, true);
+ }
+ return keyValuePairs;
+ }
+ }
+}
\ No newline at end of file |