diff options
Diffstat (limited to 'Codemerx/Gestor.Model/Model.Domain.Seguros/Ramo.cs')
| -rw-r--r-- | Codemerx/Gestor.Model/Model.Domain.Seguros/Ramo.cs | 165 |
1 files changed, 165 insertions, 0 deletions
diff --git a/Codemerx/Gestor.Model/Model.Domain.Seguros/Ramo.cs b/Codemerx/Gestor.Model/Model.Domain.Seguros/Ramo.cs new file mode 100644 index 0000000..32f3099 --- /dev/null +++ b/Codemerx/Gestor.Model/Model.Domain.Seguros/Ramo.cs @@ -0,0 +1,165 @@ +using Gestor.Model.Attributes;
+using Gestor.Model.Domain.Generic;
+using Gestor.Model.Helper;
+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.Seguros
+{
+ public class Ramo : DomainBase, IDomain, INotifyPropertyChanged
+ {
+ private bool _selecionado;
+
+ private string _nome;
+
+ private string _ramoSusep;
+
+ [Log(true)]
+ public bool Ativo
+ {
+ get;
+ set;
+ }
+
+ public long CodigoSusep
+ {
+ get;
+ set;
+ }
+
+ public bool Fatura
+ {
+ get;
+ set;
+ }
+
+ [Log(true)]
+ public decimal Iof
+ {
+ get;
+ set;
+ }
+
+ [Description("RAMO")]
+ [Log(true)]
+ [Name(true)]
+ public string Nome
+ {
+ get
+ {
+ string str = this._nome;
+ if (str != null)
+ {
+ return str.ToUpper();
+ }
+ return null;
+ }
+ set
+ {
+ this._nome = value;
+ }
+ }
+
+ public string RamoSusep
+ {
+ get
+ {
+ string str = this._ramoSusep;
+ if (str != null)
+ {
+ return str.ToUpper();
+ }
+ return null;
+ }
+ set
+ {
+ this._ramoSusep = value;
+ }
+ }
+
+ 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
+ {
+ Ramo ramo = this;
+ return new Func<List<KeyValuePair<string, string>>>(ramo.Validate);
+ }
+ }
+
+ public Ramo()
+ {
+ }
+
+ public List<TupleList> Log(List<CoberturaPadrao> listCoberturas)
+ {
+ 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>("NOME", (string.IsNullOrWhiteSpace(this.Nome) ? "" : this.Nome), "")
+ };
+ decimal iof = this.Iof / new decimal(100);
+ observableCollection.Add(new Tuple<string, string, string>("I.O.F.", iof.ToString("P", new CultureInfo("pt-BR", false)), ""));
+ observableCollection.Add(new Tuple<string, string, string>("ATIVO", (this.Ativo ? "SIM" : "NÃO"), ""));
+ tupleList.Tuples = observableCollection;
+ tupleLists.Add(tupleList);
+ List<TupleList> tupleLists1 = tupleLists;
+ ObservableCollection<Tuple<string, string, string>> observableCollection1 = new ObservableCollection<Tuple<string, string, string>>()
+ {
+ new Tuple<string, string, string>("COBERTURAS$", "", "")
+ };
+ foreach (CoberturaPadrao listCobertura in listCoberturas)
+ {
+ observableCollection1.Add(new Tuple<string, string, string>(string.Format(" COBERTURA {0}$", listCoberturas.IndexOf(listCobertura) + 1), "", ""));
+ observableCollection1.Add(new Tuple<string, string, string>(" DESCRIÇÃO", (string.IsNullOrWhiteSpace(listCobertura.Descricao) ? "" : listCobertura.Descricao.ToUpper()), ""));
+ observableCollection1.Add(new Tuple<string, string, string>(" PADRÃO", (listCobertura.Padrao ? "SIM" : "NÃO"), ""));
+ }
+ tupleLists1.Add(new TupleList()
+ {
+ Tuples = observableCollection1
+ });
+ return tupleLists1;
+ }
+
+ 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()
+ {
+ return ValidationHelper.AddValue();
+ }
+
+ public event PropertyChangedEventHandler PropertyChanged;
+ }
+}
\ No newline at end of file |