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.Domain.Ferramentas/Agenda.cs | 110 +++++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 Gestor.Model/Gestor.Model.Domain.Ferramentas/Agenda.cs (limited to 'Gestor.Model/Gestor.Model.Domain.Ferramentas/Agenda.cs') diff --git a/Gestor.Model/Gestor.Model.Domain.Ferramentas/Agenda.cs b/Gestor.Model/Gestor.Model.Domain.Ferramentas/Agenda.cs new file mode 100644 index 0000000..9d71ebe --- /dev/null +++ b/Gestor.Model/Gestor.Model.Domain.Ferramentas/Agenda.cs @@ -0,0 +1,110 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using Gestor.Model.Common; +using Gestor.Model.Domain.Generic; +using Gestor.Model.Domain.Seguros; +using Gestor.Model.Helper; +using Gestor.Model.Resources; +using Gestor.Model.Validation; +using Newtonsoft.Json; + +namespace Gestor.Model.Domain.Ferramentas; + +public class Agenda : DomainBase, IDomain +{ + public string Nome { get; set; } + + public string Endereco { get; set; } + + public string Cep { get; set; } + + public string Numero { get; set; } + + public string Complemento { get; set; } + + public string Bairro { get; set; } + + public string Cidade { get; set; } + + public string Estado { get; set; } + + public string Observacao { get; set; } + + public ObservableCollection Telefones { get; set; } + + public ObservableCollection Emails { get; set; } + + [JsonIgnore] + public Func>> ValidationEvent => Validate; + + public List> Validate() + { + List> list = ValidationHelper.AddValue(); + if (string.IsNullOrWhiteSpace(Nome)) + { + list.AddValue("Nome", Messages.Obrigatorio); + } + return list; + } + + public List Log() + { + List list = new List(); + list.Add(new TupleList + { + Tuples = new ObservableCollection> + { + new Tuple("NOME", string.IsNullOrWhiteSpace(Nome) ? "" : Nome, ""), + new Tuple("CEP", string.IsNullOrWhiteSpace(Cep) ? "" : Cep, ""), + new Tuple("ENDEREÇO", string.IsNullOrWhiteSpace(Endereco) ? "" : Endereco, ""), + new Tuple("NÚMERO", string.IsNullOrWhiteSpace(Numero) ? "" : Numero, ""), + new Tuple("COMPLEMENTO", string.IsNullOrWhiteSpace(Complemento) ? "" : Complemento, ""), + new Tuple("BAIRRO", string.IsNullOrWhiteSpace(Bairro) ? "" : Bairro, ""), + new Tuple("CIDADE", string.IsNullOrWhiteSpace(Cidade) ? "" : Cidade, ""), + new Tuple("ESTADO", string.IsNullOrWhiteSpace(Estado) ? "" : Estado, ""), + new Tuple("OBSERVAÇÕES", string.IsNullOrWhiteSpace(Observacao) ? "" : Observacao, "") + } + }); + ObservableCollection> observableCollection = new ObservableCollection> + { + new Tuple("TELEFONES$", "", "") + }; + foreach (AgendaTelefone telefone in Telefones) + { + observableCollection.Add(new Tuple($" TELEFONE {Telefones.IndexOf(telefone) + 1}$", "", "")); + object item; + if (telefone.Tipo.HasValue) + { + TipoTelefone? tipo = telefone.Tipo; + item = (tipo.HasValue ? tipo.GetValueOrDefault().GetDescription() : null); + } + else + { + item = ""; + } + observableCollection.Add(new Tuple(" TIPO", (string)item, "")); + observableCollection.Add(new Tuple(" PREFIXO", string.IsNullOrWhiteSpace(telefone.Prefixo) ? "" : telefone.Prefixo.ToUpper(), "")); + observableCollection.Add(new Tuple(" NÚMERO", string.IsNullOrWhiteSpace(telefone.Numero) ? "" : telefone.Numero, "")); + observableCollection.Add(new Tuple(" DESCRIÇÃO", string.IsNullOrWhiteSpace(telefone.Observacao) ? "" : telefone.Observacao, "")); + } + list.Add(new TupleList + { + Tuples = observableCollection + }); + ObservableCollection> observableCollection2 = new ObservableCollection> + { + new Tuple("EMAILS$", "", "") + }; + foreach (AgendaEmail email in Emails) + { + observableCollection2.Add(new Tuple($" EMAIL {Emails.IndexOf(email) + 1}$", "", "")); + observableCollection2.Add(new Tuple(" ENDEREÇO DE EMAIL", string.IsNullOrWhiteSpace(email.Email) ? "" : email.Email, "")); + } + list.Add(new TupleList + { + Tuples = observableCollection2 + }); + return list; + } +} -- cgit v1.2.3