From 1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1 Mon Sep 17 00:00:00 2001 From: Lucas Faria Mendes Date: Mon, 30 Mar 2026 10:38:18 -0300 Subject: chore: location --- .../Model.Domain.Ferramentas/LogEmail.cs | 157 +++++++++++++++++++++ 1 file changed, 157 insertions(+) create mode 100644 Codemerx/Gestor.Model/Model.Domain.Ferramentas/LogEmail.cs (limited to 'Codemerx/Gestor.Model/Model.Domain.Ferramentas/LogEmail.cs') diff --git a/Codemerx/Gestor.Model/Model.Domain.Ferramentas/LogEmail.cs b/Codemerx/Gestor.Model/Model.Domain.Ferramentas/LogEmail.cs new file mode 100644 index 0000000..a884b02 --- /dev/null +++ b/Codemerx/Gestor.Model/Model.Domain.Ferramentas/LogEmail.cs @@ -0,0 +1,157 @@ +using Gestor.Model.Common; +using Gestor.Model.Domain.Generic; +using Gestor.Model.Domain.Seguros; +using Gestor.Model.Validation; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.CompilerServices; +using System.Text.RegularExpressions; + +namespace Gestor.Model.Domain.Ferramentas +{ + public class LogEmail : DomainBase + { + public string Anexos + { + get; + set; + } + + public string Assunto + { + get; + set; + } + + public string Cco + { + get; + set; + } + + public string Corpo + { + get; + set; + } + + public Gestor.Model.Domain.Ferramentas.Credencial Credencial + { + get; + set; + } + + public DateTime Data + { + get; + set; + } + + public string Destinatarios + { + get; + set; + } + + public long EntityId + { + get; + set; + } + + public string Ip + { + get; + set; + } + + public string NomeMaquina + { + get; + set; + } + + public Gestor.Model.Common.Relatorio Relatorio + { + get; + set; + } + + public TipoTela Tela + { + get; + set; + } + + public Gestor.Model.Domain.Seguros.Usuario Usuario + { + get; + set; + } + + public string UsuarioMaquina + { + get; + set; + } + + public string Versao + { + get; + set; + } + + public LogEmail() + { + } + + public List CriarLogEmail() + { + string email; + string str; + this.Corpo = (new Regex(".*<\\/title>")).Replace(this.Corpo, "").Trim(); + this.Corpo = (new Regex("(<[^>]*>)|(p\\s?{[^}]*})|(\\r)|(\\n)")).Replace(this.Corpo, "").Trim(); + 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>("ASSUNTO", (string.IsNullOrWhiteSpace(this.Assunto) ? "" : this.Assunto), ""), + new Tuple<string, string, string>("CORPO", (string.IsNullOrWhiteSpace(this.Corpo) ? "" : this.Corpo), "") + }; + Gestor.Model.Domain.Ferramentas.Credencial credencial = this.Credencial; + if (credencial != null) + { + email = credencial.Email; + } + else + { + email = null; + } + if (string.IsNullOrWhiteSpace(email)) + { + str = ""; + } + else + { + Gestor.Model.Domain.Ferramentas.Credencial credencial1 = this.Credencial; + if (credencial1 != null) + { + str = credencial1.Email; + } + else + { + str = null; + } + } + observableCollection.Add(new Tuple<string, string, string>("E-MAIL DE ENVIO", str, "")); + observableCollection.Add(new Tuple<string, string, string>("DESTINATÁRIOS", (string.IsNullOrWhiteSpace(this.Destinatarios) ? "" : this.Destinatarios), "")); + observableCollection.Add(new Tuple<string, string, string>("ANEXOS", (string.IsNullOrWhiteSpace(this.Anexos) ? "" : this.Anexos), "")); + observableCollection.Add(new Tuple<string, string, string>("CCO", (string.IsNullOrWhiteSpace(this.Cco) ? "" : this.Cco), "")); + observableCollection.Add(new Tuple<string, string, string>("RELATORIO", (string.IsNullOrWhiteSpace(this.Relatorio.GetDescription()) ? "" : this.Relatorio.GetDescription()), "")); + tupleList.Tuples = observableCollection; + tupleLists.Add(tupleList); + return tupleLists; + } + } +} \ No newline at end of file -- cgit v1.2.3