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/Status.cs | 64 ++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 Gestor.Model/Gestor.Model.Domain.Seguros/Status.cs (limited to 'Gestor.Model/Gestor.Model.Domain.Seguros/Status.cs') diff --git a/Gestor.Model/Gestor.Model.Domain.Seguros/Status.cs b/Gestor.Model/Gestor.Model.Domain.Seguros/Status.cs new file mode 100644 index 0000000..5f22e1b --- /dev/null +++ b/Gestor.Model/Gestor.Model.Domain.Seguros/Status.cs @@ -0,0 +1,64 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using Gestor.Model.Attributes; +using Gestor.Model.Domain.Generic; +using Gestor.Model.Helper; +using Gestor.Model.Resources; +using Newtonsoft.Json; + +namespace Gestor.Model.Domain.Seguros; + +public class Status : DomainBase, IDomain +{ + private string _nome; + + [Log(true)] + [Name(true)] + public string Nome + { + get + { + return _nome?.ToUpper(); + } + set + { + _nome = value; + } + } + + [Log(true)] + public bool Ativo { 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("ATIVO", Ativo ? "SIM" : "NÃO", "") + } + } + }; + } +} -- cgit v1.2.3