summaryrefslogtreecommitdiff
path: root/Decompiler/Gestor.Application.ViewModels.Drawer/LogViewModel.cs
diff options
context:
space:
mode:
authorLucas Faria Mendes <lucas.fariamo08@gmail.com>2026-03-30 15:29:41 +0000
committerLucas Faria Mendes <lucas.fariamo08@gmail.com>2026-03-30 15:29:41 +0000
commit225aa1499e37faf9d38257caabbadc68d78b427e (patch)
tree102bb7a40c58595348ae9d3c7076201759fe0720 /Decompiler/Gestor.Application.ViewModels.Drawer/LogViewModel.cs
parent1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1 (diff)
downloadgestor-225aa1499e37faf9d38257caabbadc68d78b427e.tar.gz
gestor-225aa1499e37faf9d38257caabbadc68d78b427e.zip
decompiler.com
Diffstat (limited to 'Decompiler/Gestor.Application.ViewModels.Drawer/LogViewModel.cs')
-rw-r--r--Decompiler/Gestor.Application.ViewModels.Drawer/LogViewModel.cs1458
1 files changed, 1458 insertions, 0 deletions
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<RegistroLog> _logs;
+
+ private string _currentDescription;
+
+ private RegistroLog _selectedLog;
+
+ private List<TupleList> _lists;
+
+ private ObservableCollection<TupleList> _listsAlterados;
+
+ private ObservableCollection<TupleList> _listsAdicionados;
+
+ private ObservableCollection<TupleList> _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<PackIconKind>)val).Kind = (PackIconKind)1492;
+ MostrarIcone = val;
+ }
+ else
+ {
+ MostrarColuna = 240L;
+ MostrarToolTip = "MOSTRAR TODOS OS CAMPOS";
+ PackIcon val2 = new PackIcon();
+ ((PackIconBase<PackIconKind>)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<RegistroLog> 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<TupleList> list = new List<TupleList>();
+ try
+ {
+ if (value.ModeloNovo)
+ {
+ TipoAcao acao = value.Acao;
+ switch ((int)acao)
+ {
+ case 0:
+ case 2:
+ list = JsonConvert.DeserializeObject<List<ValorOriginal>>(SelectedLog.Descricao).LogList(Restricao((TipoRestricao)14));
+ break;
+ case 1:
+ list = JsonConvert.DeserializeObject<List<Diferenca>>(SelectedLog.Descricao).LogList(Restricao((TipoRestricao)14));
+ break;
+ }
+ }
+ else
+ {
+ TipoTela tipoTela = _tipoTela;
+ switch (tipoTela - 1)
+ {
+ case 1:
+ list = JsonConvert.DeserializeObject<Documento>(SelectedLog.Descricao).Log(Restricao((TipoRestricao)14));
+ break;
+ case 4:
+ try
+ {
+ list = JsonConvert.DeserializeObject<Parcelas>(SelectedLog.Descricao).Log(Restricao((TipoRestricao)14), Restricao((TipoRestricao)95));
+ }
+ catch
+ {
+ list = DefaultLog(SelectedLog.Descricao, SelectedLog.Acao);
+ }
+ break;
+ case 36:
+ list = JsonConvert.DeserializeObject<VendedorParcelas>(SelectedLog.Descricao).Log(Restricao((TipoRestricao)14), Restricao((TipoRestricao)95));
+ break;
+ case 0:
+ list = JsonConvert.DeserializeObject<Cliente>(SelectedLog.Descricao).Log();
+ break;
+ case 2:
+ {
+ Item val = JsonConvert.DeserializeObject<Item>(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<Seguradora>(SelectedLog.Descricao).Log();
+ break;
+ case 11:
+ {
+ Ramo ramo = JsonConvert.DeserializeObject<Ramo>(SelectedLog.Descricao);
+ List<CoberturaPadrao> list5 = (from x in Recursos.Coberturas
+ where x.IdRamo == ((DomainBase)ramo).Id
+ orderby x.Padrao descending, x.Descricao
+ select x).ToList();
+ list = JsonConvert.DeserializeObject<Ramo>(SelectedLog.Descricao).Log(list5);
+ break;
+ }
+ case 9:
+ list = JsonConvert.DeserializeObject<Produto>(SelectedLog.Descricao).Log();
+ break;
+ case 8:
+ list = JsonConvert.DeserializeObject<Estipulante>(SelectedLog.Descricao).Log();
+ break;
+ case 14:
+ list = JsonConvert.DeserializeObject<Vendedor>(SelectedLog.Descricao).Log();
+ break;
+ case 13:
+ list = JsonConvert.DeserializeObject<TipoVendedor>(SelectedLog.Descricao).Log();
+ break;
+ case 15:
+ list = JsonConvert.DeserializeObject<Usuario>(SelectedLog.Descricao).Log();
+ break;
+ case 16:
+ list = JsonConvert.DeserializeObject<Credencial>(SelectedLog.Descricao).Log();
+ break;
+ case 17:
+ list = JsonConvert.DeserializeObject<Empresa>(SelectedLog.Descricao).Log();
+ break;
+ case 21:
+ list = JsonConvert.DeserializeObject<Parceiro>(SelectedLog.Descricao).Log();
+ break;
+ case 23:
+ list = JsonConvert.DeserializeObject<Fornecedor>(SelectedLog.Descricao).Log();
+ break;
+ case 25:
+ list = JsonConvert.DeserializeObject<BancosContas>(SelectedLog.Descricao).Log();
+ break;
+ case 27:
+ list = JsonConvert.DeserializeObject<Planos>(SelectedLog.Descricao).Log();
+ break;
+ case 28:
+ list = JsonConvert.DeserializeObject<Centro>(SelectedLog.Descricao).Log();
+ break;
+ case 3:
+ list = JsonConvert.DeserializeObject<Trilha>(SelectedLog.Descricao).Log();
+ break;
+ case 32:
+ list = JsonConvert.DeserializeObject<Prospeccao>(SelectedLog.Descricao).Log();
+ break;
+ case 37:
+ list = JsonConvert.DeserializeObject<Tarefa>(SelectedLog.Descricao).Log();
+ break;
+ case 33:
+ list = JsonConvert.DeserializeObject<Agenda>(SelectedLog.Descricao).Log();
+ break;
+ case 18:
+ list = JsonConvert.DeserializeObject<Socio>(SelectedLog.Descricao).Log();
+ break;
+ case 40:
+ list = JsonConvert.DeserializeObject<TrocaCliente>(SelectedLog.Descricao).Log();
+ break;
+ case 41:
+ list = JsonConvert.DeserializeObject<Recibo>(SelectedLog.Descricao).Log();
+ break;
+ case 35:
+ list = JsonConvert.DeserializeObject<Adiantamento>(SelectedLog.Descricao).Log();
+ break;
+ case 29:
+ list = JsonConvert.DeserializeObject<MetaVendedor>(SelectedLog.Descricao).Log();
+ break;
+ case 10:
+ list = JsonConvert.DeserializeObject<Status>(SelectedLog.Descricao).Log();
+ break;
+ case 30:
+ list = JsonConvert.DeserializeObject<MetaSeguradora>(SelectedLog.Descricao).Log();
+ break;
+ case 45:
+ list = JsonConvert.DeserializeObject<Expedicao>(SelectedLog.Descricao).Log();
+ break;
+ case 6:
+ list = JsonConvert.DeserializeObject<Sinistro>(SelectedLog.Descricao).Log();
+ break;
+ case 42:
+ {
+ List<Tuple<string, List<Tuple<string, List<Tuple<string, string>>>>>> list4 = JsonConvert.DeserializeObject<List<Tuple<string, List<Tuple<string, List<Tuple<string, string>>>>>>>(SelectedLog.Descricao);
+ List<TupleList> list3 = new List<TupleList>();
+ foreach (Tuple<string, List<Tuple<string, List<Tuple<string, string>>>>> item in list4)
+ {
+ ObservableCollection<Tuple<string, string, string>> observableCollection = new ObservableCollection<Tuple<string, string, string>>
+ {
+ new Tuple<string, string, string>(item.Item1 + "$", "", "")
+ };
+ foreach (Tuple<string, List<Tuple<string, string>>> item2 in item.Item2)
+ {
+ observableCollection.Add(new Tuple<string, string, string>(" " + item2.Item1 + "$", "", ""));
+ foreach (Tuple<string, string> item3 in item2.Item2)
+ {
+ observableCollection.Add(new Tuple<string, string, string>(" " + item3.Item1, item3.Item2, ""));
+ }
+ }
+ list3.Add(new TupleList
+ {
+ Tuples = observableCollection
+ });
+ }
+ foreach (TupleList item4 in list3)
+ {
+ list.Add(item4);
+ }
+ break;
+ }
+ case 47:
+ list = JsonConvert.DeserializeObject<Qualificacao>(SelectedLog.Descricao).Log();
+ break;
+ case 51:
+ list = JsonConvert.DeserializeObject<TipoDeTarefa>(SelectedLog.Descricao).Log();
+ break;
+ case 53:
+ list = JsonConvert.DeserializeObject<Repasse>(SelectedLog.Descricao).Log();
+ break;
+ case 54:
+ list = JsonConvert.DeserializeObject<NotaFiscal>(SelectedLog.Descricao).Log();
+ break;
+ case 55:
+ list = JsonConvert.DeserializeObject<Imposto>(SelectedLog.Descricao).Log();
+ break;
+ case 44:
+ {
+ List<Vendedor> list2 = JsonConvert.DeserializeObject<List<Vendedor>>(SelectedLog.Descricao);
+ List<TupleList> list3 = new List<TupleList>();
+ ObservableCollection<Tuple<string, string, string>> observableCollection = new ObservableCollection<Tuple<string, string, string>>
+ {
+ new Tuple<string, string, string>("VENDEDORES VINCULADOS$", "", "")
+ };
+ foreach (Vendedor item5 in list2)
+ {
+ observableCollection.Add(new Tuple<string, string, string>($" 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<TupleList> Lists
+ {
+ get
+ {
+ return _lists;
+ }
+ set
+ {
+ _lists = value;
+ SetListaFiltrada(value);
+ OnPropertyChanged("Lists");
+ }
+ }
+
+ public ObservableCollection<TupleList> ListsAlterados
+ {
+ get
+ {
+ return _listsAlterados;
+ }
+ set
+ {
+ _listsAlterados = value;
+ OnPropertyChanged("ListsAlterados");
+ }
+ }
+
+ public ObservableCollection<TupleList> ListsAdicionados
+ {
+ get
+ {
+ return _listsAdicionados;
+ }
+ set
+ {
+ _listsAdicionados = value;
+ OnPropertyChanged("ListsAdicionados");
+ }
+ }
+
+ public ObservableCollection<TupleList> 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<long> 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<PackIconKind>)val).Kind = (PackIconKind)1497;
+ _mostrarIcone = val;
+ _logs = new ObservableCollection<RegistroLog>();
+ _currentDescription = "";
+ _lists = new List<TupleList>();
+ _listsAlterados = new ObservableCollection<TupleList>();
+ _listsAdicionados = new ObservableCollection<TupleList>();
+ _listsRemovidos = new ObservableCollection<TupleList>();
+ _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<TupleList> 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<TupleList>
+ {
+ new TupleList
+ {
+ Tuples = new ObservableCollection<Tuple<string, string, string>>
+ {
+ new Tuple<string, string, string>(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<long> parcelas, int numparcela)
+ {
+ Loading(isLoading: true);
+ List<long> list = new List<long>();
+ list.AddRange(parcelas);
+ list.Add(documento);
+ Logs = new ObservableCollection<RegistroLog>(await _servico.BuscaLogParcelas(list));
+ ObservableCollection<RegistroLog> observableCollection = new ObservableCollection<RegistroLog>();
+ List<RegistroLog> list2 = Logs.Where((RegistroLog x) => !x.ModeloNovo && x.EntidadeId == documento).ToList();
+ for (int num = list2.Count - 1; num >= 0; num--)
+ {
+ ObservableCollection<Parcela> observableCollection2 = new ObservableCollection<Parcela>();
+ try
+ {
+ int num2 = num;
+ while (num2 >= 0 && list2[num2].DataHora < list2[num].DataHora.AddSeconds(4.0))
+ {
+ Parcela val = JsonConvert.DeserializeObject<Parcela>(Logs[num2].Descricao);
+ if (val != null && (numparcela == 0 || BuscaNumeroParcela(Logs[num2].Descricao) == numparcela))
+ {
+ observableCollection2.Add(val);
+ }
+ num = num2;
+ num2--;
+ }
+ }
+ catch (Exception)
+ {
+ try
+ {
+ List<Parcela> list3 = JsonConvert.DeserializeObject<List<Parcela>>(Logs[num].Descricao);
+ if (list3 != null && (numparcela == 0 || BuscaNumeroParcela(Logs[num].Descricao) == numparcela))
+ {
+ ExtensionMethods.AddRange<Parcela>((ICollection<Parcela>)observableCollection2, (IEnumerable<Parcela>)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<Parcela>(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<RegistroLog> list4 = new List<RegistroLog>();
+ List<RegistroLog> 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<RegistroLog>((ICollection<RegistroLog>)Logs, (IEnumerable<RegistroLog>)list4);
+ if (Logs.Count > 0)
+ {
+ SelectedLog = Logs[0];
+ }
+ else
+ {
+ SetListaFiltrada(Lists);
+ }
+ Loading(isLoading: false);
+ }
+
+ private async void Seleciona(TipoTela tela, long id, List<long> 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<RegistroLog>(await _servico.FindByEntityId(tela, id));
+ if ((int)tela == 37)
+ {
+ ObservableCollection<RegistroLog> observableCollection = new ObservableCollection<RegistroLog>();
+ List<RegistroLog> list = Logs.Where((RegistroLog x) => !x.ModeloNovo).ToList();
+ for (int num = list.Count - 1; num >= 0; num--)
+ {
+ ObservableCollection<VendedorParcela> observableCollection2 = new ObservableCollection<VendedorParcela>();
+ int num2 = num;
+ while (num2 >= 0 && list[num2].DataHora < list[num].DataHora.AddSeconds(4.0))
+ {
+ observableCollection2.Add(JsonConvert.DeserializeObject<VendedorParcela>(list[num2].Descricao));
+ num = num2;
+ num2--;
+ }
+ observableCollection2 = new ObservableCollection<VendedorParcela>(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<RegistroLog> list2 = Logs.Where((RegistroLog x) => x.ModeloNovo).ToList();
+ Logs = observableCollection;
+ ExtensionMethods.AddRange<RegistroLog>((ICollection<RegistroLog>)Logs, (IEnumerable<RegistroLog>)list2);
+ }
+ if (Logs.Count > 0)
+ {
+ SelectedLog = Logs[0];
+ }
+ else
+ {
+ SetListaFiltrada(Lists);
+ }
+ Loading(isLoading: false);
+ }
+
+ public void SetListaFiltrada(List<TupleList> 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<TupleList>(Lists);
+ MostrarMensagem = false;
+ return;
+ }
+ if (SelectedLog.ModeloNovo && (int)SelectedLog.Acao == 0)
+ {
+ TextAdicoes = "INCLUSÕES";
+ ListsAlterados = null;
+ ListsRemovidos = null;
+ ListsAdicionados = new ObservableCollection<TupleList>(listAtual);
+ MostrarMensagem = false;
+ return;
+ }
+ if (SelectedLog.ModeloNovo && (int)SelectedLog.Acao == 2)
+ {
+ TextAdicoes = "EXCLUSÕES";
+ ListsAlterados = null;
+ ListsAdicionados = null;
+ ListsRemovidos = new ObservableCollection<TupleList>(listAtual);
+ MostrarMensagem = false;
+ return;
+ }
+ if (Mostrar || Logs.Last() == SelectedLog)
+ {
+ TextAdicoes = ((Logs.Last() != SelectedLog) ? "LOG COMPLETO" : "INCLUSÃO");
+ ListsAlterados = null;
+ ListsAdicionados = new ObservableCollection<TupleList>(listAtual);
+ ListsRemovidos = null;
+ return;
+ }
+ TextAdicoes = "INCLUSÃO";
+ List<TupleList> list = new List<TupleList>();
+ try
+ {
+ TipoTela tipoTela = _tipoTela;
+ switch (tipoTela - 1)
+ {
+ case 1:
+ list = JsonConvert.DeserializeObject<Documento>(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log(Restricao((TipoRestricao)14));
+ break;
+ case 4:
+ list = JsonConvert.DeserializeObject<Parcelas>(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log(Restricao((TipoRestricao)14), Restricao((TipoRestricao)95));
+ break;
+ case 36:
+ list = JsonConvert.DeserializeObject<VendedorParcelas>(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log(Restricao((TipoRestricao)14), Restricao((TipoRestricao)95));
+ break;
+ case 0:
+ list = JsonConvert.DeserializeObject<Cliente>(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log();
+ break;
+ case 2:
+ {
+ Item val = JsonConvert.DeserializeObject<Item>(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<Seguradora>(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log();
+ break;
+ case 11:
+ {
+ Ramo ramo = JsonConvert.DeserializeObject<Ramo>(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao);
+ List<CoberturaPadrao> 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<Produto>(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log();
+ break;
+ case 8:
+ list = JsonConvert.DeserializeObject<Estipulante>(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log();
+ break;
+ case 14:
+ list = JsonConvert.DeserializeObject<Vendedor>(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log();
+ break;
+ case 13:
+ list = JsonConvert.DeserializeObject<TipoVendedor>(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log();
+ break;
+ case 15:
+ list = JsonConvert.DeserializeObject<Usuario>(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log();
+ break;
+ case 16:
+ list = JsonConvert.DeserializeObject<Credencial>(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log();
+ break;
+ case 17:
+ list = JsonConvert.DeserializeObject<Empresa>(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log();
+ break;
+ case 21:
+ list = JsonConvert.DeserializeObject<Parceiro>(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log();
+ break;
+ case 23:
+ list = JsonConvert.DeserializeObject<Fornecedor>(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log();
+ break;
+ case 25:
+ list = JsonConvert.DeserializeObject<BancosContas>(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log();
+ break;
+ case 27:
+ list = JsonConvert.DeserializeObject<Planos>(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log();
+ break;
+ case 28:
+ list = JsonConvert.DeserializeObject<Centro>(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log();
+ break;
+ case 3:
+ list = JsonConvert.DeserializeObject<Trilha>(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log();
+ break;
+ case 32:
+ list = JsonConvert.DeserializeObject<Prospeccao>(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log();
+ break;
+ case 37:
+ list = JsonConvert.DeserializeObject<Tarefa>(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log();
+ break;
+ case 33:
+ list = JsonConvert.DeserializeObject<Agenda>(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log();
+ break;
+ case 18:
+ list = JsonConvert.DeserializeObject<Socio>(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log();
+ break;
+ case 40:
+ list = JsonConvert.DeserializeObject<TrocaCliente>(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log();
+ break;
+ case 41:
+ list = JsonConvert.DeserializeObject<Recibo>(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log();
+ break;
+ case 35:
+ list = JsonConvert.DeserializeObject<Adiantamento>(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log();
+ break;
+ case 29:
+ list = JsonConvert.DeserializeObject<MetaVendedor>(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log();
+ break;
+ case 10:
+ list = JsonConvert.DeserializeObject<Status>(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log();
+ break;
+ case 30:
+ list = JsonConvert.DeserializeObject<MetaSeguradora>(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log();
+ break;
+ case 45:
+ list = JsonConvert.DeserializeObject<Expedicao>(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log();
+ break;
+ case 6:
+ list = JsonConvert.DeserializeObject<Sinistro>(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log();
+ break;
+ case 42:
+ {
+ List<Tuple<string, List<Tuple<string, List<Tuple<string, string>>>>>> list4 = JsonConvert.DeserializeObject<List<Tuple<string, List<Tuple<string, List<Tuple<string, string>>>>>>>(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao);
+ List<TupleList> list3 = new List<TupleList>();
+ foreach (Tuple<string, List<Tuple<string, List<Tuple<string, string>>>>> item in list4)
+ {
+ ObservableCollection<Tuple<string, string, string>> observableCollection = new ObservableCollection<Tuple<string, string, string>>
+ {
+ new Tuple<string, string, string>(item.Item1 + "$", "", "")
+ };
+ foreach (Tuple<string, List<Tuple<string, string>>> item2 in item.Item2)
+ {
+ observableCollection.Add(new Tuple<string, string, string>(" " + item2.Item1 + "$", "", ""));
+ foreach (Tuple<string, string> item3 in item2.Item2)
+ {
+ observableCollection.Add(new Tuple<string, string, string>(" " + item3.Item1, item3.Item2, ""));
+ }
+ }
+ list3.Add(new TupleList
+ {
+ Tuples = observableCollection
+ });
+ }
+ foreach (TupleList item4 in list3)
+ {
+ list.Add(item4);
+ }
+ break;
+ }
+ case 47:
+ list = JsonConvert.DeserializeObject<Qualificacao>(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log();
+ break;
+ case 51:
+ list = JsonConvert.DeserializeObject<TipoDeTarefa>(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log();
+ break;
+ case 53:
+ list = JsonConvert.DeserializeObject<Repasse>(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log();
+ break;
+ case 54:
+ list = JsonConvert.DeserializeObject<NotaFiscal>(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log();
+ break;
+ case 55:
+ list = JsonConvert.DeserializeObject<Imposto>(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao).Log();
+ break;
+ case 44:
+ {
+ List<Vendedor> list2 = JsonConvert.DeserializeObject<List<Vendedor>>(Logs[Logs.IndexOf(SelectedLog) + 1].Descricao);
+ List<TupleList> list3 = new List<TupleList>();
+ ObservableCollection<Tuple<string, string, string>> observableCollection = new ObservableCollection<Tuple<string, string, string>>
+ {
+ new Tuple<string, string, string>("VENDEDORES VINCULADOS$", "", "")
+ };
+ foreach (Vendedor item5 in list2)
+ {
+ observableCollection.Add(new Tuple<string, string, string>($" 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<TupleList> observableCollection2 = new ObservableCollection<TupleList>();
+ 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<string, string, string> 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<Tuple<string, string, string>>()
+ });
+ num = listAtual.IndexOf(item7);
+ }
+ observableCollection2.Last().Tuples.Add(new Tuple<string, string, string>(tuple.Item1, tuple.Item2, list[listAtual.IndexOf(item7)].Tuples[item7.Tuples.IndexOf(tuple)].Item2));
+ }
+ continue;
+ }
+ List<string> list6 = new List<string>();
+ 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<Tuple<string, string, string>>()
+ });
+ 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<string, string, string>(item7.Tuples[num6].Item1, item7.Tuples[num6].Item2, ""));
+ }
+ }
+ observableCollection2.Last().Tuples.Add(new Tuple<string, string, string>(tuple.Item1, tuple.Item2, list[listAtual.IndexOf(item7)].Tuples[num4].Item2));
+ }
+ }
+ ListsAlterados = ((observableCollection2.Count == 0) ? null : observableCollection2);
+ observableCollection2 = new ObservableCollection<TupleList>();
+ 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<string, string, string> tuple2 = item9.Tuples[k];
+ if (QntEspaco(tuple2.Item1) <= 0)
+ {
+ continue;
+ }
+ List<string> list7 = new List<string>();
+ 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<Tuple<string, string, string>>()
+ });
+ 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<string, string, string>(item9.Tuples[num13].Item1, item9.Tuples[num13].Item2, ""));
+ }
+ }
+ observableCollection2.Last().Tuples.Add(new Tuple<string, string, string>(tuple2.Item1, tuple2.Item2, ""));
+ }
+ }
+ ListsAdicionados = ((observableCollection2.Count == 0) ? null : observableCollection2);
+ observableCollection2 = new ObservableCollection<TupleList>();
+ foreach (TupleList item11 in list)
+ {
+ int num15 = -1;
+ for (int m = 0; m < item11.Tuples.Count; m++)
+ {
+ Tuple<string, string, string> tuple3 = item11.Tuples[m];
+ if (QntEspaco(tuple3.Item1) <= 0)
+ {
+ continue;
+ }
+ List<string> list8 = new List<string>();
+ 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<Tuple<string, string, string>>()
+ });
+ 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<string, string, string>(item11.Tuples[num20].Item1, item11.Tuples[num20].Item2, ""));
+ }
+ }
+ observableCollection2.Last().Tuples.Add(new Tuple<string, string, string>(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 = "<html><head><style type='text/css'>@page{size: A4; margin: 0cm}</style><title>LOGS</title></head><body><div align='center'>";
+ ObservableCollection<TupleList> listsAlterados = ListsAlterados;
+ if (listsAlterados != null && listsAlterados.Count > 0)
+ {
+ text += "<font size='5px' face='Arial' style='font-weight: 900;'>ALTERAÇÃO</font>";
+ }
+ if (ListsAlterados != null)
+ {
+ foreach (TupleList listsAlterado in ListsAlterados)
+ {
+ foreach (Tuple<string, string, string> tuple in listsAlterado.Tuples)
+ {
+ if (tuple == listsAlterado.Tuples.First())
+ {
+ text = text + "<table border='1' style='border-collapse: collapse; page-break-inside: avoid'><tr style='height: 45px;'><td style='width: 220px; text-align: center;'><font size='3px' face='Arial' style='font-weight: 700;'>DESCRIÇÃO</font></td><td style='width: " + (Mostrar ? "483px" : "240px") + "; text-align: center;'><font size='3px' face='Arial' style='font-weight: 700'>VALOR LOG SELECIONADO</font></td>";
+ if (!Mostrar)
+ {
+ text += "<td style='width: 240px; text-align: center;'><font size='3px' face='Arial' style='font-weight: 700'>VALOR LOG ANTERIOR</font></td>";
+ }
+ text += "</tr></table>";
+ }
+ bool flag = tuple.Item1.Contains("$");
+ text = text + "<table border='1' style='border-collapse: collapse; page-break-inside: avoid; border-TOP: none'><tr style='height: 30px;'><td style='width: 220px'><font size='2px' face='Arial' style='font-weight: " + (flag ? "900" : "700") + "; padding-left: 5px'>" + tuple.Item1.Replace(" ", "&nbsp;").Replace("$", "") + "</font></td><td style='width: " + (Mostrar ? "483px" : "240px") + "'><font size='2px' face='Arial' style='padding-left: 5px'>" + tuple.Item2 + "</font></td>";
+ if (!Mostrar)
+ {
+ text = text + "<td style='width: 240px'><font size='2px' face='Arial' style='padding-left: 5px'>" + tuple.Item3 + "</font></td>";
+ }
+ text += "</tr></table>";
+ }
+ if (listsAlterado != ListsAlterados.Last())
+ {
+ text += "<br>";
+ }
+ }
+ }
+ ObservableCollection<TupleList> listsAdicionados = ListsAdicionados;
+ if (listsAdicionados != null && listsAdicionados.Count > 0)
+ {
+ ObservableCollection<TupleList> listsAlterados2 = ListsAlterados;
+ if (listsAlterados2 != null && listsAlterados2.Count > 0)
+ {
+ text += "<br><br><br>";
+ }
+ text += "<font size='5px' face='Arial' style='font-weight: 900;'>INCLUSÃO</font>";
+ }
+ if (ListsAdicionados != null)
+ {
+ foreach (TupleList listsAdicionado in ListsAdicionados)
+ {
+ foreach (Tuple<string, string, string> tuple2 in listsAdicionado.Tuples)
+ {
+ if (tuple2 == listsAdicionado.Tuples.First())
+ {
+ text = text + "<table border='1' style='border-collapse: collapse; page-break-inside: avoid'><tr style='height: 45px;'><td style='width: 220px; text-align: center;'><font size='3px' face='Arial' style='font-weight: 700;'>DESCRIÇÃO</font></td><td style='width: " + (Mostrar ? "483px" : "240px") + "; text-align: center;'><font size='3px' face='Arial' style='font-weight: 700'>VALOR LOG SELECIONADO</font></td>";
+ if (!Mostrar)
+ {
+ text += "<td style='width: 240px; text-align: center;'><font size='3px' face='Arial' style='font-weight: 700'>VALOR LOG ANTERIOR</font></td>";
+ }
+ text += "</tr></table>";
+ }
+ bool flag2 = tuple2.Item1.Contains("$");
+ text = text + "<table border='1' style='border-collapse: collapse; page-break-inside: avoid; border-TOP: none'><tr style='height: 30px;'><td style='width: 220px'><font size='2px' face='Arial' style='font-weight: " + (flag2 ? "900" : "700") + "; padding-left: 5px'>" + tuple2.Item1.Replace(" ", "&nbsp;").Replace("$", "") + "</font></td><td style='width: " + (Mostrar ? "483px" : "240px") + "'><font size='2px' face='Arial' style='padding-left: 5px'>" + tuple2.Item2 + "</font></td>";
+ if (!Mostrar)
+ {
+ text = text + "<td style='width: 240px'><font size='2px' face='Arial' style='padding-left: 5px'>" + tuple2.Item3 + "</font></td>";
+ }
+ text += "</tr></table>";
+ }
+ if (listsAdicionado != ListsAdicionados.Last())
+ {
+ text += "<br>";
+ }
+ }
+ }
+ ObservableCollection<TupleList> listsRemovidos = ListsRemovidos;
+ if (listsRemovidos != null && listsRemovidos.Count > 0)
+ {
+ ObservableCollection<TupleList> listsAlterados3 = ListsAlterados;
+ if (listsAlterados3 == null || listsAlterados3.Count <= 0)
+ {
+ ObservableCollection<TupleList> listsAdicionados2 = ListsAdicionados;
+ if (listsAdicionados2 == null || listsAdicionados2.Count <= 0)
+ {
+ goto IL_0428;
+ }
+ }
+ text += "<br><br><br>";
+ goto IL_0428;
+ }
+ goto IL_0434;
+ IL_0434:
+ if (ListsRemovidos != null)
+ {
+ foreach (TupleList listsRemovido in ListsRemovidos)
+ {
+ foreach (Tuple<string, string, string> tuple3 in listsRemovido.Tuples)
+ {
+ if (tuple3 == listsRemovido.Tuples.First())
+ {
+ text = text + "<table border='1' style='border-collapse: collapse; page-break-inside: avoid'><tr style='height: 45px;'><td style='width: 220px; text-align: center;'><font size='3px' face='Arial' style='font-weight: 700;'>DESCRIÇÃO</font></td><td style='width: " + (Mostrar ? "483px" : "240px") + "; text-align: center;'><font size='3px' face='Arial' style='font-weight: 700'>VALOR LOG SELECIONADO</font></td>";
+ if (!Mostrar)
+ {
+ text += "<td style='width: 240px; text-align: center;'><font size='3px' face='Arial' style='font-weight: 700'>VALOR LOG ANTERIOR</font></td>";
+ }
+ text += "</tr></table>";
+ }
+ bool flag3 = tuple3.Item1.Contains("$");
+ text = text + "<table border='1' style='border-collapse: collapse; page-break-inside: avoid; border-TOP: none'><tr style='height: 30px;'><td style='width: 220px'><font size='2px' face='Arial' style='font-weight: " + (flag3 ? "900" : "700") + "; padding-left: 5px'>" + tuple3.Item1.Replace(" ", "&nbsp;").Replace("$", "") + "</font></td><td style='width: " + (Mostrar ? "483px" : "240px") + "'><font size='2px' face='Arial' style='padding-left: 5px'>" + tuple3.Item2 + "</font></td>";
+ if (!Mostrar)
+ {
+ text = text + "<td style='width: 240px'><font size='2px' face='Arial' style='padding-left: 5px'>" + tuple3.Item3 + "</font></td>";
+ }
+ text += "</tr></table>";
+ }
+ if (listsRemovido != ListsRemovidos.Last())
+ {
+ text += "<br>";
+ }
+ }
+ }
+ text += "</div></body></html>";
+ 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 += "<font size='5px' face='Arial' style='font-weight: 900;'>EXCLUSÃO</font>";
+ goto IL_0434;
+ }
+}