summaryrefslogtreecommitdiff
path: root/Gestor.Model/Gestor.Model.Domain.Ferramentas/LogEmail.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Gestor.Model/Gestor.Model.Domain.Ferramentas/LogEmail.cs')
-rw-r--r--Gestor.Model/Gestor.Model.Domain.Ferramentas/LogEmail.cs65
1 files changed, 65 insertions, 0 deletions
diff --git a/Gestor.Model/Gestor.Model.Domain.Ferramentas/LogEmail.cs b/Gestor.Model/Gestor.Model.Domain.Ferramentas/LogEmail.cs
new file mode 100644
index 0000000..b713416
--- /dev/null
+++ b/Gestor.Model/Gestor.Model.Domain.Ferramentas/LogEmail.cs
@@ -0,0 +1,65 @@
+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<TupleList> CriarLogEmail()
+ {
+ Corpo = new Regex("<title>.*<\\/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(), "")
+ }
+ }
+ };
+ }
+}