diff options
| author | Lucas Faria Mendes <lucas.fariamo08@gmail.com> | 2026-03-30 13:38:18 +0000 |
|---|---|---|
| committer | Lucas Faria Mendes <lucas.fariamo08@gmail.com> | 2026-03-30 13:38:18 +0000 |
| commit | 1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1 (patch) | |
| tree | e1c3b20ea08f0cf71122a1e73f0d395f8fd83874 /Codemerx/Gestor.Model/Model.Domain.Ferramentas/NotaFiscal.cs | |
| parent | 674ca83ba9243a9e95a7568c797668dab6aee26a (diff) | |
| download | gestor-1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1.tar.gz gestor-1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1.zip | |
chore: location
Diffstat (limited to 'Codemerx/Gestor.Model/Model.Domain.Ferramentas/NotaFiscal.cs')
| -rw-r--r-- | Codemerx/Gestor.Model/Model.Domain.Ferramentas/NotaFiscal.cs | 217 |
1 files changed, 217 insertions, 0 deletions
diff --git a/Codemerx/Gestor.Model/Model.Domain.Ferramentas/NotaFiscal.cs b/Codemerx/Gestor.Model/Model.Domain.Ferramentas/NotaFiscal.cs new file mode 100644 index 0000000..40d9e92 --- /dev/null +++ b/Codemerx/Gestor.Model/Model.Domain.Ferramentas/NotaFiscal.cs @@ -0,0 +1,217 @@ +using Gestor.Model.Attributes;
+using Gestor.Model.Domain.Generic;
+using Gestor.Model.Domain.Seguros;
+using Gestor.Model.Helper;
+using Gestor.Model.Resources;
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.ComponentModel;
+using System.Globalization;
+using System.Runtime.CompilerServices;
+using System.Threading;
+
+namespace Gestor.Model.Domain.Ferramentas
+{
+ public class NotaFiscal : DomainBase
+ {
+ private bool _selecionado;
+
+ [Description("DATA")]
+ [Log(true)]
+ public DateTime? Data
+ {
+ get;
+ set;
+ }
+
+ [Description("ESTIPULANTE")]
+ [Log(true)]
+ public Gestor.Model.Domain.Seguros.Estipulante Estipulante
+ {
+ get;
+ set;
+ }
+
+ [Description("EXTRATO")]
+ [Log(true)]
+ public string Extrato
+ {
+ get;
+ set;
+ }
+
+ [Log(true)]
+ public long? IdExtrato
+ {
+ get;
+ set;
+ }
+
+ [Description("IR")]
+ [Log(true)]
+ public decimal Ir
+ {
+ get;
+ set;
+ }
+
+ [Description("ISS")]
+ [Log(true)]
+ public decimal Iss
+ {
+ get;
+ set;
+ }
+
+ [Description("OBS")]
+ [Log(true)]
+ public string Obs
+ {
+ get;
+ set;
+ }
+
+ [Log(true)]
+ public Gestor.Model.Domain.Seguros.Seguradora Seguradora
+ {
+ 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
+ {
+ return new Func<List<KeyValuePair<string, string>>>(this.Validate);
+ }
+ }
+
+ [Description("VALOR BRUTO")]
+ [Log(true)]
+ public decimal ValorBruto
+ {
+ get;
+ set;
+ }
+
+ [Description("VALOR LÍQUIDO")]
+ [Log(true)]
+ public decimal ValorLiquido
+ {
+ get;
+ set;
+ }
+
+ public NotaFiscal()
+ {
+ }
+
+ public List<TupleList> Log()
+ {
+ string nome;
+ string str;
+ string shortDateString;
+ List<TupleList> tupleLists = new List<TupleList>();
+ TupleList tupleList = new TupleList();
+ ObservableCollection<Tuple<string, string, string>> observableCollection = new ObservableCollection<Tuple<string, string, string>>()
+ {
+ new Tuple<string, string, string>("SEGURADORA", (string.IsNullOrWhiteSpace(this.Seguradora.Nome) ? "" : this.Seguradora.Nome), "")
+ };
+ Gestor.Model.Domain.Seguros.Estipulante estipulante = this.Estipulante;
+ if (estipulante != null)
+ {
+ nome = estipulante.Nome;
+ }
+ else
+ {
+ nome = null;
+ }
+ if (string.IsNullOrWhiteSpace(nome))
+ {
+ str = "";
+ }
+ else
+ {
+ Gestor.Model.Domain.Seguros.Estipulante estipulante1 = this.Estipulante;
+ if (estipulante1 != null)
+ {
+ str = estipulante1.Nome;
+ }
+ else
+ {
+ str = null;
+ }
+ }
+ observableCollection.Add(new Tuple<string, string, string>("ESTIPULANTE", str, ""));
+ decimal iss = this.Iss;
+ observableCollection.Add(new Tuple<string, string, string>("ISS", iss.ToString("C", new CultureInfo("pt-BR", false)), ""));
+ iss = this.ValorLiquido;
+ observableCollection.Add(new Tuple<string, string, string>("VALOR LÍQUIDO", iss.ToString("C", new CultureInfo("pt-BR", false)), ""));
+ iss = this.ValorBruto;
+ observableCollection.Add(new Tuple<string, string, string>("VALOR BRUTO", iss.ToString("C", new CultureInfo("pt-BR", false)), ""));
+ DateTime? data = this.Data;
+ if (!data.HasValue)
+ {
+ shortDateString = "";
+ }
+ else
+ {
+ data = this.Data;
+ if (data.HasValue)
+ {
+ shortDateString = data.GetValueOrDefault().ToShortDateString();
+ }
+ else
+ {
+ shortDateString = null;
+ }
+ }
+ observableCollection.Add(new Tuple<string, string, string>("DATA", shortDateString, ""));
+ tupleList.Tuples = observableCollection;
+ tupleLists.Add(tupleList);
+ return tupleLists;
+ }
+
+ 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 (this.Seguradora == null || string.IsNullOrEmpty(this.Seguradora.Nome))
+ {
+ keyValuePairs.AddValue<string, string>("Seguradora", Messages.Obrigatorio, true);
+ }
+ return keyValuePairs;
+ }
+
+ public event PropertyChangedEventHandler PropertyChanged;
+ }
+}
\ No newline at end of file |