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 --- .../LogViewModel.cs | 1458 ++++++++++++++++++++ 1 file changed, 1458 insertions(+) create mode 100644 Decompiler/Gestor.Application.ViewModels.Drawer/LogViewModel.cs (limited to 'Decompiler/Gestor.Application.ViewModels.Drawer/LogViewModel.cs') diff --git a/Decompiler/Gestor.Application.ViewModels.Drawer/LogViewModel.cs b/Decompiler/Gestor.Application.ViewModels.Drawer/LogViewModel.cs new file mode 100644 index 0000000..bc49853 --- /dev/null +++ b/Decompiler/Gestor.Application.ViewModels.Drawer/LogViewModel.cs @@ -0,0 +1,1458 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Text; +using System.Text.RegularExpressions; +using System.Windows; +using ControlzEx; +using CsQuery.ExtensionMethods.Internal; +using Gestor.Application.Helpers; +using Gestor.Application.Servicos; +using Gestor.Application.ViewModels.Generic; +using Gestor.Model.Common; +using Gestor.Model.Domain.Common; +using Gestor.Model.Domain.Configuracoes; +using Gestor.Model.Domain.Ferramentas; +using Gestor.Model.Domain.Financeiro; +using Gestor.Model.Domain.Generic; +using Gestor.Model.Domain.Seguros; +using Gestor.Model.Validation; +using MaterialDesignThemes.Wpf; +using Newtonsoft.Json; + +namespace Gestor.Application.ViewModels.Drawer; + +public class LogViewModel : BaseSegurosViewModel +{ + private readonly LogServico _servico; + + private readonly TipoTela _tipoTela; + + private readonly long _id; + + private Visibility _visibilityDetalhesLog = (Visibility)1; + + private bool _mostrar; + + private bool _mostrarMensagem; + + private string _mostrarToolTip = "MOSTRAR TODAS OS CAMPOS"; + + private long _mostrarColuna = 120L; + + private PackIcon _mostrarIcone; + + private ObservableCollection _logs; + + private string _currentDescription; + + private RegistroLog _selectedLog; + + private List _lists; + + private ObservableCollection _listsAlterados; + + private ObservableCollection _listsAdicionados; + + private ObservableCollection _listsRemovidos; + + private string _textAdicoes; + + 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 Mostrar + { + get + { + return _mostrar; + } + set + { + //IL_0051: Unknown result type (might be due to invalid IL or missing references) + //IL_0056: Unknown result type (might be due to invalid IL or missing references) + //IL_0061: Expected O, but got Unknown + //IL_0066: Expected O, but got Unknown + //IL_0022: Unknown result type (might be due to invalid IL or missing references) + //IL_0027: Unknown result type (might be due to invalid IL or missing references) + //IL_0032: Expected O, but got Unknown + //IL_0037: Expected O, but got Unknown + _mostrar = value; + if (value) + { + MostrarColuna = 240L; + MostrarToolTip = "ESCONDER CAMPOS INALTERADOS"; + PackIcon val = new PackIcon(); + ((PackIconBase)val).Kind = (PackIconKind)1492; + MostrarIcone = val; + } + else + { + MostrarColuna = 240L; + MostrarToolTip = "MOSTRAR TODOS OS CAMPOS"; + PackIcon val2 = new PackIcon(); + ((PackIconBase)val2).Kind = (PackIconKind)1497; + MostrarIcone = val2; + } + OnPropertyChanged("Mostrar"); + } + } + + public bool MostrarMensagem + { + get + { + return _mostrarMensagem; + } + set + { + _mostrarMensagem = value; + OnPropertyChanged("MostrarMensagem"); + } + } + + public string MostrarToolTip + { + get + { + return _mostrarToolTip; + } + set + { + _mostrarToolTip = value; + OnPropertyChanged("MostrarToolTip"); + } + } + + public long MostrarColuna + { + get + { + return _mostrarColuna; + } + set + { + _mostrarColuna = value; + OnPropertyChanged("MostrarColuna"); + } + } + + public PackIcon MostrarIcone + { + get + { + return _mostrarIcone; + } + set + { + _mostrarIcone = value; + OnPropertyChanged("MostrarIcone"); + } + } + + public ObservableCollection Logs + { + get + { + return _logs; + } + set + { + _logs = value; + OnPropertyChanged("Logs"); + } + } + + public string CurrentDescription + { + get + { + return _currentDescription; + } + set + { + _currentDescription = value; + OnPropertyChanged("CurrentDescription"); + } + } + + public RegistroLog SelectedLog + { + get + { + return _selectedLog; + } + set + { + //IL_01d7: Unknown result type (might be due to invalid IL or missing references) + //IL_0081: Unknown result type (might be due to invalid IL or missing references) + //IL_0086: Unknown result type (might be due to invalid IL or missing references) + //IL_0088: Unknown result type (might be due to invalid IL or missing references) + //IL_008b: Unknown result type (might be due to invalid IL or missing references) + //IL_0171: Expected I4, but got Unknown + //IL_0016: Unknown result type (might be due to invalid IL or missing references) + //IL_001b: Unknown result type (might be due to invalid IL or missing references) + //IL_001c: Unknown result type (might be due to invalid IL or missing references) + //IL_002e: Expected I4, but got Unknown + //IL_090b: Unknown result type (might be due to invalid IL or missing references) + //IL_08b5: Unknown result type (might be due to invalid IL or missing references) + //IL_08ba: Unknown result type (might be due to invalid IL or missing references) + //IL_08c6: Expected O, but got Unknown + //IL_0733: Unknown result type (might be due to invalid IL or missing references) + //IL_0738: Unknown result type (might be due to invalid IL or missing references) + //IL_0744: Expected O, but got Unknown + _selectedLog = value; + List list = new List(); + try + { + if (value.ModeloNovo) + { + TipoAcao acao = value.Acao; + switch ((int)acao) + { + case 0: + case 2: + list = JsonConvert.DeserializeObject>(SelectedLog.Descricao).LogList(Restricao((TipoRestricao)14)); + break; + case 1: + list = JsonConvert.DeserializeObject>(SelectedLog.Descricao).LogList(Restricao((TipoRestricao)14)); + break; + } + } + else + { + TipoTela tipoTela = _tipoTela; + switch (tipoTela - 1) + { + case 1: + list = JsonConvert.DeserializeObject(SelectedLog.Descricao).Log(Restricao((TipoRestricao)14)); + break; + case 4: + try + { + list = JsonConvert.DeserializeObject(SelectedLog.Descricao).Log(Restricao((TipoRestricao)14), Restricao((TipoRestricao)95)); + } + catch + { + list = DefaultLog(SelectedLog.Descricao, SelectedLog.Acao); + } + break; + case 36: + list = JsonConvert.DeserializeObject(SelectedLog.Descricao).Log(Restricao((TipoRestricao)14), Restricao((TipoRestricao)95)); + break; + case 0: + list = JsonConvert.DeserializeObject(SelectedLog.Descricao).Log(); + break; + case 2: + { + Item val = JsonConvert.DeserializeObject(SelectedLog.Descricao); + if (val.Aeronautico != null) + { + list = Aeronautico.Log(val); + } + else if (val.Auto != null) + { + list = Auto.Log(val); + } + else if (val.Granizo != null) + { + list = Granizo.Log(val); + } + else if (val.Patrimonial != null) + { + list = Patrimonial.Log(val); + } + else if (val.RiscosDiversos != null) + { + list = RiscosDiversos.Log(val); + } + else if (val.Vida != null) + { + list = Vida.Log(val); + } + break; + } + case 12: + list = JsonConvert.DeserializeObject(SelectedLog.Descricao).Log(); + break; + case 11: + { + Ramo ramo = JsonConvert.DeserializeObject(SelectedLog.Descricao); + List list5 = (from x in Recursos.Coberturas + where x.IdRamo == ((DomainBase)ramo).Id + orderby x.Padrao descending, x.Descricao + select x).ToList(); + list = JsonConvert.DeserializeObject(SelectedLog.Descricao).Log(list5); + break; + } + case 9: + list = JsonConvert.DeserializeObject(SelectedLog.Descricao).Log(); + break; + case 8: + list = JsonConvert.DeserializeObject(SelectedLog.Descricao).Log(); + break; + case 14: + list = JsonConvert.DeserializeObject(SelectedLog.Descricao).Log(); + break; + case 13: + list = JsonConvert.DeserializeObject(SelectedLog.Descricao).Log(); + break; + case 15: + list = JsonConvert.DeserializeObject(SelectedLog.Descricao).Log(); + break; + case 16: + list = JsonConvert.DeserializeObject(SelectedLog.Descricao).Log(); + break; + case 17: + list = JsonConvert.DeserializeObject(SelectedLog.Descricao).Log(); + break; + case 21: + list = JsonConvert.DeserializeObject(SelectedLog.Descricao).Log(); + break; + case 23: + list = JsonConvert.DeserializeObject(SelectedLog.Descricao).Log(); + break; + case 25: + list = JsonConvert.DeserializeObject(SelectedLog.Descricao).Log(); + break; + case 27: + list = JsonConvert.DeserializeObject(SelectedLog.Descricao).Log(); + break; + case 28: + list = JsonConvert.DeserializeObject(SelectedLog.Descricao).Log(); + break; + case 3: + list = JsonConvert.DeserializeObject(SelectedLog.Descricao).Log(); + break; + case 32: + list = JsonConvert.DeserializeObject(SelectedLog.Descricao).Log(); + break; + case 37: + list = JsonConvert.DeserializeObject(SelectedLog.Descricao).Log(); + break; + case 33: + list = JsonConvert.DeserializeObject(SelectedLog.Descricao).Log(); + break; + case 18: + list = JsonConvert.DeserializeObject(SelectedLog.Descricao).Log(); + break; + case 40: + list = JsonConvert.DeserializeObject(SelectedLog.Descricao).Log(); + break; + case 41: + list = JsonConvert.DeserializeObject(SelectedLog.Descricao).Log(); + break; + case 35: + list = JsonConvert.DeserializeObject(SelectedLog.Descricao).Log(); + break; + case 29: + list = JsonConvert.DeserializeObject(SelectedLog.Descricao).Log(); + break; + case 10: + list = JsonConvert.DeserializeObject(SelectedLog.Descricao).Log(); + break; + case 30: + list = JsonConvert.DeserializeObject(SelectedLog.Descricao).Log(); + break; + case 45: + list = JsonConvert.DeserializeObject(SelectedLog.Descricao).Log(); + break; + case 6: + list = JsonConvert.DeserializeObject(SelectedLog.Descricao).Log(); + break; + case 42: + { + List>>>>> list4 = JsonConvert.DeserializeObject>>>>>>(SelectedLog.Descricao); + List list3 = new List(); + foreach (Tuple>>>> item in list4) + { + ObservableCollection> observableCollection = new ObservableCollection> + { + new Tuple(item.Item1 + "$", "", "") + }; + foreach (Tuple>> item2 in item.Item2) + { + observableCollection.Add(new Tuple(" " + item2.Item1 + "$", "", "")); + foreach (Tuple item3 in item2.Item2) + { + observableCollection.Add(new Tuple(" " + item3.Item1, item3.Item2, "")); + } + } + list3.Add(new TupleList + { + Tuples = observableCollection + }); + } + foreach (TupleList item4 in list3) + { + list.Add(item4); + } + break; + } + case 47: + list = JsonConvert.DeserializeObject(SelectedLog.Descricao).Log(); + break; + case 51: + list = JsonConvert.DeserializeObject(SelectedLog.Descricao).Log(); + break; + case 53: + list = JsonConvert.DeserializeObject(SelectedLog.Descricao).Log(); + break; + case 54: + list = JsonConvert.DeserializeObject(SelectedLog.Descricao).Log(); + break; + case 55: + list = JsonConvert.DeserializeObject(SelectedLog.Descricao).Log(); + break; + case 44: + { + List list2 = JsonConvert.DeserializeObject>(SelectedLog.Descricao); + List list3 = new List(); + ObservableCollection> observableCollection = new ObservableCollection> + { + new Tuple("VENDEDORES VINCULADOS$", "", "") + }; + foreach (Vendedor item5 in list2) + { + observableCollection.Add(new Tuple($" VENDEDOR {list2.IndexOf(item5) + 1}", item5.Nome, "")); + } + list3.Add(new TupleList + { + Tuples = observableCollection + }); + foreach (TupleList item6 in list3) + { + list.Add(item6); + } + break; + } + default: + list = DefaultLog(SelectedLog.Descricao, SelectedLog.Acao); + break; + } + } + } + catch (Exception) + { + } + Lists = list; + OnPropertyChanged("SelectedLog"); + } + } + + public List Lists + { + get + { + return _lists; + } + set + { + _lists = value; + SetListaFiltrada(value); + OnPropertyChanged("Lists"); + } + } + + public ObservableCollection ListsAlterados + { + get + { + return _listsAlterados; + } + set + { + _listsAlterados = value; + OnPropertyChanged("ListsAlterados"); + } + } + + public ObservableCollection ListsAdicionados + { + get + { + return _listsAdicionados; + } + set + { + _listsAdicionados = value; + OnPropertyChanged("ListsAdicionados"); + } + } + + public ObservableCollection ListsRemovidos + { + get + { + return _listsRemovidos; + } + set + { + _listsRemovidos = value; + if (ListsAlterados == null && ListsAdicionados == null && value == null) + { + MostrarMensagem = true; + } + else + { + MostrarMensagem = false; + } + OnPropertyChanged("ListsRemovidos"); + } + } + + public string TextAdicoes + { + get + { + return _textAdicoes; + } + set + { + _textAdicoes = value; + OnPropertyChanged("TextAdicoes"); + } + } + + public LogViewModel(TipoTela tela, long id, List parcelas = null, int numparcela = 0) + { + //IL_0002: Unknown result type (might be due to invalid IL or missing references) + //IL_001c: Unknown result type (might be due to invalid IL or missing references) + //IL_0021: Unknown result type (might be due to invalid IL or missing references) + //IL_002c: Expected O, but got Unknown + //IL_0031: Expected O, but got Unknown + //IL_0090: Unknown result type (might be due to invalid IL or missing references) + //IL_0091: Unknown result type (might be due to invalid IL or missing references) + //IL_00e8: Unknown result type (might be due to invalid IL or missing references) + PackIcon val = new PackIcon(); + ((PackIconBase)val).Kind = (PackIconKind)1497; + _mostrarIcone = val; + _logs = new ObservableCollection(); + _currentDescription = ""; + _lists = new List(); + _listsAlterados = new ObservableCollection(); + _listsAdicionados = new ObservableCollection(); + _listsRemovidos = new ObservableCollection(); + _textAdicoes = "INCLUSÃO"; + base._002Ector(); + _servico = new LogServico(); + _tipoTela = tela; + _id = id; + VisiblityDetalhesLog = (Visibility)(!Recursos.Configuracoes.Any((ConfiguracaoSistema c) => (int)c.Configuracao == 55)); + base.EnableMenu = true; + if (parcelas != null) + { + LogParcelas(id, parcelas, numparcela); + } + else + { + Seleciona(tela, id); + } + } + + private static List DefaultLog(string log, TipoAcao acao) + { + //IL_0006: Unknown result type (might be due to invalid IL or missing references) + //IL_000b: Unknown result type (might be due to invalid IL or missing references) + //IL_0012: Unknown result type (might be due to invalid IL or missing references) + //IL_0037: Expected O, but got Unknown + return new List + { + new TupleList + { + Tuples = new ObservableCollection> + { + new Tuple(Funcoes.GetDescription((Enum)(object)acao), log, "") + } + } + }; + } + + public int BuscaNumeroParcela(string json) + { + try + { + if (!int.TryParse(json.Split(new char[1] { '}' }).FirstOrDefault((string x) => x.Contains("NumeroParcela")).Split(new char[1] { ':' })[^1].Replace("\"", ""), out var result)) + { + return 0; + } + return result; + } + catch + { + return 0; + } + } + + private async void LogParcelas(long documento, List parcelas, int numparcela) + { + Loading(isLoading: true); + List list = new List(); + list.AddRange(parcelas); + list.Add(documento); + Logs = new ObservableCollection(await _servico.BuscaLogParcelas(list)); + ObservableCollection observableCollection = new ObservableCollection(); + List list2 = Logs.Where((RegistroLog x) => !x.ModeloNovo && x.EntidadeId == documento).ToList(); + for (int num = list2.Count - 1; num >= 0; num--) + { + ObservableCollection observableCollection2 = new ObservableCollection(); + try + { + int num2 = num; + while (num2 >= 0 && list2[num2].DataHora < list2[num].DataHora.AddSeconds(4.0)) + { + Parcela val = JsonConvert.DeserializeObject(Logs[num2].Descricao); + if (val != null && (numparcela == 0 || BuscaNumeroParcela(Logs[num2].Descricao) == numparcela)) + { + observableCollection2.Add(val); + } + num = num2; + num2--; + } + } + catch (Exception) + { + try + { + List list3 = JsonConvert.DeserializeObject>(Logs[num].Descricao); + if (list3 != null && (numparcela == 0 || BuscaNumeroParcela(Logs[num].Descricao) == numparcela)) + { + ExtensionMethods.AddRange((ICollection)observableCollection2, (IEnumerable)list3); + } + goto end_IL_01b0; + } + catch (Exception) + { + Logs[num].Descricao = Logs[num].Descricao ?? ""; + observableCollection.Insert(0, Logs[num]); + } + continue; + end_IL_01b0:; + } + observableCollection2 = new ObservableCollection(observableCollection2.OrderBy((Parcela x) => x.NumeroParcela)); + if (observableCollection2 != null && observableCollection2.Count != 0 && observableCollection2[0].Documento != null) + { + list2[num].Descricao = JsonConvert.SerializeObject((object)new Parcelas + { + ParcelasList = observableCollection2, + TipoRecebimento = observableCollection2[0].Documento.TipoRecebimento + }, new JsonSerializerSettings + { + ReferenceLoopHandling = (ReferenceLoopHandling)1 + }); + observableCollection.Insert(0, list2[num]); + } + } + List list4 = new List(); + List list5 = Logs.Where((RegistroLog x) => x.ModeloNovo).ToList(); + if (numparcela == 0) + { + list4.AddRange(list5); + } + else + { + foreach (RegistroLog item in list5) + { + int num3 = BuscaNumeroParcela(item.Descricao); + if ((num3 != 0 && num3 == numparcela) || (numparcela != 0 && parcelas.Count == 1 && item.EntidadeId != documento)) + { + list4.Add(item); + } + } + } + Logs = observableCollection; + ExtensionMethods.AddRange((ICollection)Logs, (IEnumerable)list4); + if (Logs.Count > 0) + { + SelectedLog = Logs[0]; + } + else + { + SetListaFiltrada(Lists); + } + Loading(isLoading: false); + } + + private async void Seleciona(TipoTela tela, long id, List parcelas = null, long? parcela = null) + { + //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); + Logs = new ObservableCollection(await _servico.FindByEntityId(tela, id)); + if ((int)tela == 37) + { + ObservableCollection observableCollection = new ObservableCollection(); + List list = Logs.Where((RegistroLog x) => !x.ModeloNovo).ToList(); + for (int num = list.Count - 1; num >= 0; num--) + { + ObservableCollection observableCollection2 = new ObservableCollection(); + int num2 = num; + while (num2 >= 0 && list[num2].DataHora < list[num].DataHora.AddSeconds(4.0)) + { + observableCollection2.Add(JsonConvert.DeserializeObject(list[num2].Descricao)); + num = num2; + num2--; + } + observableCollection2 = new ObservableCollection(observableCollection2.OrderBy((VendedorParcela x) => ((DomainBase)x).Id)); + list[num].Descricao = JsonConvert.SerializeObject((object)new VendedorParcelas + { + VendedorParcelasList = observableCollection2 + }, new JsonSerializerSettings + { + ReferenceLoopHandling = (ReferenceLoopHandling)1 + }); + observableCollection.Insert(0, list[num]); + } + List list2 = Logs.Where((RegistroLog x) => x.ModeloNovo).ToList(); + Logs = observableCollection; + ExtensionMethods.AddRange((ICollection)Logs, (IEnumerable)list2); + } + if (Logs.Count > 0) + { + SelectedLog = Logs[0]; + } + else + { + SetListaFiltrada(Lists); + } + Loading(isLoading: false); + } + + public void SetListaFiltrada(List listAtual) + { + //IL_0036: Unknown result type (might be due to invalid IL or missing references) + //IL_003c: Invalid comparison between Unknown and I4 + //IL_0083: Unknown result type (might be due to invalid IL or missing references) + //IL_00ca: Unknown result type (might be due to invalid IL or missing references) + //IL_00d0: Invalid comparison between Unknown and I4 + //IL_0173: Unknown result type (might be due to invalid IL or missing references) + //IL_0178: Unknown result type (might be due to invalid IL or missing references) + //IL_017a: Unknown result type (might be due to invalid IL or missing references) + //IL_017d: Unknown result type (might be due to invalid IL or missing references) + //IL_0263: Expected I4, but got Unknown + //IL_0e13: Unknown result type (might be due to invalid IL or missing references) + //IL_0e18: Unknown result type (might be due to invalid IL or missing references) + //IL_0e28: Expected O, but got Unknown + //IL_0d23: Unknown result type (might be due to invalid IL or missing references) + //IL_0d28: Unknown result type (might be due to invalid IL or missing references) + //IL_0d34: Expected O, but got Unknown + //IL_0b11: Unknown result type (might be due to invalid IL or missing references) + //IL_0b16: Unknown result type (might be due to invalid IL or missing references) + //IL_0b22: Expected O, but got Unknown + //IL_1026: Unknown result type (might be due to invalid IL or missing references) + //IL_102b: Unknown result type (might be due to invalid IL or missing references) + //IL_103b: Expected O, but got Unknown + //IL_13d8: Unknown result type (might be due to invalid IL or missing references) + //IL_13dd: Unknown result type (might be due to invalid IL or missing references) + //IL_13ed: Expected O, but got Unknown + //IL_1770: Unknown result type (might be due to invalid IL or missing references) + //IL_1775: Unknown result type (might be due to invalid IL or missing references) + //IL_1785: Expected O, but got Unknown + if (Logs.Count == 0) + { + ListsAlterados = null; + ListsAdicionados = null; + ListsRemovidos = null; + return; + } + if (SelectedLog.ModeloNovo && (int)SelectedLog.Acao == 1) + { + TextAdicoes = "ALTERAÇÕES"; + ListsAdicionados = null; + ListsRemovidos = null; + ListsAlterados = new ObservableCollection(Lists); + MostrarMensagem = false; + return; + } + if (SelectedLog.ModeloNovo && (int)SelectedLog.Acao == 0) + { + TextAdicoes = "INCLUSÕES"; + ListsAlterados = null; + ListsRemovidos = null; + ListsAdicionados = new ObservableCollection(listAtual); + MostrarMensagem = false; + return; + } + if (SelectedLog.ModeloNovo && (int)SelectedLog.Acao == 2) + { + TextAdicoes = "EXCLUSÕES"; + ListsAlterados = null; + ListsAdicionados = null; + ListsRemovidos = new ObservableCollection(listAtual); + MostrarMensagem = false; + return; + } + if (Mostrar || Logs.Last() == SelectedLog) + { + TextAdicoes = ((Logs.Last() != SelectedLog) ? "LOG COMPLETO" : "INCLUSÃO"); + ListsAlterados = null; + ListsAdicionados = new ObservableCollection(listAtual); + ListsRemovidos = null; + return; + } + TextAdicoes = "INCLUSÃO"; + List list = new List(); + try + { + TipoTela tipoTela = _tipoTela; + switch (tipoTela - 1) + { + case 1: + list = JsonConvert.DeserializeObject(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log(Restricao((TipoRestricao)14)); + break; + case 4: + list = JsonConvert.DeserializeObject(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log(Restricao((TipoRestricao)14), Restricao((TipoRestricao)95)); + break; + case 36: + list = JsonConvert.DeserializeObject(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log(Restricao((TipoRestricao)14), Restricao((TipoRestricao)95)); + break; + case 0: + list = JsonConvert.DeserializeObject(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log(); + break; + case 2: + { + Item val = JsonConvert.DeserializeObject(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao); + if (val.Aeronautico != null) + { + list = Aeronautico.Log(val); + } + else if (val.Auto != null) + { + list = Auto.Log(val); + } + else if (val.Granizo != null) + { + list = Granizo.Log(val); + } + else if (val.Patrimonial != null) + { + list = Patrimonial.Log(val); + } + else if (val.RiscosDiversos != null) + { + list = RiscosDiversos.Log(val); + } + else if (val.Vida != null) + { + list = Vida.Log(val); + } + break; + } + case 12: + list = JsonConvert.DeserializeObject(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log(); + break; + case 11: + { + Ramo ramo = JsonConvert.DeserializeObject(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao); + List list5 = (from x in Recursos.Coberturas + where x.IdRamo == ((DomainBase)ramo).Id + orderby x.Padrao descending, x.Descricao + select x).ToList(); + list = ramo.Log(list5); + break; + } + case 9: + list = JsonConvert.DeserializeObject(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log(); + break; + case 8: + list = JsonConvert.DeserializeObject(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log(); + break; + case 14: + list = JsonConvert.DeserializeObject(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log(); + break; + case 13: + list = JsonConvert.DeserializeObject(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log(); + break; + case 15: + list = JsonConvert.DeserializeObject(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log(); + break; + case 16: + list = JsonConvert.DeserializeObject(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log(); + break; + case 17: + list = JsonConvert.DeserializeObject(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log(); + break; + case 21: + list = JsonConvert.DeserializeObject(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log(); + break; + case 23: + list = JsonConvert.DeserializeObject(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log(); + break; + case 25: + list = JsonConvert.DeserializeObject(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log(); + break; + case 27: + list = JsonConvert.DeserializeObject(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log(); + break; + case 28: + list = JsonConvert.DeserializeObject(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log(); + break; + case 3: + list = JsonConvert.DeserializeObject(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log(); + break; + case 32: + list = JsonConvert.DeserializeObject(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log(); + break; + case 37: + list = JsonConvert.DeserializeObject(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log(); + break; + case 33: + list = JsonConvert.DeserializeObject(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log(); + break; + case 18: + list = JsonConvert.DeserializeObject(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log(); + break; + case 40: + list = JsonConvert.DeserializeObject(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log(); + break; + case 41: + list = JsonConvert.DeserializeObject(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log(); + break; + case 35: + list = JsonConvert.DeserializeObject(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log(); + break; + case 29: + list = JsonConvert.DeserializeObject(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log(); + break; + case 10: + list = JsonConvert.DeserializeObject(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log(); + break; + case 30: + list = JsonConvert.DeserializeObject(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log(); + break; + case 45: + list = JsonConvert.DeserializeObject(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log(); + break; + case 6: + list = JsonConvert.DeserializeObject(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log(); + break; + case 42: + { + List>>>>> list4 = JsonConvert.DeserializeObject>>>>>>(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao); + List list3 = new List(); + foreach (Tuple>>>> item in list4) + { + ObservableCollection> observableCollection = new ObservableCollection> + { + new Tuple(item.Item1 + "$", "", "") + }; + foreach (Tuple>> item2 in item.Item2) + { + observableCollection.Add(new Tuple(" " + item2.Item1 + "$", "", "")); + foreach (Tuple item3 in item2.Item2) + { + observableCollection.Add(new Tuple(" " + item3.Item1, item3.Item2, "")); + } + } + list3.Add(new TupleList + { + Tuples = observableCollection + }); + } + foreach (TupleList item4 in list3) + { + list.Add(item4); + } + break; + } + case 47: + list = JsonConvert.DeserializeObject(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log(); + break; + case 51: + list = JsonConvert.DeserializeObject(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log(); + break; + case 53: + list = JsonConvert.DeserializeObject(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log(); + break; + case 54: + list = JsonConvert.DeserializeObject(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log(); + break; + case 55: + list = JsonConvert.DeserializeObject(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log(); + break; + case 44: + { + List list2 = JsonConvert.DeserializeObject>(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao); + List list3 = new List(); + ObservableCollection> observableCollection = new ObservableCollection> + { + new Tuple("VENDEDORES VINCULADOS$", "", "") + }; + foreach (Vendedor item5 in list2) + { + observableCollection.Add(new Tuple($" VENDEDOR {list2.IndexOf(item5) + 1}", item5.Nome, "")); + } + list3.Add(new TupleList + { + Tuples = observableCollection + }); + foreach (TupleList item6 in list3) + { + list.Add(item6); + } + break; + } + case 5: + case 7: + case 19: + case 20: + case 22: + case 24: + case 26: + case 31: + case 34: + case 38: + case 39: + case 43: + case 46: + case 48: + case 49: + case 50: + case 52: + break; + } + } + catch (Exception) + { + } + ObservableCollection observableCollection2 = new ObservableCollection(); + foreach (TupleList item7 in listAtual) + { + int num = -1; + if (list.Count - 1 < listAtual.IndexOf(item7)) + { + continue; + } + for (int i = 0; i < item7.Tuples.Count; i++) + { + Tuple tuple = item7.Tuples[i]; + if (QntEspaco(tuple.Item1) == 0) + { + if (tuple.Item2 != list[listAtual.IndexOf(item7)].Tuples[item7.Tuples.IndexOf(tuple)].Item2) + { + if (num < listAtual.IndexOf(item7)) + { + observableCollection2.Add(new TupleList + { + Tuples = new ObservableCollection>() + }); + num = listAtual.IndexOf(item7); + } + observableCollection2.Last().Tuples.Add(new Tuple(tuple.Item1, tuple.Item2, list[listAtual.IndexOf(item7)].Tuples[item7.Tuples.IndexOf(tuple)].Item2)); + } + continue; + } + List list6 = new List(); + int num2 = QntEspaco(tuple.Item1); + for (int num3 = i; num3 >= 0; num3--) + { + if (QntEspaco(item7.Tuples[num3].Item1) <= num2) + { + list6.Insert(0, item7.Tuples[num3].Item1); + num2 = QntEspaco(item7.Tuples[num3].Item1); + } + } + bool flag = false; + int num4 = 0; + foreach (string item8 in list6) + { + if (flag) + { + break; + } + for (int j = num4; j < list[listAtual.IndexOf(item7)].Tuples.Count; j++) + { + if (j == list[listAtual.IndexOf(item7)].Tuples.Count - 1 && item8 != list[listAtual.IndexOf(item7)].Tuples[j].Item1) + { + flag = true; + break; + } + if (item8 == list[listAtual.IndexOf(item7)].Tuples[j].Item1) + { + num4 = j; + break; + } + } + } + if (flag || !(tuple.Item2 != list[listAtual.IndexOf(item7)].Tuples[num4].Item2)) + { + continue; + } + if (num < listAtual.IndexOf(item7)) + { + observableCollection2.Add(new TupleList + { + Tuples = new ObservableCollection>() + }); + num = listAtual.IndexOf(item7); + } + int count = observableCollection2.Last().Tuples.Count; + int num5 = QntEspaco(tuple.Item1); + for (int num6 = i - 1; num6 >= 0; num6--) + { + if (QntEspaco(item7.Tuples[num6].Item1) < QntEspaco(tuple.Item1) && QntEspaco(item7.Tuples[num6].Item1) < num5) + { + bool flag2 = false; + for (int num7 = observableCollection2.Last().Tuples.Count - 1; num7 >= 0; num7--) + { + if (observableCollection2.Last().Tuples[num7].Item1 == item7.Tuples[num6].Item1) + { + flag2 = true; + break; + } + } + if (flag2) + { + break; + } + num5 = QntEspaco(item7.Tuples[num6].Item1); + observableCollection2.Last().Tuples.Insert(count, new Tuple(item7.Tuples[num6].Item1, item7.Tuples[num6].Item2, "")); + } + } + observableCollection2.Last().Tuples.Add(new Tuple(tuple.Item1, tuple.Item2, list[listAtual.IndexOf(item7)].Tuples[num4].Item2)); + } + } + ListsAlterados = ((observableCollection2.Count == 0) ? null : observableCollection2); + observableCollection2 = new ObservableCollection(); + foreach (TupleList item9 in listAtual) + { + int num8 = -1; + if (list.Count - 1 < listAtual.IndexOf(item9)) + { + continue; + } + for (int k = 0; k < item9.Tuples.Count; k++) + { + Tuple tuple2 = item9.Tuples[k]; + if (QntEspaco(tuple2.Item1) <= 0) + { + continue; + } + List list7 = new List(); + int num9 = QntEspaco(tuple2.Item1); + for (int num10 = k; num10 >= 0; num10--) + { + if (QntEspaco(item9.Tuples[num10].Item1) <= num9) + { + list7.Insert(0, item9.Tuples[num10].Item1); + num9 = QntEspaco(item9.Tuples[num10].Item1); + } + } + bool flag3 = false; + int num11 = 0; + foreach (string item10 in list7) + { + if (flag3) + { + break; + } + for (int l = num11; l < list[listAtual.IndexOf(item9)].Tuples.Count; l++) + { + if (l == list[listAtual.IndexOf(item9)].Tuples.Count - 1 && item10 != list[listAtual.IndexOf(item9)].Tuples[l].Item1) + { + flag3 = true; + break; + } + if (item10 == list[listAtual.IndexOf(item9)].Tuples[l].Item1) + { + num11 = l; + break; + } + } + } + if (!flag3) + { + continue; + } + if (num8 < listAtual.IndexOf(item9)) + { + observableCollection2.Add(new TupleList + { + Tuples = new ObservableCollection>() + }); + num8 = listAtual.IndexOf(item9); + } + int count2 = observableCollection2.Last().Tuples.Count; + int num12 = QntEspaco(tuple2.Item1); + for (int num13 = k - 1; num13 >= 0; num13--) + { + if (QntEspaco(item9.Tuples[num13].Item1) < QntEspaco(tuple2.Item1) && QntEspaco(item9.Tuples[num13].Item1) < num12) + { + bool flag4 = false; + for (int num14 = observableCollection2.Last().Tuples.Count - 1; num14 >= 0; num14--) + { + if (observableCollection2.Last().Tuples[num14].Item1 == item9.Tuples[num13].Item1) + { + flag4 = true; + break; + } + } + if (flag4) + { + break; + } + num12 = QntEspaco(item9.Tuples[num13].Item1); + observableCollection2.Last().Tuples.Insert(count2, new Tuple(item9.Tuples[num13].Item1, item9.Tuples[num13].Item2, "")); + } + } + observableCollection2.Last().Tuples.Add(new Tuple(tuple2.Item1, tuple2.Item2, "")); + } + } + ListsAdicionados = ((observableCollection2.Count == 0) ? null : observableCollection2); + observableCollection2 = new ObservableCollection(); + foreach (TupleList item11 in list) + { + int num15 = -1; + for (int m = 0; m < item11.Tuples.Count; m++) + { + Tuple tuple3 = item11.Tuples[m]; + if (QntEspaco(tuple3.Item1) <= 0) + { + continue; + } + List list8 = new List(); + int num16 = QntEspaco(tuple3.Item1); + for (int num17 = m; num17 >= 0; num17--) + { + if (QntEspaco(item11.Tuples[num17].Item1) <= num16) + { + list8.Insert(0, item11.Tuples[num17].Item1); + num16 = QntEspaco(item11.Tuples[num17].Item1); + } + } + bool flag5 = false; + int num18 = 0; + foreach (string item12 in list8) + { + if (flag5) + { + break; + } + if (listAtual.Count - 1 < list.IndexOf(item11)) + { + continue; + } + for (int n = num18; n < listAtual[list.IndexOf(item11)].Tuples.Count; n++) + { + if (n == listAtual[list.IndexOf(item11)].Tuples.Count - 1 && item12 != listAtual[list.IndexOf(item11)].Tuples[n].Item1) + { + flag5 = true; + break; + } + if (item12 == listAtual[list.IndexOf(item11)].Tuples[n].Item1) + { + num18 = n; + break; + } + } + } + if (!flag5) + { + continue; + } + if (num15 < list.IndexOf(item11)) + { + observableCollection2.Add(new TupleList + { + Tuples = new ObservableCollection>() + }); + num15 = list.IndexOf(item11); + } + int count3 = observableCollection2.Last().Tuples.Count; + int num19 = QntEspaco(tuple3.Item1); + for (int num20 = m - 1; num20 >= 0; num20--) + { + if (QntEspaco(item11.Tuples[num20].Item1) < QntEspaco(tuple3.Item1) && QntEspaco(item11.Tuples[num20].Item1) < num19) + { + bool flag6 = false; + for (int num21 = observableCollection2.Last().Tuples.Count - 1; num21 >= 0; num21--) + { + if (observableCollection2.Last().Tuples[num21].Item1 == item11.Tuples[num20].Item1) + { + flag6 = true; + break; + } + } + if (flag6) + { + break; + } + num19 = QntEspaco(item11.Tuples[num20].Item1); + observableCollection2.Last().Tuples.Insert(count3, new Tuple(item11.Tuples[num20].Item1, item11.Tuples[num20].Item2, "")); + } + } + observableCollection2.Last().Tuples.Add(new Tuple(tuple3.Item1, "", tuple3.Item2)); + } + } + ListsRemovidos = ((observableCollection2.Count == 0) ? null : observableCollection2); + } + + private static int QntEspaco(string str) + { + return Regex.Match(str, "[^\\s]").Index; + } + + public void MostrarCampos() + { + if (SelectedLog != null && !SelectedLog.ModeloNovo) + { + Mostrar = !Mostrar; + Lists = Lists; + } + } + + public void Imprimir() + { + //IL_063c: Unknown result type (might be due to invalid IL or missing references) + //IL_0662: Unknown result type (might be due to invalid IL or missing references) + //IL_067d: Unknown result type (might be due to invalid IL or missing references) + string text = "LOGS
"; + ObservableCollection listsAlterados = ListsAlterados; + if (listsAlterados != null && listsAlterados.Count > 0) + { + text += "ALTERAÇÃO"; + } + if (ListsAlterados != null) + { + foreach (TupleList listsAlterado in ListsAlterados) + { + foreach (Tuple tuple in listsAlterado.Tuples) + { + if (tuple == listsAlterado.Tuples.First()) + { + text = text + ""; + if (!Mostrar) + { + text += ""; + } + text += "
DESCRIÇÃOVALOR LOG SELECIONADOVALOR LOG ANTERIOR
"; + } + bool flag = tuple.Item1.Contains("$"); + text = text + ""; + if (!Mostrar) + { + text = text + ""; + } + text += "
" + tuple.Item1.Replace(" ", " ").Replace("$", "") + "" + tuple.Item2 + "" + tuple.Item3 + "
"; + } + if (listsAlterado != ListsAlterados.Last()) + { + text += "
"; + } + } + } + ObservableCollection listsAdicionados = ListsAdicionados; + if (listsAdicionados != null && listsAdicionados.Count > 0) + { + ObservableCollection listsAlterados2 = ListsAlterados; + if (listsAlterados2 != null && listsAlterados2.Count > 0) + { + text += "


"; + } + text += "INCLUSÃO"; + } + if (ListsAdicionados != null) + { + foreach (TupleList listsAdicionado in ListsAdicionados) + { + foreach (Tuple tuple2 in listsAdicionado.Tuples) + { + if (tuple2 == listsAdicionado.Tuples.First()) + { + text = text + ""; + if (!Mostrar) + { + text += ""; + } + text += "
DESCRIÇÃOVALOR LOG SELECIONADOVALOR LOG ANTERIOR
"; + } + bool flag2 = tuple2.Item1.Contains("$"); + text = text + ""; + if (!Mostrar) + { + text = text + ""; + } + text += "
" + tuple2.Item1.Replace(" ", " ").Replace("$", "") + "" + tuple2.Item2 + "" + tuple2.Item3 + "
"; + } + if (listsAdicionado != ListsAdicionados.Last()) + { + text += "
"; + } + } + } + ObservableCollection listsRemovidos = ListsRemovidos; + if (listsRemovidos != null && listsRemovidos.Count > 0) + { + ObservableCollection listsAlterados3 = ListsAlterados; + if (listsAlterados3 == null || listsAlterados3.Count <= 0) + { + ObservableCollection listsAdicionados2 = ListsAdicionados; + if (listsAdicionados2 == null || listsAdicionados2.Count <= 0) + { + goto IL_0428; + } + } + text += "


"; + goto IL_0428; + } + goto IL_0434; + IL_0434: + if (ListsRemovidos != null) + { + foreach (TupleList listsRemovido in ListsRemovidos) + { + foreach (Tuple tuple3 in listsRemovido.Tuples) + { + if (tuple3 == listsRemovido.Tuples.First()) + { + text = text + ""; + if (!Mostrar) + { + text += ""; + } + text += "
DESCRIÇÃOVALOR LOG SELECIONADOVALOR LOG ANTERIOR
"; + } + bool flag3 = tuple3.Item1.Contains("$"); + text = text + ""; + if (!Mostrar) + { + text = text + ""; + } + text += "
" + tuple3.Item1.Replace(" ", " ").Replace("$", "") + "" + tuple3.Item2 + "" + tuple3.Item3 + "
"; + } + if (listsRemovido != ListsRemovidos.Last()) + { + text += "
"; + } + } + } + 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); + RegistrarAcao($"IMPRIMIU O LOG DE ALTERAÇÕES DE {Funcoes.GetDescription((Enum)(object)_tipoTela)} DO ID \"{_id}\"", _id, _tipoTela, $"ID ENTIDADE: {_id}\nTIPO: {Funcoes.GetDescription((Enum)(object)_tipoTela)}"); + return; + IL_0428: + text += "EXCLUSÃO"; + goto IL_0434; + } +} -- cgit v1.2.3