From 674ca83ba9243a9e95a7568c797668dab6aee26a Mon Sep 17 00:00:00 2001 From: Lucas Faria Mendes Date: Mon, 30 Mar 2026 10:35:25 -0300 Subject: feat: upload files --- Gestor.Model/Model.Domain.Seguros/Ramo.cs | 165 ++++++++++++++++++++++++++++++ 1 file changed, 165 insertions(+) create mode 100644 Gestor.Model/Model.Domain.Seguros/Ramo.cs (limited to 'Gestor.Model/Model.Domain.Seguros/Ramo.cs') diff --git a/Gestor.Model/Model.Domain.Seguros/Ramo.cs b/Gestor.Model/Model.Domain.Seguros/Ramo.cs new file mode 100644 index 0000000..32f3099 --- /dev/null +++ b/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>> ValidationEvent + { + get + { + Ramo ramo = this; + return new Func>>(ramo.Validate); + } + } + + public Ramo() + { + } + + public List Log(List listCoberturas) + { + List tupleLists = new List(); + TupleList tupleList = new TupleList(); + ObservableCollection> observableCollection = new ObservableCollection>() + { + new Tuple("NOME", (string.IsNullOrWhiteSpace(this.Nome) ? "" : this.Nome), "") + }; + decimal iof = this.Iof / new decimal(100); + observableCollection.Add(new Tuple("I.O.F.", iof.ToString("P", new CultureInfo("pt-BR", false)), "")); + observableCollection.Add(new Tuple("ATIVO", (this.Ativo ? "SIM" : "NÃO"), "")); + tupleList.Tuples = observableCollection; + tupleLists.Add(tupleList); + List tupleLists1 = tupleLists; + ObservableCollection> observableCollection1 = new ObservableCollection>() + { + new Tuple("COBERTURAS$", "", "") + }; + foreach (CoberturaPadrao listCobertura in listCoberturas) + { + observableCollection1.Add(new Tuple(string.Format(" COBERTURA {0}$", listCoberturas.IndexOf(listCobertura) + 1), "", "")); + observableCollection1.Add(new Tuple(" DESCRIÇÃO", (string.IsNullOrWhiteSpace(listCobertura.Descricao) ? "" : listCobertura.Descricao.ToUpper()), "")); + observableCollection1.Add(new Tuple(" 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> Validate() + { + return ValidationHelper.AddValue(); + } + + public event PropertyChangedEventHandler PropertyChanged; + } +} \ No newline at end of file -- cgit v1.2.3