using System; using System.Collections.Generic; using System.Collections.ObjectModel; using Gestor.Model.Common; using Gestor.Model.Domain.Generic; using Gestor.Model.Validation; namespace Gestor.Model.Domain.Seguros; public class Adiantamento : DomainBase { private string _historico; public Vendedor Vendedor { get; set; } public TipoPagamento? TipoPagamento { get; set; } public string Historico { get { return _historico?.ToUpper(); } set { _historico = value; } } public DateTime? Data { get; set; } public decimal Valor { get; set; } public bool Pago { get; set; } public DateTime? Pagamento { get; set; } public List Log() { List list = new List(); TupleList tupleList = new TupleList(); ObservableCollection> obj = new ObservableCollection> { new Tuple("HISTÓRICO", string.IsNullOrWhiteSpace(Historico) ? "" : Historico, ""), new Tuple("DATA DO ADIANTAMENTO", (!Data.HasValue) ? "" : Data?.ToShortDateString(), ""), new Tuple("VALOR DO ADIANTAMENTO", Valor.ToString("c2"), "") }; object item; if (TipoPagamento.HasValue) { TipoPagamento? tipoPagamento = TipoPagamento; item = (tipoPagamento.HasValue ? tipoPagamento.GetValueOrDefault().GetDescription() : null); } else { item = ""; } obj.Add(new Tuple("TIPO DO PAGAMENTO", (string)item, "")); obj.Add(new Tuple("PAGO", Pago ? "SIM" : "NÃO", "")); obj.Add(new Tuple("DATA DO PAGAMENTO", (!Pagamento.HasValue) ? "" : Pagamento?.ToShortDateString(), "")); tupleList.Tuples = obj; list.Add(tupleList); return list; } }