summaryrefslogtreecommitdiff
path: root/Gestor.Model/Model.Domain.Seguros/ClienteEndereco.cs
diff options
context:
space:
mode:
authorLucas Faria Mendes <lucas.fariamo08@gmail.com>2026-03-30 13:35:25 +0000
committerLucas Faria Mendes <lucas.fariamo08@gmail.com>2026-03-30 13:35:25 +0000
commit674ca83ba9243a9e95a7568c797668dab6aee26a (patch)
tree4a905b3fb1d827665a34d63f67bc5559f8e7235b /Gestor.Model/Model.Domain.Seguros/ClienteEndereco.cs
downloadgestor-674ca83ba9243a9e95a7568c797668dab6aee26a.tar.gz
gestor-674ca83ba9243a9e95a7568c797668dab6aee26a.zip
feat: upload files
Diffstat (limited to 'Gestor.Model/Model.Domain.Seguros/ClienteEndereco.cs')
-rw-r--r--Gestor.Model/Model.Domain.Seguros/ClienteEndereco.cs155
1 files changed, 155 insertions, 0 deletions
diff --git a/Gestor.Model/Model.Domain.Seguros/ClienteEndereco.cs b/Gestor.Model/Model.Domain.Seguros/ClienteEndereco.cs
new file mode 100644
index 0000000..5085632
--- /dev/null
+++ b/Gestor.Model/Model.Domain.Seguros/ClienteEndereco.cs
@@ -0,0 +1,155 @@
+using Gestor.Model.Attributes;
+using Gestor.Model.Domain.Generic;
+using Gestor.Model.Helper;
+using Gestor.Model.Resources;
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Runtime.CompilerServices;
+using System.Threading;
+
+namespace Gestor.Model.Domain.Seguros
+{
+ public class ClienteEndereco : EnderecoBase, IDomain, INotifyPropertyChanged
+ {
+ private bool _selecionado;
+
+ private string _observacao;
+
+ public Gestor.Model.Domain.Seguros.Cliente Cliente
+ {
+ get;
+ set;
+ }
+
+ [Log(true)]
+ public string Observacao
+ {
+ get
+ {
+ string str = this._observacao;
+ if (str != null)
+ {
+ return str.ToUpper();
+ }
+ return null;
+ }
+ set
+ {
+ this._observacao = value;
+ }
+ }
+
+ public int? Ordem
+ {
+ get;
+ set;
+ }
+
+ public bool Selecionado
+ {
+ get
+ {
+ return this._selecionado;
+ }
+ set
+ {
+ if (value == this._selecionado)
+ {
+ return;
+ }
+ this._selecionado = value;
+ this.OnPropertyChanged("Selecionado");
+ }
+ }
+
+ [JsonIgnore]
+ public Func<List<KeyValuePair<string, string>>> ValidationEvent
+ {
+ get
+ {
+ ClienteEndereco clienteEndereco = this;
+ return new Func<List<KeyValuePair<string, string>>>(clienteEndereco.Validate);
+ }
+ }
+
+ public ClienteEndereco()
+ {
+ }
+
+ protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
+ {
+ PropertyChangedEventHandler propertyChangedEventHandler = this.PropertyChanged;
+ if (propertyChangedEventHandler == null)
+ {
+ return;
+ }
+ propertyChangedEventHandler(this, new PropertyChangedEventArgs(propertyName));
+ }
+
+ public List<KeyValuePair<string, string>> Validate()
+ {
+ List<KeyValuePair<string, string>> keyValuePairs = ValidationHelper.AddValue();
+ if (string.IsNullOrWhiteSpace(base.Cep))
+ {
+ keyValuePairs.AddValue<string, string>("Cep", Messages.Obrigatorio, true);
+ }
+ else if (!base.Cep.ValidacaoCep())
+ {
+ keyValuePairs.AddValue<string, string>("Cep", Messages.Invalido, true);
+ }
+ if (string.IsNullOrWhiteSpace(base.Endereco))
+ {
+ keyValuePairs.AddValue<string, string>("Endereco", Messages.Obrigatorio, true);
+ }
+ else if (base.Endereco.Length > 150)
+ {
+ keyValuePairs.AddValue<string, string>("Endereco", string.Format(Messages.MaiorQueLimite, 150), true);
+ }
+ if (string.IsNullOrWhiteSpace(base.Numero))
+ {
+ keyValuePairs.AddValue<string, string>("Numero", Messages.Obrigatorio, true);
+ }
+ else if (base.Numero.Length > 6)
+ {
+ keyValuePairs.AddValue<string, string>("Numero", string.Format(Messages.MaiorQueLimite, 6), true);
+ }
+ if (!string.IsNullOrWhiteSpace(base.Complemento) && base.Complemento.Length > 45)
+ {
+ keyValuePairs.AddValue<string, string>("Complemento", string.Format(Messages.MaiorQueLimite, 45), true);
+ }
+ if (string.IsNullOrWhiteSpace(base.Bairro))
+ {
+ keyValuePairs.AddValue<string, string>("Bairro", Messages.Obrigatorio, true);
+ }
+ else if (base.Bairro.Length > 100)
+ {
+ keyValuePairs.AddValue<string, string>("Bairro", string.Format(Messages.MaiorQueLimite, 100), true);
+ }
+ if (string.IsNullOrWhiteSpace(base.Cidade))
+ {
+ keyValuePairs.AddValue<string, string>("Cidade", Messages.Obrigatorio, true);
+ }
+ else if (base.Cidade.Length > 50)
+ {
+ keyValuePairs.AddValue<string, string>("Cidade", string.Format(Messages.MaiorQueLimite, 50), true);
+ }
+ if (string.IsNullOrWhiteSpace(base.Estado))
+ {
+ keyValuePairs.AddValue<string, string>("Estado", Messages.Obrigatorio, true);
+ }
+ else if (!base.Estado.ValidacaoEstado())
+ {
+ keyValuePairs.AddValue<string, string>("Estado", Messages.Invalido, true);
+ }
+ if (!string.IsNullOrWhiteSpace(this.Observacao) && this.Observacao.Length > 255)
+ {
+ keyValuePairs.AddValue<string, string>("Observacao", string.Format(Messages.MaiorQueLimite, 255), true);
+ }
+ return keyValuePairs;
+ }
+
+ public event PropertyChangedEventHandler PropertyChanged;
+ }
+} \ No newline at end of file