From 0440c722a221b8068bbf388c1c0c51f0faff0451 Mon Sep 17 00:00:00 2001 From: Lucas Faria Mendes Date: Mon, 30 Mar 2026 14:17:46 -0300 Subject: some dlls --- Gestor.Model/Gestor.Model.Domain.Seguros/Ramo.cs | 120 +++++++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 Gestor.Model/Gestor.Model.Domain.Seguros/Ramo.cs (limited to 'Gestor.Model/Gestor.Model.Domain.Seguros/Ramo.cs') diff --git a/Gestor.Model/Gestor.Model.Domain.Seguros/Ramo.cs b/Gestor.Model/Gestor.Model.Domain.Seguros/Ramo.cs new file mode 100644 index 0000000..b6e2320 --- /dev/null +++ b/Gestor.Model/Gestor.Model.Domain.Seguros/Ramo.cs @@ -0,0 +1,120 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.Globalization; +using System.Runtime.CompilerServices; +using Gestor.Model.Attributes; +using Gestor.Model.Domain.Generic; +using Gestor.Model.Helper; +using Newtonsoft.Json; + +namespace Gestor.Model.Domain.Seguros; + +public class Ramo : DomainBase, IDomain, INotifyPropertyChanged +{ + private bool _selecionado; + + private string _nome; + + private string _ramoSusep; + + public bool Selecionado + { + get + { + return _selecionado; + } + set + { + if (value != _selecionado) + { + _selecionado = value; + OnPropertyChanged("Selecionado"); + } + } + } + + [Log(true)] + [Name(true)] + [Description("RAMO")] + public string Nome + { + get + { + return _nome?.ToUpper(); + } + set + { + _nome = value; + } + } + + [Log(true)] + public decimal Iof { get; set; } + + [Log(true)] + public bool Ativo { get; set; } + + public bool Fatura { get; set; } + + public string RamoSusep + { + get + { + return _ramoSusep?.ToUpper(); + } + set + { + _ramoSusep = value; + } + } + + public long CodigoSusep { get; set; } + + [JsonIgnore] + public Func>> ValidationEvent => Validate; + + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) + { + this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + + public List> Validate() + { + return ValidationHelper.AddValue(); + } + + public List Log(List listCoberturas) + { + List list = new List + { + new TupleList + { + Tuples = new ObservableCollection> + { + new Tuple("NOME", string.IsNullOrWhiteSpace(Nome) ? "" : Nome, ""), + new Tuple("I.O.F.", (Iof / 100m).ToString("P", new CultureInfo("pt-BR", useUserOverride: false)), ""), + new Tuple("ATIVO", Ativo ? "SIM" : "NÃO", "") + } + } + }; + ObservableCollection> observableCollection = new ObservableCollection> + { + new Tuple("COBERTURAS$", "", "") + }; + foreach (CoberturaPadrao listCobertura in listCoberturas) + { + observableCollection.Add(new Tuple($" COBERTURA {listCoberturas.IndexOf(listCobertura) + 1}$", "", "")); + observableCollection.Add(new Tuple(" DESCRIÇÃO", string.IsNullOrWhiteSpace(listCobertura.Descricao) ? "" : listCobertura.Descricao.ToUpper(), "")); + observableCollection.Add(new Tuple(" PADRÃO", listCobertura.Padrao ? "SIM" : "NÃO", "")); + } + list.Add(new TupleList + { + Tuples = observableCollection + }); + return list; + } +} -- cgit v1.2.3