using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Text.RegularExpressions; using Gestor.Model.Common; using Gestor.Model.Domain.Generic; using Gestor.Model.Domain.Seguros; using Gestor.Model.Validation; namespace Gestor.Model.Domain.Ferramentas; public class LogEmail : DomainBase { public Credencial Credencial { get; set; } public TipoTela Tela { get; set; } public Relatorio Relatorio { get; set; } public long EntityId { get; set; } public string Assunto { get; set; } public string Corpo { get; set; } public string Destinatarios { get; set; } public string Cco { get; set; } public string Anexos { get; set; } public Usuario Usuario { get; set; } public DateTime Data { get; set; } public string Versao { get; set; } public string NomeMaquina { get; set; } public string UsuarioMaquina { get; set; } public string Ip { get; set; } public List CriarLogEmail() { Corpo = new Regex(".*<\\/title>").Replace(Corpo, "").Trim(); Corpo = new Regex("(<[^>]*>)|(p\\s?{[^}]*})|(\\r)|(\\n)").Replace(Corpo, "").Trim(); return new List<TupleList> { new TupleList { Tuples = new ObservableCollection<Tuple<string, string, string>> { new Tuple<string, string, string>("ASSUNTO", string.IsNullOrWhiteSpace(Assunto) ? "" : Assunto, ""), new Tuple<string, string, string>("CORPO", string.IsNullOrWhiteSpace(Corpo) ? "" : Corpo, ""), new Tuple<string, string, string>("E-MAIL DE ENVIO", string.IsNullOrWhiteSpace(Credencial?.Email) ? "" : Credencial?.Email, ""), new Tuple<string, string, string>("DESTINATÁRIOS", string.IsNullOrWhiteSpace(Destinatarios) ? "" : Destinatarios, ""), new Tuple<string, string, string>("ANEXOS", string.IsNullOrWhiteSpace(Anexos) ? "" : Anexos, ""), new Tuple<string, string, string>("CCO", string.IsNullOrWhiteSpace(Cco) ? "" : Cco, ""), new Tuple<string, string, string>("RELATORIO", string.IsNullOrWhiteSpace(Relatorio.GetDescription()) ? "" : Relatorio.GetDescription(), "") } } }; } }