From 0440c722a221b8068bbf388c1c0c51f0faff0451 Mon Sep 17 00:00:00 2001 From: Lucas Faria Mendes Date: Mon, 30 Mar 2026 14:17:46 -0300 Subject: some dlls --- .../Gestor.Model.Domain.Seguros/DetalheExtrato.cs | 163 +++++++++++++++++++++ 1 file changed, 163 insertions(+) create mode 100644 Gestor.Model/Gestor.Model.Domain.Seguros/DetalheExtrato.cs (limited to 'Gestor.Model/Gestor.Model.Domain.Seguros/DetalheExtrato.cs') diff --git a/Gestor.Model/Gestor.Model.Domain.Seguros/DetalheExtrato.cs b/Gestor.Model/Gestor.Model.Domain.Seguros/DetalheExtrato.cs new file mode 100644 index 0000000..07b3e51 --- /dev/null +++ b/Gestor.Model/Gestor.Model.Domain.Seguros/DetalheExtrato.cs @@ -0,0 +1,163 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Runtime.CompilerServices; +using Gestor.Model.Common; +using Gestor.Model.Domain.Generic; +using Gestor.Model.Helper; +using Gestor.Model.Resources; +using Newtonsoft.Json; + +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 bool Selecionado + { + get + { + return _selecionado; + } + set + { + _selecionado = value; + OnPropertyChanged("Selecionado"); + } + } + + public Extrato Extrato { get; set; } + + public long? Documento { get; set; } + + public long? Parcela { get; set; } + + public StatusParcela? Status { get; set; } + + public SubTipo? SubTipo { get; set; } + + public bool Corrigir { get; set; } + + public string Cliente + { + get + { + return _cliente?.ToUpper(); + } + set + { + _cliente = value; + } + } + + public string Apolice + { + get + { + return _apolice?.ToUpper().Trim(); + } + set + { + _apolice = value; + } + } + + public string Endosso + { + get + { + return _endosso?.ToUpper().Trim(); + } + set + { + _endosso = value; + } + } + + public string NumeroParcela + { + get + { + return _numeroParcela?.ToUpper().Trim(); + } + set + { + _numeroParcela = value; + } + } + + public DateTime? Recebimento { get; set; } + + public DateTime? Credito { get; set; } + + public decimal? Valor { get; set; } + + public decimal? Comissao { get; set; } + + public decimal? ValorComissao { get; set; } + + public string Historico + { + get + { + return _historico?.ToUpper(); + } + set + { + _historico = value; + } + } + + [JsonIgnore] + public Func>> ValidationEvent => Validate; + + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) + { + this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + + public List> Validate() + { + List> list = ValidationHelper.AddValue(); + if (Recebimento.HasValue && (DateTime.Compare(Recebimento.Value, new DateTime(1753, 1, 1)) < 0 || DateTime.Compare(Recebimento.Value, new DateTime(9999, 12, 31)) > 0)) + { + list.AddValue("Recebimento", string.Format(Messages.DataInvalida)); + } + if (Credito.HasValue && (DateTime.Compare(Credito.Value, new DateTime(1753, 1, 1)) < 0 || DateTime.Compare(Credito.Value, new DateTime(9999, 12, 31)) > 0)) + { + list.AddValue("Credito", string.Format(Messages.DataInvalida)); + } + if (string.IsNullOrWhiteSpace(Cliente) && Cliente.Length > 100) + { + list.AddValue("Cliente", string.Format(Messages.MaiorQueLimite, 100)); + } + if (string.IsNullOrWhiteSpace(Apolice) && Apolice.Length > 30) + { + list.AddValue("Apolice", string.Format(Messages.MaiorQueLimite, 30)); + } + if (string.IsNullOrWhiteSpace(Endosso) && Endosso.Length > 20) + { + list.AddValue("Endosso", string.Format(Messages.MaiorQueLimite, 20)); + } + if (string.IsNullOrWhiteSpace(NumeroParcela) && NumeroParcela.Length > 4) + { + list.AddValue("NumeroParcela", string.Format(Messages.MaiorQueLimite, 4)); + } + return list; + } +} -- cgit v1.2.3