using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; using Gestor.Model.Attributes; using Gestor.Model.Domain.Generic; using Gestor.Model.Domain.Seguros; using Gestor.Model.Helper; using Gestor.Model.Resources; using Newtonsoft.Json; namespace Gestor.Model.Domain.Ferramentas; public class StatusDeProspeccao : DomainBase { private string _nome; [Log(true)] [Name(true)] public string Nome { get { return _nome?.ToUpper(); } set { _nome = value; } } [Log(true)] [Description("DESCRIÇÃO")] public string Descricao { get; set; } [Log(true)] public bool Ativo { get; set; } public bool Excluido { get; set; } [JsonIgnore] public Func>> ValidationEvent => Validate; public List> Validate() { List> list = ValidationHelper.AddValue(); if (string.IsNullOrWhiteSpace(Nome)) { list.AddValue("Nome", Messages.Obrigatorio); } else if (Nome.Length > 60) { list.AddValue("Nome", string.Format(Messages.MaiorQueLimite, 60)); } return list; } public List Log() { return new List { new TupleList { Tuples = new ObservableCollection> { new Tuple("NOME", string.IsNullOrWhiteSpace(Nome) ? "" : Nome, ""), new Tuple("DESCRIÇÃO", string.IsNullOrWhiteSpace(Descricao) ? "" : Descricao, ""), new Tuple("ATIVO", Ativo ? "SIM" : "NÃO", ""), new Tuple("EXCLUÍDO", Excluido ? "SIM" : "NÃO", "") } } }; } }