From 225aa1499e37faf9d38257caabbadc68d78b427e Mon Sep 17 00:00:00 2001 From: Lucas Faria Mendes Date: Mon, 30 Mar 2026 12:29:41 -0300 Subject: decompiler.com --- .../LogEmailViewModel.cs | 161 +++++++++++++++++++++ 1 file changed, 161 insertions(+) create mode 100644 Decompiler/Gestor.Application.ViewModels.Drawer/LogEmailViewModel.cs (limited to 'Decompiler/Gestor.Application.ViewModels.Drawer/LogEmailViewModel.cs') diff --git a/Decompiler/Gestor.Application.ViewModels.Drawer/LogEmailViewModel.cs b/Decompiler/Gestor.Application.ViewModels.Drawer/LogEmailViewModel.cs new file mode 100644 index 0000000..5086554 --- /dev/null +++ b/Decompiler/Gestor.Application.ViewModels.Drawer/LogEmailViewModel.cs @@ -0,0 +1,161 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Text; +using System.Windows; +using Gestor.Application.Helpers; +using Gestor.Application.Servicos; +using Gestor.Application.ViewModels.Generic; +using Gestor.Model.Common; +using Gestor.Model.Domain.Configuracoes; +using Gestor.Model.Domain.Ferramentas; +using Gestor.Model.Domain.Seguros; + +namespace Gestor.Application.ViewModels.Drawer; + +public class LogEmailViewModel : BaseSegurosViewModel +{ + private readonly LogServico _servico; + + private Visibility _visibilityDetalhesLog = (Visibility)1; + + private bool _mostrarMensagem; + + private ObservableCollection _logs = new ObservableCollection(); + + private LogEmail _selectedLog; + + private List _lists = new List(); + + public Visibility VisiblityDetalhesLog + { + get + { + //IL_0001: Unknown result type (might be due to invalid IL or missing references) + return _visibilityDetalhesLog; + } + set + { + //IL_0001: Unknown result type (might be due to invalid IL or missing references) + //IL_0002: Unknown result type (might be due to invalid IL or missing references) + _visibilityDetalhesLog = value; + OnPropertyChanged("VisiblityDetalhesLog"); + } + } + + public bool MostrarMensagem + { + get + { + return _mostrarMensagem; + } + set + { + _mostrarMensagem = value; + OnPropertyChanged("MostrarMensagem"); + } + } + + public ObservableCollection Logs + { + get + { + return _logs; + } + set + { + _logs = value; + OnPropertyChanged("Logs"); + } + } + + public LogEmail SelectedLog + { + get + { + return _selectedLog; + } + set + { + _selectedLog = value; + List lists = SelectedLog.CriarLogEmail(); + Lists = lists; + OnPropertyChanged("SelectedLog"); + } + } + + public List Lists + { + get + { + return _lists; + } + set + { + _lists = value; + OnPropertyChanged("Lists"); + } + } + + public LogEmailViewModel(TipoTela tela, long id, bool singleMode) + { + //IL_0002: Unknown result type (might be due to invalid IL or missing references) + //IL_0064: Unknown result type (might be due to invalid IL or missing references) + _servico = new LogServico(); + VisiblityDetalhesLog = (Visibility)(!Recursos.Configuracoes.Any((ConfiguracaoSistema c) => (int)c.Configuracao == 55)); + Seleciona(tela, id, singleMode); + } + + private async void Seleciona(TipoTela tela, long id, bool singleMode) + { + //IL_0016: Unknown result type (might be due to invalid IL or missing references) + //IL_0017: Unknown result type (might be due to invalid IL or missing references) + Loading(isLoading: true); + if (singleMode) + { + Logs = await _servico.FindById(id); + } + else + { + Logs = await _servico.FindByEntity(tela, id); + } + if (Logs.Count > 0) + { + SelectedLog = Logs[0]; + } + else + { + MostrarMensagem = true; + } + Loading(isLoading: false); + } + + public void Imprimir() + { + string text = "LOGS
LOG ENVIO DE E-MAIL"; + foreach (TupleList list in Lists) + { + foreach (Tuple tuple in list.Tuples) + { + if (tuple == list.Tuples.First()) + { + text += ""; + text += "
DESCRIÇÃOE-MAIL ENVIADO
"; + } + bool flag = tuple.Item1.Contains("$"); + text = text + ""; + text += "
" + tuple.Item1.Replace(" ", " ").Replace("$", "") + "" + tuple.Item2 + "
"; + } + } + text += "
"; + string tempPath = Path.GetTempPath(); + string text2 = $"{tempPath}{(object)(TipoExtrato)0}_{Funcoes.GetNetworkTime():ddMMyyyyhhmmss}.html"; + StreamWriter streamWriter = new StreamWriter(text2, append: true, Encoding.UTF8); + streamWriter.Write(text); + streamWriter.Close(); + Process.Start(text2); + } +} -- cgit v1.2.3