diff options
Diffstat (limited to 'Gestor.Model/Model.Domain.Ferramentas/Imposto.cs')
| -rw-r--r-- | Gestor.Model/Model.Domain.Ferramentas/Imposto.cs | 177 |
1 files changed, 0 insertions, 177 deletions
diff --git a/Gestor.Model/Model.Domain.Ferramentas/Imposto.cs b/Gestor.Model/Model.Domain.Ferramentas/Imposto.cs deleted file mode 100644 index 7a65e49..0000000 --- a/Gestor.Model/Model.Domain.Ferramentas/Imposto.cs +++ /dev/null @@ -1,177 +0,0 @@ -using Gestor.Model.Domain.Generic;
-using Gestor.Model.Domain.Seguros;
-using Gestor.Model.Helper;
-using Newtonsoft.Json;
-using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Runtime.CompilerServices;
-
-namespace Gestor.Model.Domain.Ferramentas
-{
- public class Imposto : DomainBase, IDomain
- {
- public bool Ativo
- {
- get;
- set;
- }
-
- public decimal Desconto
- {
- get;
- set;
- }
-
- public decimal Ir
- {
- get;
- set;
- }
-
- public decimal Iss
- {
- get;
- set;
- }
-
- public decimal Outros
- {
- get;
- set;
- }
-
- public Gestor.Model.Domain.Seguros.Ramo Ramo
- {
- get;
- set;
- }
-
- public Gestor.Model.Domain.Seguros.Seguradora Seguradora
- {
- get;
- set;
- }
-
- [JsonIgnore]
- public Func<List<KeyValuePair<string, string>>> ValidationEvent
- {
- get
- {
- Imposto imposto = this;
- return new Func<List<KeyValuePair<string, string>>>(imposto.Validate);
- }
- }
-
- public Imposto()
- {
- }
-
- public List<TupleList> Log()
- {
- object nome;
- object nomeSocial;
- List<TupleList> tupleLists = new List<TupleList>();
- TupleList tupleList = new TupleList();
- ObservableCollection<Tuple<string, string, string>> observableCollection = new ObservableCollection<Tuple<string, string, string>>();
- Gestor.Model.Domain.Seguros.Ramo ramo = this.Ramo;
- if (ramo != null)
- {
- nome = ramo.Nome;
- }
- else
- {
- nome = null;
- }
- if (nome == null)
- {
- nome = "";
- }
- observableCollection.Add(new Tuple<string, string, string>("RAMO", nome, ""));
- Gestor.Model.Domain.Seguros.Seguradora seguradora = this.Seguradora;
- if (seguradora != null)
- {
- nomeSocial = seguradora.NomeSocial;
- }
- else
- {
- nomeSocial = null;
- }
- if (nomeSocial == null)
- {
- Gestor.Model.Domain.Seguros.Seguradora seguradora1 = this.Seguradora;
- if (seguradora1 != null)
- {
- nomeSocial = seguradora1.Nome;
- }
- else
- {
- nomeSocial = null;
- }
- if (nomeSocial == null)
- {
- nomeSocial = "";
- }
- }
- observableCollection.Add(new Tuple<string, string, string>("SEGURADORA", nomeSocial, ""));
- decimal ir = this.Ir;
- observableCollection.Add(new Tuple<string, string, string>("IR", ir.ToString("p"), ""));
- ir = this.Iss;
- observableCollection.Add(new Tuple<string, string, string>("ISS", ir.ToString("p"), ""));
- ir = this.Outros;
- observableCollection.Add(new Tuple<string, string, string>("OUTROS", ir.ToString("p"), ""));
- ir = this.Desconto;
- observableCollection.Add(new Tuple<string, string, string>("DESCONTO", ir.ToString("p"), ""));
- observableCollection.Add(new Tuple<string, string, string>("ATIVO", (this.Ativo ? "SIM" : "NÃO"), ""));
- tupleList.Tuples = observableCollection;
- tupleLists.Add(tupleList);
- return tupleLists;
- }
-
- public List<KeyValuePair<string, string>> Validate()
- {
- List<KeyValuePair<string, string>> keyValuePairs = ValidationHelper.AddValue();
- if (this.Ir > decimal.One)
- {
- keyValuePairs.AddValue<string, string>("Ir|PORCENTAGEM IR", "O VALOR DE IR NÃO PODE SER MAIOR QUE 100%.", true);
- }
- if (this.Iss > decimal.One)
- {
- keyValuePairs.AddValue<string, string>("Iss|PORCENTAGEM ISS", "O VALOR DE ISS NÃO PODE SER MAIOR QUE 100%.", true);
- }
- if (this.Outros > decimal.One)
- {
- keyValuePairs.AddValue<string, string>("Outros|PORCENTAGEM OUTROS", "O VALOR DOS OUTROS DESCONTOS NÃO PODE SER MAIOR QUE 100%.", true);
- }
- if (this.Desconto > decimal.One)
- {
- keyValuePairs.AddValue<string, string>("Desconto|PORCENTAGEM DESCONTO", "O VALOR DE DESCONTO NÃO PODE SER MAIOR QUE 100%.", true);
- }
- if (this.Ir < decimal.Zero)
- {
- keyValuePairs.AddValue<string, string>("Ir|PORCENTAGEM IR", "O VALOR DE IR NÃO PODE SER MENOR QUE 0%.", true);
- }
- if (this.Iss < decimal.Zero)
- {
- keyValuePairs.AddValue<string, string>("Iss|PORCENTAGEM ISS", "O VALOR DE ISS NÃO PODE SER MENOR QUE 0%.", true);
- }
- if (this.Outros < decimal.Zero)
- {
- keyValuePairs.AddValue<string, string>("Outros|PORCENTAGEM OUTROS", "O VALOR DOS OUTROS DESCONTOS NÃO PODE SER MENOR QUE 0%.", true);
- }
- if (this.Desconto < decimal.Zero)
- {
- keyValuePairs.AddValue<string, string>("Desconto|PORCENTAGEM DESCONTO", "O VALOR DE DESCONTO NÃO PODE SER MENOR QUE 0%.", true);
- }
- if ((((this.Ir + this.Iss) + this.Outros) + this.Desconto) > decimal.One)
- {
- keyValuePairs.AddValue<string, string>("Ir|PORCENTAGEM TOTAL", "NÃO É POSSÍVEL DEDUZIR MAIS QUE 100% DO TOTAL RECEBIDO.", true);
- }
- if ((((this.Ir + this.Iss) + this.Outros) + this.Desconto) == decimal.Zero)
- {
- keyValuePairs.AddValue<string, string>("Ir|PORCENTAGEM TOTAL", "A SOMA DOS IMPOSTOS DEVEM SER MAIOR QUE 0 (ZERO).", true);
- }
- return keyValuePairs;
- }
- }
-}
\ No newline at end of file |