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/Consorcio.cs | 191 +++++++++++++++++++++++++ 1 file changed, 191 insertions(+) create mode 100644 Gestor.Model/Model.Domain.Seguros/Consorcio.cs (limited to 'Gestor.Model/Model.Domain.Seguros/Consorcio.cs') diff --git a/Gestor.Model/Model.Domain.Seguros/Consorcio.cs b/Gestor.Model/Model.Domain.Seguros/Consorcio.cs new file mode 100644 index 0000000..3efd5ad --- /dev/null +++ b/Gestor.Model/Model.Domain.Seguros/Consorcio.cs @@ -0,0 +1,191 @@ +using Gestor.Model.Domain.Generic; +using Gestor.Model.Helper; +using Gestor.Model.Resources; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Globalization; +using System.Runtime.CompilerServices; + +namespace Gestor.Model.Domain.Seguros +{ + public class Consorcio : DomainBase, IDomain + { + private string _bensConsorcio; + + private string _grupo; + + private string _cota; + + private decimal? _valorCredito; + + private string _observacao; + + public string BensConsorcio + { + get + { + string str = this._bensConsorcio; + if (str != null) + { + return str.ToUpper(); + } + return null; + } + set + { + this._bensConsorcio = value; + } + } + + public string Cota + { + get + { + string str = this._cota; + if (str != null) + { + return str.ToUpper(); + } + return null; + } + set + { + this._cota = value; + } + } + + public string Grupo + { + get + { + string str = this._grupo; + if (str != null) + { + return str.ToUpper(); + } + return null; + } + set + { + this._grupo = value; + } + } + + public Gestor.Model.Domain.Seguros.Item Item + { + get; + set; + } + + public string Observacao + { + get + { + string str = this._observacao; + if (str != null) + { + return str.ToUpper(); + } + return null; + } + set + { + this._observacao = value; + } + } + + [JsonIgnore] + public Func>> ValidationEvent + { + get + { + Consorcio consorcio = this; + return new Func>>(consorcio.Validate); + } + } + + public decimal? ValorCredito + { + get + { + return this._valorCredito; + } + set + { + this._valorCredito = value; + } + } + + public Consorcio() + { + } + + public static List Log(Gestor.Model.Domain.Seguros.Item item) + { + decimal valueOrDefault; + string str; + List tupleLists = new List(); + TupleList tupleList = new TupleList(); + ObservableCollection> observableCollection = new ObservableCollection>() + { + new Tuple("DESCRIÇÃO", (string.IsNullOrWhiteSpace(item.Consorcio.BensConsorcio) ? "" : item.Consorcio.BensConsorcio), ""), + new Tuple("GRUPO", (string.IsNullOrWhiteSpace(item.Consorcio.Grupo) ? "" : item.Consorcio.Grupo), ""), + new Tuple("COTA", (string.IsNullOrWhiteSpace(item.Consorcio.Cota) ? "" : item.Consorcio.Cota), "") + }; + decimal? valorCredito = item.Consorcio.ValorCredito; + if (!valorCredito.HasValue) + { + str = ""; + } + else + { + valorCredito = item.Consorcio.ValorCredito; + if (valorCredito.HasValue) + { + valueOrDefault = valorCredito.GetValueOrDefault(); + str = valueOrDefault.ToString("C", new CultureInfo("pt-BR", false)); + } + else + { + str = null; + } + } + observableCollection.Add(new Tuple("GRUPO", str, "")); + tupleList.Tuples = observableCollection; + tupleLists.Add(tupleList); + List tupleLists1 = tupleLists; + ObservableCollection> observableCollection1 = new ObservableCollection>() + { + new Tuple("COBERTURAS$", "", "") + }; + foreach (Cobertura cobertura in item.Coberturas) + { + observableCollection1.Add(new Tuple(string.Format(" COBERTURA {0}$", item.Coberturas.IndexOf(cobertura) + 1), "", "")); + observableCollection1.Add(new Tuple(" OBSERVAÇÃO", (string.IsNullOrWhiteSpace(cobertura.Observacao) ? "" : cobertura.Observacao.ToUpper()), "")); + valueOrDefault = cobertura.Premio; + observableCollection1.Add(new Tuple(" PRÊMIO", valueOrDefault.ToString("C", new CultureInfo("pt-BR", false)), "")); + valueOrDefault = cobertura.Franquia; + observableCollection1.Add(new Tuple(" FRANQUIA", valueOrDefault.ToString("C", new CultureInfo("pt-BR", false)), "")); + valueOrDefault = cobertura.Lmi; + observableCollection1.Add(new Tuple(" L.M.I.", valueOrDefault.ToString("C", new CultureInfo("pt-BR", false)), "")); + } + tupleLists1.Add(new TupleList() + { + Tuples = observableCollection1 + }); + return tupleLists1; + } + + public List> Validate() + { + List> keyValuePairs = ValidationHelper.AddValue(); + if (string.IsNullOrWhiteSpace(this.BensConsorcio)) + { + keyValuePairs.AddValue("BensConsorcio", Messages.Obrigatorio, true); + } + return keyValuePairs; + } + } +} \ No newline at end of file -- cgit v1.2.3