summaryrefslogtreecommitdiff
path: root/Gestor.Model/Gestor.Model.Domain.Seguros/DetalheExtrato.cs
diff options
context:
space:
mode:
authorLucas Faria Mendes <lucas.fariamo08@gmail.com>2026-03-30 17:17:46 +0000
committerLucas Faria Mendes <lucas.fariamo08@gmail.com>2026-03-30 17:17:46 +0000
commit0440c722a221b8068bbf388c1c0c51f0faff0451 (patch)
tree169cbf90c50ff7961db82ecb606c50c2a45a1688 /Gestor.Model/Gestor.Model.Domain.Seguros/DetalheExtrato.cs
parent225aa1499e37faf9d38257caabbadc68d78b427e (diff)
downloadgestor-master.tar.gz
gestor-master.zip
some dllsHEADmaster
Diffstat (limited to 'Gestor.Model/Gestor.Model.Domain.Seguros/DetalheExtrato.cs')
-rw-r--r--Gestor.Model/Gestor.Model.Domain.Seguros/DetalheExtrato.cs163
1 files changed, 163 insertions, 0 deletions
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<List<KeyValuePair<string, string>>> ValidationEvent => Validate;
+
+ public event PropertyChangedEventHandler PropertyChanged;
+
+ protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
+ {
+ this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
+ }
+
+ public List<KeyValuePair<string, string>> Validate()
+ {
+ List<KeyValuePair<string, string>> 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;
+ }
+}