diff options
| author | Lucas Faria Mendes <lucas.fariamo08@gmail.com> | 2026-03-30 13:38:18 +0000 |
|---|---|---|
| committer | Lucas Faria Mendes <lucas.fariamo08@gmail.com> | 2026-03-30 13:38:18 +0000 |
| commit | 1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1 (patch) | |
| tree | e1c3b20ea08f0cf71122a1e73f0d395f8fd83874 /Codemerx/Gestor.Model/Model.Domain.Seguros/Prospeccao.cs | |
| parent | 674ca83ba9243a9e95a7568c797668dab6aee26a (diff) | |
| download | gestor-1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1.tar.gz gestor-1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1.zip | |
chore: location
Diffstat (limited to 'Codemerx/Gestor.Model/Model.Domain.Seguros/Prospeccao.cs')
| -rw-r--r-- | Codemerx/Gestor.Model/Model.Domain.Seguros/Prospeccao.cs | 400 |
1 files changed, 400 insertions, 0 deletions
diff --git a/Codemerx/Gestor.Model/Model.Domain.Seguros/Prospeccao.cs b/Codemerx/Gestor.Model/Model.Domain.Seguros/Prospeccao.cs new file mode 100644 index 0000000..059b612 --- /dev/null +++ b/Codemerx/Gestor.Model/Model.Domain.Seguros/Prospeccao.cs @@ -0,0 +1,400 @@ +using Gestor.Model.Attributes;
+using Gestor.Model.Common;
+using Gestor.Model.Domain.Common;
+using Gestor.Model.Domain.Ferramentas;
+using Gestor.Model.Domain.Generic;
+using Gestor.Model.Helper;
+using Gestor.Model.Resources;
+using Gestor.Model.Validation;
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.ComponentModel;
+using System.Runtime.CompilerServices;
+
+namespace Gestor.Model.Domain.Seguros
+{
+ public class Prospeccao : DomainBase, IDomain
+ {
+ private string _nome;
+
+ private string _item;
+
+ private string _observacao;
+
+ public bool AbrirTarefa
+ {
+ get;
+ set;
+ }
+
+ public List<ArquivoDigital> Anexos
+ {
+ get;
+ set;
+ }
+
+ public bool CriarTarefa
+ {
+ get;
+ set;
+ }
+
+ public DateTime? DataCriacao
+ {
+ get;
+ set;
+ }
+
+ [Description("DOCUMENTO")]
+ public string Documento
+ {
+ get;
+ set;
+ }
+
+ [Description("E-MAIL")]
+ public string Email
+ {
+ get;
+ set;
+ }
+
+ public bool Excluido
+ {
+ get;
+ set;
+ }
+
+ public long IdEmpresa
+ {
+ get;
+ set;
+ }
+
+ [Description("ITEM")]
+ public string Item
+ {
+ get
+ {
+ string str = this._item;
+ if (str != null)
+ {
+ return str.ToUpper();
+ }
+ return null;
+ }
+ set
+ {
+ this._item = value;
+ }
+ }
+
+ [Description("NASCIMENTO")]
+ [Tipo("DATA?")]
+ public DateTime? Nascimento
+ {
+ get;
+ set;
+ }
+
+ [Description("CLIENTE")]
+ public string Nome
+ {
+ get
+ {
+ string str = this._nome;
+ if (str != null)
+ {
+ return str.ToUpper();
+ }
+ return null;
+ }
+ set
+ {
+ this._nome = value;
+ }
+ }
+
+ public string Observacao
+ {
+ get
+ {
+ string str = this._observacao;
+ if (str != null)
+ {
+ return str.ToUpper();
+ }
+ return null;
+ }
+ set
+ {
+ this._observacao = value;
+ }
+ }
+
+ [Description("DDD")]
+ public string Prefixo1
+ {
+ get;
+ set;
+ }
+
+ [Description("DDD")]
+ public string Prefixo2
+ {
+ get;
+ set;
+ }
+
+ public Gestor.Model.Domain.Seguros.Produto Produto
+ {
+ get;
+ set;
+ }
+
+ public Gestor.Model.Domain.Seguros.Ramo Ramo
+ {
+ get;
+ set;
+ }
+
+ public bool Renovacao
+ {
+ get;
+ set;
+ }
+
+ [Description("STATUS")]
+ [Tipo("ENUM?")]
+ public StatusProspeccao? Status
+ {
+ get;
+ set;
+ }
+
+ [Description("STATUS PERSONALIZADO")]
+ public StatusDeProspeccao StatusPersonalizado
+ {
+ get;
+ set;
+ }
+
+ public Gestor.Model.Domain.Ferramentas.Tarefa Tarefa
+ {
+ get;
+ set;
+ }
+
+ [Description("TELEFONE")]
+ public string Telefone1
+ {
+ get;
+ set;
+ }
+
+ [Description("TELEFONE")]
+ public string Telefone2
+ {
+ get;
+ set;
+ }
+
+ [Description("TIPO")]
+ public string Tipo
+ {
+ get;
+ set;
+ }
+
+ public long UsuarioCriacao
+ {
+ get;
+ set;
+ }
+
+ [JsonIgnore]
+ public Func<List<KeyValuePair<string, string>>> ValidationEvent
+ {
+ get
+ {
+ Prospeccao prospeccao = this;
+ return new Func<List<KeyValuePair<string, string>>>(prospeccao.Validate);
+ }
+ }
+
+ [Description("VALOR")]
+ public decimal Valor
+ {
+ get;
+ set;
+ }
+
+ public Gestor.Model.Domain.Seguros.Vendedor Vendedor
+ {
+ get;
+ set;
+ }
+
+ [Description("VIGÊNCIA FINAL")]
+ [Tipo("DATA?")]
+ public DateTime? VigenciaFinal
+ {
+ get;
+ set;
+ }
+
+ public Prospeccao()
+ {
+ }
+
+ public List<TupleList> Log()
+ {
+ string shortDateString;
+ string nome;
+ string str;
+ string nome1;
+ string description;
+ List<TupleList> tupleLists = new List<TupleList>();
+ TupleList tupleList = new TupleList();
+ ObservableCollection<Tuple<string, string, string>> observableCollection = new ObservableCollection<Tuple<string, string, string>>()
+ {
+ new Tuple<string, string, string>("NOME", (string.IsNullOrWhiteSpace(this.Nome) ? "" : this.Nome), ""),
+ new Tuple<string, string, string>("DOCUMENTO", (string.IsNullOrWhiteSpace(this.Documento) ? "" : this.Documento), "")
+ };
+ DateTime? nascimento = this.Nascimento;
+ if (!nascimento.HasValue)
+ {
+ shortDateString = "";
+ }
+ else
+ {
+ nascimento = this.Nascimento;
+ if (nascimento.HasValue)
+ {
+ shortDateString = nascimento.GetValueOrDefault().ToShortDateString();
+ }
+ else
+ {
+ shortDateString = null;
+ }
+ }
+ observableCollection.Add(new Tuple<string, string, string>("NASCIMENTO", shortDateString, ""));
+ observableCollection.Add(new Tuple<string, string, string>("PRIMEIRO PREFIXO", (string.IsNullOrWhiteSpace(this.Prefixo1) ? "" : this.Prefixo1), ""));
+ observableCollection.Add(new Tuple<string, string, string>("PRIMEIRO TELEFONE", (string.IsNullOrWhiteSpace(this.Telefone1) ? "" : this.Telefone1), ""));
+ observableCollection.Add(new Tuple<string, string, string>("SEGUNDO PREFIXO", (string.IsNullOrWhiteSpace(this.Prefixo2) ? "" : this.Prefixo2), ""));
+ observableCollection.Add(new Tuple<string, string, string>("SEGUNDO TELEFONE", (string.IsNullOrWhiteSpace(this.Telefone2) ? "" : this.Telefone2), ""));
+ observableCollection.Add(new Tuple<string, string, string>("E-MAIL", (string.IsNullOrWhiteSpace(this.Email) ? "" : this.Email), ""));
+ observableCollection.Add(new Tuple<string, string, string>("ITEM", (string.IsNullOrWhiteSpace(this.Item) ? "" : this.Item), ""));
+ Gestor.Model.Domain.Seguros.Produto produto = this.Produto;
+ if (produto != null)
+ {
+ nome = produto.Nome;
+ }
+ else
+ {
+ nome = null;
+ }
+ observableCollection.Add(new Tuple<string, string, string>("PRODUTO", (string.IsNullOrWhiteSpace(nome) ? "" : this.Produto.Nome), ""));
+ nascimento = this.VigenciaFinal;
+ if (!nascimento.HasValue)
+ {
+ str = "";
+ }
+ else
+ {
+ nascimento = this.VigenciaFinal;
+ if (nascimento.HasValue)
+ {
+ str = nascimento.GetValueOrDefault().ToShortDateString();
+ }
+ else
+ {
+ str = null;
+ }
+ }
+ observableCollection.Add(new Tuple<string, string, string>("VENCIMENTO", str, ""));
+ Gestor.Model.Domain.Seguros.Vendedor vendedor = this.Vendedor;
+ if (vendedor != null)
+ {
+ nome1 = vendedor.Nome;
+ }
+ else
+ {
+ nome1 = null;
+ }
+ observableCollection.Add(new Tuple<string, string, string>("VENDEDOR", (string.IsNullOrWhiteSpace(nome1) ? "" : this.Vendedor.Nome), ""));
+ StatusProspeccao? status = this.Status;
+ if (!status.HasValue)
+ {
+ description = "";
+ }
+ else
+ {
+ status = this.Status;
+ if (status.HasValue)
+ {
+ description = status.GetValueOrDefault().GetDescription();
+ }
+ else
+ {
+ description = null;
+ }
+ }
+ observableCollection.Add(new Tuple<string, string, string>("STATUS", description, ""));
+ observableCollection.Add(new Tuple<string, string, string>("STATUS PERSONALIZADO", (this.StatusPersonalizado == null ? "" : this.StatusPersonalizado.Nome), ""));
+ observableCollection.Add(new Tuple<string, string, string>("OBSERVAÇÃO", (string.IsNullOrWhiteSpace(this.Observacao) ? "" : this.Observacao), ""));
+ tupleList.Tuples = observableCollection;
+ tupleLists.Add(tupleList);
+ List<TupleList> tupleLists1 = tupleLists;
+ if (this.Tarefa != null)
+ {
+ ObservableCollection<Tuple<string, string, string>> observableCollection1 = new ObservableCollection<Tuple<string, string, string>>()
+ {
+ new Tuple<string, string, string>("TAREFA$", "", ""),
+ new Tuple<string, string, string>(" RESPONSÁVEL", (string.IsNullOrWhiteSpace(this.Tarefa.Usuario.Nome) ? "" : this.Tarefa.Usuario.Nome), "")
+ };
+ DateTime agendamento = this.Tarefa.Agendamento;
+ observableCollection1.Add(new Tuple<string, string, string>(" DATA DO AGENDAMENTO", agendamento.ToShortDateString(), ""));
+ agendamento = this.Tarefa.Agendamento;
+ observableCollection1.Add(new Tuple<string, string, string>(" HORA DO AGENDAMENTO", agendamento.ToShortTimeString(), ""));
+ tupleLists1.Add(new TupleList()
+ {
+ Tuples = observableCollection1
+ });
+ }
+ return tupleLists1;
+ }
+
+ public List<KeyValuePair<string, string>> Validate()
+ {
+ List<KeyValuePair<string, string>> keyValuePairs = ValidationHelper.AddValue();
+ if (this.Nascimento.HasValue && (DateTime.Compare(this.Nascimento.Value, new DateTime(1753, 1, 1)) < 0 || DateTime.Compare(this.Nascimento.Value, new DateTime(9999, 12, 31)) > 0))
+ {
+ keyValuePairs.AddValue<string, string>("Nascimento", string.Format(Messages.DataInvalida, Array.Empty<object>()), true);
+ }
+ if (this.VigenciaFinal.HasValue && (DateTime.Compare(this.VigenciaFinal.Value, new DateTime(1753, 1, 1)) < 0 || DateTime.Compare(this.VigenciaFinal.Value, new DateTime(9999, 12, 31)) > 0))
+ {
+ keyValuePairs.AddValue<string, string>("VigenciaFinal|VENCIMENTO", string.Format(Messages.DataInvalida, Array.Empty<object>()), true);
+ }
+ if (string.IsNullOrWhiteSpace(this.Nome))
+ {
+ keyValuePairs.AddValue<string, string>("Nome", Messages.Obrigatorio, true);
+ }
+ if (string.IsNullOrWhiteSpace(this.Telefone1) && string.IsNullOrWhiteSpace(this.Telefone2) && string.IsNullOrWhiteSpace(this.Email))
+ {
+ keyValuePairs.AddValue<string, string>("Telefone1|TELEFONE 1", Messages.Obrigatorio, true);
+ }
+ if (!this.VigenciaFinal.HasValue)
+ {
+ keyValuePairs.AddValue<string, string>("VigenciaFinal|VENCIMENTO", Messages.Obrigatorio, true);
+ }
+ if (string.IsNullOrWhiteSpace(this.Item))
+ {
+ keyValuePairs.AddValue<string, string>("Item", Messages.Obrigatorio, true);
+ }
+ return keyValuePairs;
+ }
+ }
+}
\ No newline at end of file |