diff options
| author | Lucas Faria Mendes <lucas.fariamo08@gmail.com> | 2026-03-30 15:29:41 +0000 |
|---|---|---|
| committer | Lucas Faria Mendes <lucas.fariamo08@gmail.com> | 2026-03-30 15:29:41 +0000 |
| commit | 225aa1499e37faf9d38257caabbadc68d78b427e (patch) | |
| tree | 102bb7a40c58595348ae9d3c7076201759fe0720 /Decompiler/Gestor.Application.Servicos.Seguros/PerfilEmpresaServico.cs | |
| parent | 1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1 (diff) | |
| download | gestor-225aa1499e37faf9d38257caabbadc68d78b427e.tar.gz gestor-225aa1499e37faf9d38257caabbadc68d78b427e.zip | |
decompiler.com
Diffstat (limited to 'Decompiler/Gestor.Application.Servicos.Seguros/PerfilEmpresaServico.cs')
| -rw-r--r-- | Decompiler/Gestor.Application.Servicos.Seguros/PerfilEmpresaServico.cs | 178 |
1 files changed, 178 insertions, 0 deletions
diff --git a/Decompiler/Gestor.Application.Servicos.Seguros/PerfilEmpresaServico.cs b/Decompiler/Gestor.Application.Servicos.Seguros/PerfilEmpresaServico.cs new file mode 100644 index 0000000..05291e2 --- /dev/null +++ b/Decompiler/Gestor.Application.Servicos.Seguros/PerfilEmpresaServico.cs @@ -0,0 +1,178 @@ +using System; +using System.Linq; +using System.Net; +using System.Net.Sockets; +using System.Threading.Tasks; +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.Generic; +using Gestor.Model.Domain.Seguros; +using Newtonsoft.Json; + +namespace Gestor.Application.Servicos.Seguros; + +internal class PerfilEmpresaServico : BaseServico +{ + internal async Task<PerfilEmpresa> BuscarPerfis(long controleId) + { + int tries = 3; + return await Task.Run((Func<PerfilEmpresa>)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.PerfilEmpresaRepository.FindByControleId(controleId); + } + finally + { + ((IDisposable)read)?.Dispose(); + } + } + catch (Exception e) + { + tries = Registrar(e, (TipoErro)46, tries, controleId); + } + } + return new PerfilEmpresa(); + }); + } + + public async Task<PerfilEmpresa> Save(PerfilEmpresa perfil) + { + int tries = 3; + base.Sucesso = true; + PerfilEmpresa perfilOriginal = perfil; + return await Task.Run((Func<PerfilEmpresa>)delegate + { + //IL_0028: 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_0070: Unknown result type (might be due to invalid IL or missing references) + //IL_0071: 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_0082: Unknown result type (might be due to invalid IL or missing references) + //IL_008d: Unknown result type (might be due to invalid IL or missing references) + //IL_0094: 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_00a5: Expected O, but got Unknown + //IL_00aa: Unknown result type (might be due to invalid IL or missing references) + //IL_00bb: Unknown result type (might be due to invalid IL or missing references) + //IL_00c3: Unknown result type (might be due to invalid IL or missing references) + //IL_00ce: Unknown result type (might be due to invalid IL or missing references) + //IL_00d9: Unknown result type (might be due to invalid IL or missing references) + //IL_00e4: Unknown result type (might be due to invalid IL or missing references) + //IL_0121: Expected O, but got Unknown + while (tries > 0) + { + perfil = perfilOriginal; + try + { + UnitOfWork commited = Instancia.Commited; + try + { + TipoAcao acao = (TipoAcao)(((DomainBase)perfil).Id != 0L); + perfil = ((((DomainBase)perfil).Id == 0L) ? commited.PerfilEmpresaRepository.SaveOrUpdate(perfil) : commited.PerfilEmpresaRepository.Merge(perfil)); + IPHostEntry hostEntry = Dns.GetHostEntry(Dns.GetHostName()); + RegistroLog keyValues = new RegistroLog + { + Acao = acao, + Usuario = Recursos.Usuario, + DataHora = Funcoes.GetNetworkTime(), + Descricao = JsonConvert.SerializeObject((object)perfil, new JsonSerializerSettings + { + ReferenceLoopHandling = (ReferenceLoopHandling)1 + }), + EntidadeId = ((DomainBase)perfil).Id, + Tela = (TipoTela)32, + 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(); + return perfil; + } + finally + { + ((IDisposable)commited)?.Dispose(); + } + } + catch (Exception e) + { + tries = Registrar(e, (TipoErro)212, tries, perfil); + } + } + return perfilOriginal; + }); + } + + public async Task<bool> Delete(PerfilEmpresa perfil) + { + int tries = 3; + return await Task.Run(delegate + { + //IL_0033: Unknown result type (might be due to invalid IL or missing references) + //IL_0038: Unknown result type (might be due to invalid IL or missing references) + //IL_003f: Unknown result type (might be due to invalid IL or missing references) + //IL_004a: Unknown result type (might be due to invalid IL or missing references) + //IL_0051: Unknown result type (might be due to invalid IL or missing references) + //IL_0090: Unknown result type (might be due to invalid IL or missing references) + //IL_00a1: Unknown result type (might be due to invalid IL or missing references) + //IL_00a8: Unknown result type (might be due to invalid IL or missing references) + //IL_00b3: Unknown result type (might be due to invalid IL or missing references) + //IL_00be: Unknown result type (might be due to invalid IL or missing references) + //IL_00c9: Unknown result type (might be due to invalid IL or missing references) + //IL_0106: Expected O, but got Unknown + while (tries > 0) + { + try + { + UnitOfWork commited = Instancia.Commited; + try + { + commited.PerfilEmpresaRepository.Delete(((DomainBase)perfil).Id); + DateTime networkTime = Funcoes.GetNetworkTime(); + IPHostEntry hostEntry = Dns.GetHostEntry(Dns.GetHostName()); + RegistroLog keyValues = new RegistroLog + { + Acao = (TipoAcao)2, + Usuario = Recursos.Usuario, + DataHora = networkTime, + Descricao = $"O USUĂRIO {Recursos.Usuario.Nome} EXCLUIU O PERFIL, EM {networkTime}, DE " + $"ID: '{((DomainBase)perfil).Id}'", + EntidadeId = ((DomainBase)perfil).Id, + Tela = (TipoTela)3, + 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(); + return true; + } + finally + { + ((IDisposable)commited)?.Dispose(); + } + } + catch (Exception e) + { + tries = Registrar(e, (TipoErro)213, tries, perfil); + } + } + return false; + }); + } +} |