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 --- .../Model.Domain.Seguros/DetalheExtrato.cs | 250 +++++++++++++++++++++ 1 file changed, 250 insertions(+) create mode 100644 Gestor.Model/Model.Domain.Seguros/DetalheExtrato.cs (limited to 'Gestor.Model/Model.Domain.Seguros/DetalheExtrato.cs') diff --git a/Gestor.Model/Model.Domain.Seguros/DetalheExtrato.cs b/Gestor.Model/Model.Domain.Seguros/DetalheExtrato.cs new file mode 100644 index 0000000..c03bd40 --- /dev/null +++ b/Gestor.Model/Model.Domain.Seguros/DetalheExtrato.cs @@ -0,0 +1,250 @@ +using Gestor.Model.Common; +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 DetalheExtrato : DomainBase, IDomain, INotifyPropertyChanged + { + private bool _selecionado; + + private string _cliente; + + private string _apolice; + + private string _endosso; + + private string _numeroParcela; + + private string _historico; + + public bool IsNormal = true; + + public string Apolice + { + get + { + string str = this._apolice; + if (str == null) + { + return null; + } + return str.ToUpper().Trim(); + } + set + { + this._apolice = value; + } + } + + public string Cliente + { + get + { + string str = this._cliente; + if (str != null) + { + return str.ToUpper(); + } + return null; + } + set + { + this._cliente = value; + } + } + + public decimal? Comissao + { + get; + set; + } + + public bool Corrigir + { + get; + set; + } + + public DateTime? Credito + { + get; + set; + } + + public long? Documento + { + get; + set; + } + + public string Endosso + { + get + { + string str = this._endosso; + if (str == null) + { + return null; + } + return str.ToUpper().Trim(); + } + set + { + this._endosso = value; + } + } + + public Gestor.Model.Domain.Seguros.Extrato Extrato + { + get; + set; + } + + public string Historico + { + get + { + string str = this._historico; + if (str != null) + { + return str.ToUpper(); + } + return null; + } + set + { + this._historico = value; + } + } + + public string NumeroParcela + { + get + { + string str = this._numeroParcela; + if (str == null) + { + return null; + } + return str.ToUpper().Trim(); + } + set + { + this._numeroParcela = value; + } + } + + public long? Parcela + { + get; + set; + } + + public DateTime? Recebimento + { + get; + set; + } + + public bool Selecionado + { + get + { + return this._selecionado; + } + set + { + this._selecionado = value; + this.OnPropertyChanged("Selecionado"); + } + } + + public StatusParcela? Status + { + get; + set; + } + + public Gestor.Model.Common.SubTipo? SubTipo + { + get; + set; + } + + [JsonIgnore] + public Func>> ValidationEvent + { + get + { + DetalheExtrato detalheExtrato = this; + return new Func>>(detalheExtrato.Validate); + } + } + + public decimal? Valor + { + get; + set; + } + + public decimal? ValorComissao + { + get; + set; + } + + public DetalheExtrato() + { + } + + protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) + { + PropertyChangedEventHandler propertyChangedEventHandler = this.PropertyChanged; + if (propertyChangedEventHandler == null) + { + return; + } + propertyChangedEventHandler(this, new PropertyChangedEventArgs(propertyName)); + } + + public List> Validate() + { + List> keyValuePairs = ValidationHelper.AddValue(); + if (this.Recebimento.HasValue && (DateTime.Compare(this.Recebimento.Value, new DateTime(1753, 1, 1)) < 0 || DateTime.Compare(this.Recebimento.Value, new DateTime(9999, 12, 31)) > 0)) + { + keyValuePairs.AddValue("Recebimento", string.Format(Messages.DataInvalida, Array.Empty()), true); + } + if (this.Credito.HasValue && (DateTime.Compare(this.Credito.Value, new DateTime(1753, 1, 1)) < 0 || DateTime.Compare(this.Credito.Value, new DateTime(9999, 12, 31)) > 0)) + { + keyValuePairs.AddValue("Credito", string.Format(Messages.DataInvalida, Array.Empty()), true); + } + if (string.IsNullOrWhiteSpace(this.Cliente) && this.Cliente.Length > 100) + { + keyValuePairs.AddValue("Cliente", string.Format(Messages.MaiorQueLimite, 100), true); + } + if (string.IsNullOrWhiteSpace(this.Apolice) && this.Apolice.Length > 30) + { + keyValuePairs.AddValue("Apolice", string.Format(Messages.MaiorQueLimite, 30), true); + } + if (string.IsNullOrWhiteSpace(this.Endosso) && this.Endosso.Length > 20) + { + keyValuePairs.AddValue("Endosso", string.Format(Messages.MaiorQueLimite, 20), true); + } + if (string.IsNullOrWhiteSpace(this.NumeroParcela) && this.NumeroParcela.Length > 4) + { + keyValuePairs.AddValue("NumeroParcela", string.Format(Messages.MaiorQueLimite, 4), true); + } + return keyValuePairs; + } + + public event PropertyChangedEventHandler PropertyChanged; + } +} \ No newline at end of file -- cgit v1.2.3