summaryrefslogtreecommitdiff
path: root/Gestor.Model/Gestor.Model.Domain.Ferramentas/StatusDeProspeccao.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Gestor.Model/Gestor.Model.Domain.Ferramentas/StatusDeProspeccao.cs')
-rw-r--r--Gestor.Model/Gestor.Model.Domain.Ferramentas/StatusDeProspeccao.cs74
1 files changed, 74 insertions, 0 deletions
diff --git a/Gestor.Model/Gestor.Model.Domain.Ferramentas/StatusDeProspeccao.cs b/Gestor.Model/Gestor.Model.Domain.Ferramentas/StatusDeProspeccao.cs
new file mode 100644
index 0000000..2e77bef
--- /dev/null
+++ b/Gestor.Model/Gestor.Model.Domain.Ferramentas/StatusDeProspeccao.cs
@@ -0,0 +1,74 @@
+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<List<KeyValuePair<string, string>>> ValidationEvent => Validate;
+
+ public List<KeyValuePair<string, string>> Validate()
+ {
+ List<KeyValuePair<string, string>> 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<TupleList> Log()
+ {
+ return new List<TupleList>
+ {
+ new TupleList
+ {
+ Tuples = new ObservableCollection<Tuple<string, string, string>>
+ {
+ new Tuple<string, string, string>("NOME", string.IsNullOrWhiteSpace(Nome) ? "" : Nome, ""),
+ new Tuple<string, string, string>("DESCRIÇÃO", string.IsNullOrWhiteSpace(Descricao) ? "" : Descricao, ""),
+ new Tuple<string, string, string>("ATIVO", Ativo ? "SIM" : "NÃO", ""),
+ new Tuple<string, string, string>("EXCLUÍDO", Excluido ? "SIM" : "NÃO", "")
+ }
+ }
+ };
+ }
+}