summaryrefslogtreecommitdiff
path: root/Gestor.Model/Model.Domain.Seguros/TitularesVida.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 /Gestor.Model/Model.Domain.Seguros/TitularesVida.cs
parent674ca83ba9243a9e95a7568c797668dab6aee26a (diff)
downloadgestor-1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1.tar.gz
gestor-1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1.zip
chore: location
Diffstat (limited to 'Gestor.Model/Model.Domain.Seguros/TitularesVida.cs')
-rw-r--r--Gestor.Model/Model.Domain.Seguros/TitularesVida.cs269
1 files changed, 0 insertions, 269 deletions
diff --git a/Gestor.Model/Model.Domain.Seguros/TitularesVida.cs b/Gestor.Model/Model.Domain.Seguros/TitularesVida.cs
deleted file mode 100644
index 3956270..0000000
--- a/Gestor.Model/Model.Domain.Seguros/TitularesVida.cs
+++ /dev/null
@@ -1,269 +0,0 @@
-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.ComponentModel;
-using System.Runtime.CompilerServices;
-using System.Threading;
-
-namespace Gestor.Model.Domain.Seguros
-{
- public class TitularesVida : DomainBase, IDomain, INotifyPropertyChanged
- {
- private string _codigo;
-
- private string _fatura;
-
- private string _nome;
-
- private string _observacao;
-
- private string _matricula;
-
- private decimal? _premio;
-
- private decimal? _capital;
-
- private bool _selecionado;
-
- public decimal? Capital
- {
- get
- {
- return new decimal?(this._capital.GetValueOrDefault());
- }
- set
- {
- this._capital = value;
- }
- }
-
- public string Codigo
- {
- get
- {
- string str = this._codigo;
- if (str != null)
- {
- return str.ToUpper();
- }
- return null;
- }
- set
- {
- this._codigo = value;
- }
- }
-
- public string Cpf
- {
- get;
- set;
- }
-
- public TitularesVida Dependente
- {
- get;
- set;
- }
-
- public string Fatura
- {
- get
- {
- string str = this._fatura;
- if (str != null)
- {
- return str.ToUpper();
- }
- return null;
- }
- set
- {
- this._fatura = value;
- }
- }
-
- public DateTime? Fim
- {
- get;
- set;
- }
-
- public long IdItem
- {
- get;
- set;
- }
-
- public DateTime? Inicio
- {
- get;
- set;
- }
-
- public string Matricula
- {
- get
- {
- string str = this._matricula;
- if (str != null)
- {
- return str.ToUpper();
- }
- return null;
- }
- set
- {
- this._matricula = value;
- }
- }
-
- public DateTime? Nascimento
- {
- get;
- set;
- }
-
- public string Nome
- {
- get
- {
- string str = this._nome;
- if (str != null)
- {
- return str.ToUpper();
- }
- return null;
- }
- set
- {
- this._nome = value;
- }
- }
-
- public string Observacao
- {
- get
- {
- string str = this._observacao;
- if (str != null)
- {
- return str.ToUpper();
- }
- return null;
- }
- set
- {
- this._observacao = value;
- }
- }
-
- public decimal? Premio
- {
- get
- {
- return new decimal?(this._premio.GetValueOrDefault());
- }
- set
- {
- this._premio = value;
- }
- }
-
- public bool Selecionado
- {
- get
- {
- return this._selecionado;
- }
- set
- {
- if (value == this._selecionado)
- {
- return;
- }
- this._selecionado = value;
- this.OnPropertyChanged("Selecionado");
- }
- }
-
- public TipoTitular? Tipo
- {
- get;
- set;
- }
-
- [JsonIgnore]
- public Func<List<KeyValuePair<string, string>>> ValidationEvent
- {
- get
- {
- TitularesVida titularesVida = this;
- return new Func<List<KeyValuePair<string, string>>>(titularesVida.Validate);
- }
- }
-
- public TitularesVida()
- {
- }
-
- 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(this.Nome))
- {
- keyValuePairs.AddValue<string, string>("Nome", Messages.Obrigatorio, true);
- }
- else if (this.Nome.Length > 150)
- {
- keyValuePairs.AddValue<string, string>("Nome", string.Format(Messages.MaiorQueLimite, 150), true);
- }
- if (!this.Inicio.HasValue)
- {
- keyValuePairs.AddValue<string, string>("Inicio|INÍCIO", Messages.Obrigatorio, true);
- }
- else if (DateTime.Compare(this.Inicio.Value, new DateTime(1753, 1, 1)) < 0 || DateTime.Compare(this.Inicio.Value, new DateTime(9999, 12, 31)) > 0)
- {
- keyValuePairs.AddValue<string, string>("Inicio|INÍCIO", string.Format(Messages.DataInvalida, Array.Empty<object>()), true);
- }
- if (this.Fim.HasValue && (DateTime.Compare(this.Fim.Value, new DateTime(1753, 1, 1)) < 0 || DateTime.Compare(this.Fim.Value, new DateTime(9999, 12, 31)) > 0))
- {
- keyValuePairs.AddValue<string, string>("Fim", 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.Nascimento.HasValue || Funcoes.GetAge(this.Nascimento.Value) >= 18) && !string.IsNullOrWhiteSpace(this.Cpf) && !this.Cpf.ValidacaoDocumento())
- {
- keyValuePairs.AddValue<string, string>("Cpf", Messages.Invalido, true);
- }
- if (!this.Tipo.HasValue)
- {
- keyValuePairs.AddValue<string, string>("Tipo", Messages.Obrigatorio, true);
- }
- if (this.Tipo.GetValueOrDefault() == TipoTitular.Dependente && this.Dependente == null)
- {
- keyValuePairs.AddValue<string, string>("Dependente", "OBRIGATÓRIO. PESQUISE POR UM DOS TITULARES\nQUE SEJA DO TIPO SÓCIO OU FUNCIONÁRIO", true);
- }
- return keyValuePairs;
- }
-
- public event PropertyChangedEventHandler PropertyChanged;
- }
-} \ No newline at end of file