summaryrefslogtreecommitdiff
path: root/Decompiler/Gestor.Application.Servicos/TarefaServico.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Decompiler/Gestor.Application.Servicos/TarefaServico.cs')
-rw-r--r--Decompiler/Gestor.Application.Servicos/TarefaServico.cs817
1 files changed, 817 insertions, 0 deletions
diff --git a/Decompiler/Gestor.Application.Servicos/TarefaServico.cs b/Decompiler/Gestor.Application.Servicos/TarefaServico.cs
new file mode 100644
index 0000000..6dd9c31
--- /dev/null
+++ b/Decompiler/Gestor.Application.Servicos/TarefaServico.cs
@@ -0,0 +1,817 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Net.Sockets;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Threading;
+using Gestor.Application.Actions;
+using Gestor.Application.Helpers;
+using Gestor.Application.Servicos.Generic;
+using Gestor.Application.ViewModels;
+using Gestor.Infrastructure.UnitOfWork.Generic;
+using Gestor.Infrastructure.UnitOfWork.Logic;
+using Gestor.Model.API;
+using Gestor.Model.Common;
+using Gestor.Model.Domain.Common;
+using Gestor.Model.Domain.Ferramentas;
+using Gestor.Model.Domain.Generic;
+using Newtonsoft.Json;
+
+namespace Gestor.Application.Servicos;
+
+public class TarefaServico : BaseServico
+{
+ public async Task<List<Tarefa>> BuscarTarefas(TipoTarefa entidade, long id, bool? concluido)
+ {
+ //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)
+ int tries = 3;
+ return await Task.Run(delegate
+ {
+ //IL_0045: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0010: Unknown result type (might be due to invalid IL or missing references)
+ while (tries > 0)
+ {
+ try
+ {
+ UnitOfWork read = Instancia.Read;
+ try
+ {
+ return read.TarefaRepository.BuscarTarefa(entidade, id, concluido);
+ }
+ finally
+ {
+ ((IDisposable)read)?.Dispose();
+ }
+ }
+ catch (Exception e)
+ {
+ tries = Registrar(e, (TipoErro)94, tries, new { entidade, id, concluido });
+ }
+ }
+ return new List<Tarefa>();
+ });
+ }
+
+ public async Task<Tarefa> Salvar(Tarefa tarefa)
+ {
+ int tries = 3;
+ base.Sucesso = true;
+ DateTime now = Funcoes.GetNetworkTime();
+ Tarefa tarefaOriginal = tarefa;
+ return await Task.Run((Func<Tarefa>)delegate
+ {
+ //IL_0028: Unknown result type (might be due to invalid IL or missing references)
+ //IL_002e: Invalid comparison between Unknown and I4
+ //IL_00ad: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00b2: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00b9: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00c4: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00d0: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00d7: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00dc: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00e8: Expected O, but got Unknown
+ //IL_00ed: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00fe: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0106: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0111: Unknown result type (might be due to invalid IL or missing references)
+ //IL_011c: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0127: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0164: Expected O, but got Unknown
+ while (tries > 0)
+ {
+ tarefa = tarefaOriginal;
+ try
+ {
+ UnitOfWork commited = Instancia.Commited;
+ try
+ {
+ CleanWebEditor(tarefa);
+ if ((int)tarefa.Entidade == 1)
+ {
+ tarefa.Descricao = ((!string.IsNullOrWhiteSpace(tarefa.Anotacoes)) ? tarefa.Anotacoes : tarefa.Descricao);
+ }
+ bool flag = ((DomainBase)tarefa).Id == 0;
+ tarefa = (flag ? commited.TarefaRepository.Salvar(tarefa) : commited.TarefaRepository.Atualizar(tarefa));
+ IPHostEntry hostEntry = Dns.GetHostEntry(Dns.GetHostName());
+ RegistroLog keyValues = new RegistroLog
+ {
+ Acao = (TipoAcao)1,
+ Usuario = Recursos.Usuario,
+ DataHora = now,
+ Descricao = JsonConvert.SerializeObject((object)tarefa, new JsonSerializerSettings
+ {
+ ReferenceLoopHandling = (ReferenceLoopHandling)1
+ }),
+ EntidadeId = ((DomainBase)tarefa).Id,
+ Tela = (TipoTela)38,
+ Versao = LoginViewModel.VersaoAtual,
+ NomeMaquina = Environment.MachineName,
+ UsuarioMaquina = Environment.UserName,
+ Ip = hostEntry.AddressList.FirstOrDefault((IPAddress ip) => ip.AddressFamily == AddressFamily.InterNetwork)?.ToString()
+ };
+ SaveLog(keyValues, commited);
+ ((GenericUnitOfWork)commited).Commit();
+ ((DispatcherObject)Application.Current).Dispatcher.Invoke((Action)delegate
+ {
+ Gestor.Application.Actions.Actions.AtualizaBadges();
+ });
+ return tarefa;
+ }
+ finally
+ {
+ ((IDisposable)commited)?.Dispose();
+ }
+ }
+ catch (Exception e)
+ {
+ tries = Registrar(e, (TipoErro)265, tries, tarefa);
+ }
+ }
+ return tarefaOriginal;
+ });
+ }
+
+ private static void CleanWebEditor(Tarefa tarefa)
+ {
+ if (tarefa.Descricao != null)
+ {
+ tarefa.Descricao = RemoveXml(tarefa.Descricao);
+ }
+ if (tarefa.DescricaoInterna != null)
+ {
+ tarefa.DescricaoInterna = RemoveXml(tarefa.DescricaoInterna);
+ }
+ }
+
+ public static string RemoveXml(string description)
+ {
+ try
+ {
+ List<string> list = new List<string>();
+ string[] array = description.Split(new char[1] { '<' });
+ foreach (string text in array)
+ {
+ if (text.Contains("?xml") || text.Contains("o:p"))
+ {
+ list.Add("<" + text);
+ }
+ }
+ foreach (string item in list)
+ {
+ description = description.Replace(item, "");
+ }
+ return description;
+ }
+ catch (Exception ex)
+ {
+ throw ex;
+ }
+ }
+
+ public async Task<Trilha> Salvar(Trilha trilha)
+ {
+ int tries = 3;
+ base.Sucesso = true;
+ DateTime now = Funcoes.GetNetworkTime();
+ Trilha trilhaOriginal = trilha;
+ return await Task.Run((Func<Trilha>)delegate
+ {
+ //IL_005f: 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)
+ //IL_006b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0076: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0082: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0089: Unknown result type (might be due to invalid IL or missing references)
+ //IL_008e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_009a: Expected O, but got Unknown
+ //IL_009f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00b0: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00b7: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00c2: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00cd: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00d8: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0115: Expected O, but got Unknown
+ while (tries > 0)
+ {
+ trilha = trilhaOriginal;
+ try
+ {
+ UnitOfWork commited = Instancia.Commited;
+ try
+ {
+ bool flag = ((DomainBase)trilha).Id == 0;
+ trilha = (flag ? commited.TarefaRepository.Salvar(trilha) : commited.TarefaRepository.Atualizar(trilha));
+ IPHostEntry hostEntry = Dns.GetHostEntry(Dns.GetHostName());
+ RegistroLog keyValues = new RegistroLog
+ {
+ Acao = (TipoAcao)1,
+ Usuario = Recursos.Usuario,
+ DataHora = now,
+ Descricao = JsonConvert.SerializeObject((object)trilha, new JsonSerializerSettings
+ {
+ ReferenceLoopHandling = (ReferenceLoopHandling)1
+ }),
+ EntidadeId = ((DomainBase)trilha).Id,
+ Tela = (TipoTela)4,
+ Versao = LoginViewModel.VersaoAtual,
+ NomeMaquina = Environment.MachineName,
+ UsuarioMaquina = Environment.UserName,
+ Ip = hostEntry.AddressList.FirstOrDefault((IPAddress ip) => ip.AddressFamily == AddressFamily.InterNetwork)?.ToString()
+ };
+ SaveLog(keyValues, commited);
+ ((GenericUnitOfWork)commited).Commit();
+ ((DispatcherObject)Application.Current).Dispatcher.Invoke((Action)delegate
+ {
+ Gestor.Application.Actions.Actions.AtualizaBadges();
+ });
+ return trilha;
+ }
+ finally
+ {
+ ((IDisposable)commited)?.Dispose();
+ }
+ }
+ catch (Exception e)
+ {
+ tries = Registrar(e, (TipoErro)267, tries, trilha);
+ }
+ }
+ return trilhaOriginal;
+ });
+ }
+
+ public async Task<bool> Excluir(long id)
+ {
+ int tries = 3;
+ return await Task.Run(delegate
+ {
+ while (tries > 0)
+ {
+ try
+ {
+ UnitOfWork commited = Instancia.Commited;
+ try
+ {
+ commited.TarefaRepository.Excluir(id);
+ ((GenericUnitOfWork)commited).Commit();
+ }
+ finally
+ {
+ ((IDisposable)commited)?.Dispose();
+ }
+ ((DispatcherObject)Application.Current).Dispatcher.Invoke((Action)delegate
+ {
+ Gestor.Application.Actions.Actions.AtualizaBadges();
+ });
+ return true;
+ }
+ catch (Exception e)
+ {
+ tries = Registrar(e, (TipoErro)268, tries, id);
+ }
+ }
+ return false;
+ });
+ }
+
+ public async Task<List<Tarefa>> BuscarTarefas(long id, DateTime inicio, DateTime fim, bool? concluido)
+ {
+ int tries = 3;
+ return await Task.Run(delegate
+ {
+ while (tries > 0)
+ {
+ try
+ {
+ UnitOfWork read = Instancia.Read;
+ try
+ {
+ return read.TarefaRepository.BuscarTarefaPorUsuario(id, inicio, fim, concluido);
+ }
+ finally
+ {
+ ((IDisposable)read)?.Dispose();
+ }
+ }
+ catch (Exception e)
+ {
+ tries = Registrar(e, (TipoErro)95, tries, new { id, inicio, fim, concluido });
+ }
+ }
+ return new List<Tarefa>();
+ });
+ }
+
+ public async Task<List<Tarefa>> BuscarTarefasCliente(long id)
+ {
+ int tries = 3;
+ return await Task.Run(delegate
+ {
+ while (tries > 0)
+ {
+ try
+ {
+ UnitOfWork read = Instancia.Read;
+ try
+ {
+ return read.TarefaRepository.BuscarTarefaPorCliente(id);
+ }
+ finally
+ {
+ ((IDisposable)read)?.Dispose();
+ }
+ }
+ catch (Exception e)
+ {
+ tries = Registrar(e, (TipoErro)96, tries, id);
+ }
+ }
+ return new List<Tarefa>();
+ });
+ }
+
+ public async Task<List<Tarefa>> BuscarNotas(long id)
+ {
+ int tries = 3;
+ return await Task.Run(delegate
+ {
+ while (tries > 0)
+ {
+ try
+ {
+ UnitOfWork read = Instancia.Read;
+ try
+ {
+ return read.TarefaRepository.BuscarTarefaPorUsuario(id, (TipoTarefa)1);
+ }
+ finally
+ {
+ ((IDisposable)read)?.Dispose();
+ }
+ }
+ catch (Exception e)
+ {
+ tries = Registrar(e, (TipoErro)98, tries, id);
+ }
+ }
+ return new List<Tarefa>();
+ });
+ }
+
+ public async Task<List<Tarefa>> BuscarNotasConcluidas(long id)
+ {
+ int tries = 3;
+ return await Task.Run(delegate
+ {
+ while (tries > 0)
+ {
+ try
+ {
+ UnitOfWork read = Instancia.Read;
+ try
+ {
+ return read.TarefaRepository.BuscarTarefaConcluidaPorUsuario(id, (TipoTarefa)1);
+ }
+ finally
+ {
+ ((IDisposable)read)?.Dispose();
+ }
+ }
+ catch (Exception e)
+ {
+ tries = Registrar(e, (TipoErro)99, tries, id);
+ }
+ }
+ return new List<Tarefa>();
+ });
+ }
+
+ public async Task<int[]> AtualizarNotasTarefas()
+ {
+ int tries = 3;
+ return await Task.Run(delegate
+ {
+ while (tries > 0)
+ {
+ try
+ {
+ UnitOfWork read = Instancia.Read;
+ try
+ {
+ return read.TarefaRepository.ContarTarefas(((DomainBase)Recursos.Usuario).Id);
+ }
+ finally
+ {
+ ((IDisposable)read)?.Dispose();
+ }
+ }
+ catch (Exception e)
+ {
+ tries = Registrar(e, (TipoErro)100, tries, ((DomainBase)Recursos.Usuario).Id);
+ }
+ }
+ return new int[1];
+ });
+ }
+
+ public async Task<List<Tarefa>> BuscarTarefas(long id)
+ {
+ int tries = 3;
+ return await Task.Run(delegate
+ {
+ while (tries > 0)
+ {
+ try
+ {
+ UnitOfWork read = Instancia.Read;
+ try
+ {
+ return read.TarefaRepository.BuscarTarefaPorTrilha(id);
+ }
+ finally
+ {
+ ((IDisposable)read)?.Dispose();
+ }
+ }
+ catch (Exception e)
+ {
+ tries = Registrar(e, (TipoErro)101, tries, id);
+ }
+ }
+ return new List<Tarefa>();
+ });
+ }
+
+ public async Task<List<Fase>> BuscarFases(long id)
+ {
+ int tries = 3;
+ return await Task.Run(delegate
+ {
+ while (tries > 0)
+ {
+ try
+ {
+ UnitOfWork read = Instancia.Read;
+ try
+ {
+ return read.TarefaRepository.BuscarFases(id);
+ }
+ finally
+ {
+ ((IDisposable)read)?.Dispose();
+ }
+ }
+ catch (Exception e)
+ {
+ tries = Registrar(e, (TipoErro)102, tries, id);
+ }
+ }
+ return new List<Fase>();
+ });
+ }
+
+ public async Task<List<Trilha>> BuscarTrilhas()
+ {
+ int tries = 3;
+ return await Task.Run(delegate
+ {
+ while (tries > 0)
+ {
+ try
+ {
+ UnitOfWork read = Instancia.Read;
+ try
+ {
+ return read.TarefaRepository.BuscarTrilhas(true);
+ }
+ finally
+ {
+ ((IDisposable)read)?.Dispose();
+ }
+ }
+ catch (Exception e)
+ {
+ tries = Registrar(e, (TipoErro)104, tries);
+ }
+ }
+ return new List<Trilha>();
+ });
+ }
+
+ public async Task<List<Fase>> Salvar(List<Fase> fases)
+ {
+ int tries = 3;
+ base.Sucesso = true;
+ DateTime now = Funcoes.GetNetworkTime();
+ List<Fase> fasesOriginal = fases;
+ return await Task.Run(delegate
+ {
+ //IL_0052: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0057: Unknown result type (might be due to invalid IL or missing references)
+ //IL_005e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0069: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0075: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0077: Unknown result type (might be due to invalid IL or missing references)
+ //IL_007c: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0088: Expected O, but got Unknown
+ //IL_008d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0099: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00a0: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00ab: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00b6: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00c1: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00ff: Expected O, but got Unknown
+ while (tries > 0)
+ {
+ fases = fasesOriginal;
+ try
+ {
+ UnitOfWork commited = Instancia.Commited;
+ try
+ {
+ fases = commited.TarefaRepository.Salvar(fases);
+ IPHostEntry hostEntry = Dns.GetHostEntry(Dns.GetHostName());
+ foreach (Fase fase in fases)
+ {
+ RegistroLog keyValues = new RegistroLog
+ {
+ Acao = (TipoAcao)1,
+ Usuario = Recursos.Usuario,
+ DataHora = now,
+ Descricao = JsonConvert.SerializeObject((object)fase, new JsonSerializerSettings
+ {
+ ReferenceLoopHandling = (ReferenceLoopHandling)1
+ }),
+ EntidadeId = ((DomainBase)fase).Id,
+ Tela = (TipoTela)4,
+ Versao = LoginViewModel.VersaoAtual,
+ NomeMaquina = Environment.MachineName,
+ UsuarioMaquina = Environment.UserName,
+ Ip = hostEntry.AddressList.FirstOrDefault((IPAddress ip) => ip.AddressFamily == AddressFamily.InterNetwork)?.ToString()
+ };
+ SaveLog(keyValues, commited);
+ }
+ ((GenericUnitOfWork)commited).Commit();
+ ((DispatcherObject)Application.Current).Dispatcher.Invoke((Action)delegate
+ {
+ Gestor.Application.Actions.Actions.AtualizaBadges();
+ });
+ return fases;
+ }
+ finally
+ {
+ ((IDisposable)commited)?.Dispose();
+ }
+ }
+ catch (Exception e)
+ {
+ tries = Registrar(e, (TipoErro)269, tries, fases);
+ }
+ }
+ return fasesOriginal;
+ });
+ }
+
+ public async Task<List<Tarefa>> Salvar(List<Tarefa> tarefas)
+ {
+ int tries = 3;
+ base.Sucesso = true;
+ DateTime now = Funcoes.GetNetworkTime();
+ List<Tarefa> tarefasOriginal = tarefas;
+ return await Task.Run(delegate
+ {
+ //IL_0052: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0057: Unknown result type (might be due to invalid IL or missing references)
+ //IL_005e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0069: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0075: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0077: Unknown result type (might be due to invalid IL or missing references)
+ //IL_007c: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0088: Expected O, but got Unknown
+ //IL_008d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0099: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00a0: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00ab: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00b6: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00c1: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00ff: Expected O, but got Unknown
+ while (tries > 0)
+ {
+ tarefas = tarefasOriginal;
+ try
+ {
+ UnitOfWork commited = Instancia.Commited;
+ try
+ {
+ tarefas = commited.TarefaRepository.Salvar(tarefas);
+ IPHostEntry hostEntry = Dns.GetHostEntry(Dns.GetHostName());
+ foreach (Tarefa tarefa in tarefas)
+ {
+ RegistroLog keyValues = new RegistroLog
+ {
+ Acao = (TipoAcao)1,
+ Usuario = Recursos.Usuario,
+ DataHora = now,
+ Descricao = JsonConvert.SerializeObject((object)tarefa, new JsonSerializerSettings
+ {
+ ReferenceLoopHandling = (ReferenceLoopHandling)1
+ }),
+ EntidadeId = ((DomainBase)tarefa).Id,
+ Tela = (TipoTela)4,
+ Versao = LoginViewModel.VersaoAtual,
+ NomeMaquina = Environment.MachineName,
+ UsuarioMaquina = Environment.UserName,
+ Ip = hostEntry.AddressList.FirstOrDefault((IPAddress ip) => ip.AddressFamily == AddressFamily.InterNetwork)?.ToString()
+ };
+ SaveLog(keyValues, commited);
+ }
+ ((GenericUnitOfWork)commited).Commit();
+ ((DispatcherObject)Application.Current).Dispatcher.Invoke((Action)delegate
+ {
+ Gestor.Application.Actions.Actions.AtualizaBadges();
+ });
+ return tarefas;
+ }
+ finally
+ {
+ ((IDisposable)commited)?.Dispose();
+ }
+ }
+ catch (Exception e)
+ {
+ tries = Registrar(e, (TipoErro)265, tries, tarefas);
+ }
+ }
+ return tarefasOriginal;
+ });
+ }
+
+ public async Task<List<long>> Validar(List<long> ids, long trilhaId)
+ {
+ int tries = 3;
+ return await Task.Run(delegate
+ {
+ while (tries > 0)
+ {
+ try
+ {
+ UnitOfWork commited = Instancia.Commited;
+ try
+ {
+ return commited.TarefaRepository.Validar(ids, trilhaId);
+ }
+ finally
+ {
+ ((IDisposable)commited)?.Dispose();
+ }
+ }
+ catch (Exception e)
+ {
+ tries = Registrar(e, (TipoErro)266, tries, new { ids, trilhaId });
+ }
+ }
+ return (List<long>)null;
+ });
+ }
+
+ public async Task<Tarefa> BuscarTarefa(long id)
+ {
+ int tries = 3;
+ return await Task.Run((Func<Tarefa>)delegate
+ {
+ //IL_0059: Unknown result type (might be due to invalid IL or missing references)
+ //IL_005f: Expected O, but got Unknown
+ while (tries > 0)
+ {
+ try
+ {
+ UnitOfWork read = Instancia.Read;
+ try
+ {
+ return read.TarefaRepository.BuscarTarefa(id);
+ }
+ finally
+ {
+ ((IDisposable)read)?.Dispose();
+ }
+ }
+ catch (Exception e)
+ {
+ tries = Registrar(e, (TipoErro)105, tries, id);
+ }
+ }
+ return new Tarefa();
+ });
+ }
+
+ public async Task<List<Tarefa>> BuscarTarefasPorTipo(TipoDeTarefa tipoTarefa)
+ {
+ int tries = 3;
+ return await Task.Run(delegate
+ {
+ while (tries > 0)
+ {
+ try
+ {
+ UnitOfWork read = Instancia.Read;
+ try
+ {
+ return read.TarefaRepository.BuscarTarefasPorTipo(((DomainBase)tipoTarefa).Id);
+ }
+ finally
+ {
+ ((IDisposable)read)?.Dispose();
+ }
+ }
+ catch (Exception e)
+ {
+ tries = Registrar(e, (TipoErro)309, tries, new { tipoTarefa });
+ }
+ }
+ return new List<Tarefa>();
+ });
+ }
+
+ public async Task<bool> ExcluirTarefasDocumento(long id)
+ {
+ int tries = 3;
+ return await Task.Run(delegate
+ {
+ //IL_0077: Unknown result type (might be due to invalid IL or missing references)
+ //IL_007c: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0083: Unknown result type (might be due to invalid IL or missing references)
+ //IL_008e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0099: Unknown result type (might be due to invalid IL or missing references)
+ //IL_009b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00a0: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00ac: Expected O, but got Unknown
+ //IL_00b1: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00bd: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00c4: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00cf: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00da: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00e5: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0124: Expected O, but got Unknown
+ while (tries > 0)
+ {
+ try
+ {
+ List<Tarefa> list = new List<Tarefa>();
+ UnitOfWork read = Instancia.Read;
+ try
+ {
+ list = read.TarefaRepository.BuscarTarefa((TipoTarefa)0, id, (bool?)false);
+ }
+ finally
+ {
+ ((IDisposable)read)?.Dispose();
+ }
+ foreach (Tarefa item in list)
+ {
+ UnitOfWork commited = Instancia.Commited;
+ try
+ {
+ commited.TarefaRepository.Excluir(((DomainBase)item).Id);
+ ((GenericUnitOfWork)commited).Commit();
+ IPHostEntry hostEntry = Dns.GetHostEntry(Dns.GetHostName());
+ RegistroLog keyValues = new RegistroLog
+ {
+ Acao = (TipoAcao)1,
+ Usuario = Recursos.Usuario,
+ DataHora = DateTime.Now,
+ Descricao = JsonConvert.SerializeObject((object)item, new JsonSerializerSettings
+ {
+ ReferenceLoopHandling = (ReferenceLoopHandling)1
+ }),
+ EntidadeId = ((DomainBase)item).Id,
+ Tela = (TipoTela)4,
+ Versao = LoginViewModel.VersaoAtual,
+ NomeMaquina = Environment.MachineName,
+ UsuarioMaquina = Environment.UserName,
+ Ip = hostEntry.AddressList.FirstOrDefault((IPAddress ip) => ip.AddressFamily == AddressFamily.InterNetwork)?.ToString()
+ };
+ SaveLog(keyValues, commited);
+ }
+ finally
+ {
+ ((IDisposable)commited)?.Dispose();
+ }
+ }
+ ((DispatcherObject)Application.Current).Dispatcher.Invoke((Action)delegate
+ {
+ Gestor.Application.Actions.Actions.AtualizaBadges();
+ });
+ return true;
+ }
+ catch (Exception e)
+ {
+ tries = Registrar(e, (TipoErro)268, tries, id);
+ }
+ }
+ return false;
+ });
+ }
+}