From 1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1 Mon Sep 17 00:00:00 2001 From: Lucas Faria Mendes Date: Mon, 30 Mar 2026 10:38:18 -0300 Subject: chore: location --- .../Servicos/Ferramentas/EmpresaServico.cs | 287 --------------------- 1 file changed, 287 deletions(-) delete mode 100644 Gestor.Application/Servicos/Ferramentas/EmpresaServico.cs (limited to 'Gestor.Application/Servicos/Ferramentas/EmpresaServico.cs') diff --git a/Gestor.Application/Servicos/Ferramentas/EmpresaServico.cs b/Gestor.Application/Servicos/Ferramentas/EmpresaServico.cs deleted file mode 100644 index 4d6d354..0000000 --- a/Gestor.Application/Servicos/Ferramentas/EmpresaServico.cs +++ /dev/null @@ -1,287 +0,0 @@ -using ArquivoDigital.Infrastructure.Repository.Interface; -using ArquivoDigital.Infrastructure.UnitOfWork.Logic; -using Gestor.Application.Helpers; -using Gestor.Application.Servicos.Generic; -using Gestor.Application.ViewModels; -using Gestor.Infrastructure.Repository.Interface; -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; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Net; -using System.Net.Sockets; -using System.Runtime.CompilerServices; -using System.Threading.Tasks; - -namespace Gestor.Application.Servicos.Ferramentas -{ - internal class EmpresaServico : BaseServico - { - public EmpresaServico() - { - } - - public async void AtualizarLogoId(long id, string idLogo) - { - await Task.Run(() => { - try - { - using (Gestor.Infrastructure.UnitOfWork.Logic.UnitOfWork commited = Instancia.Commited) - { - Empresa empresa = commited.get_EmpresaRepository().FindById(id); - empresa.set_LogoId(idLogo); - commited.get_EmpresaRepository().Merge(empresa); - commited.Commit(); - } - } - catch (Exception exception) - { - } - }); - } - - internal async Task BuscarEmpresaPorId(long id) - { - int num = 3; - Empresa empresa1 = await Task.Run(() => { - Empresa empresa; - while (num > 0) - { - try - { - using (Gestor.Infrastructure.UnitOfWork.Logic.UnitOfWork read = Instancia.Read) - { - empresa = read.get_EmpresaRepository().FindById(id); - } - } - catch (Exception exception) - { - num = base.Registrar(exception, 114, num, id, true); - continue; - } - return empresa; - } - return new Empresa(); - }); - return empresa1; - } - - internal async Task> BuscarEmpresas() - { - int num = 3; - List empresas1 = await Task.Run>(() => { - List empresas; - while (num > 0) - { - try - { - using (Gestor.Infrastructure.UnitOfWork.Logic.UnitOfWork read = Instancia.Read) - { - empresas = read.get_EmpresaRepository().Find((Recursos.Usuario.get_IdEmpresa() == (long)1 ? (long)0 : Recursos.Usuario.get_IdEmpresa())); - } - } - catch (Exception exception) - { - num = base.Registrar(exception, 113, num, null, true); - continue; - } - return empresas; - } - return new List(); - }); - return empresas1; - } - - public string BuscarSenhaAdm() - { - string str; - int num = 3; - while (num > 0) - { - try - { - using (Gestor.Infrastructure.UnitOfWork.Logic.UnitOfWork read = Instancia.Read) - { - str = read.get_EmpresaRepository().BuscarSenhaAdm((long)1); - } - } - catch (Exception exception) - { - num = base.Registrar(exception, 115, num, null, true); - continue; - } - return str; - } - return null; - } - - public async Task ConsultaEspacoBancoInGb() - { - double num3 = await Task.Run(() => { - double num; - try - { - using (Gestor.Infrastructure.UnitOfWork.Logic.UnitOfWork read = Instancia.Read) - { - double num1 = read.get_EmpresaRepository().ConsultaEspacoBancoInGb(); - double num2 = 0; - try - { - foreach (ControleArquivoDigital controleArquivoDigital in read.get_IndiceArquivoDigitalRepository().BuscarBancos()) - { - if (controleArquivoDigital.get_Tabela().ToLower() == "arquivos") - { - continue; - } - try - { - Gestor.Application.Helpers.ArquivoDigital.SetConnection(controleArquivoDigital.get_Catalogo()); - using (ArquivoDigital.Infrastructure.UnitOfWork.Logic.UnitOfWork unitOfWork = Gestor.Application.Helpers.ArquivoDigital.Read) - { - num2 += unitOfWork.get_ArquivoDigitalRepository().ConsultaEspacoBancoInGb(); - } - } - catch - { - } - } - } - catch - { - } - num = num1 + num2; - } - } - catch (Exception exception) - { - return 0; - } - return num; - }); - return num3; - } - - internal async Task Save(Customer customer) - { - int num = 3; - base.Sucesso = true; - Customer customer1 = customer; - Customer customer2 = await Task.Run(() => { - Customer customer3; - while (num > 0) - { - customer = customer1; - try - { - using (Gestor.Infrastructure.UnitOfWork.Logic.UnitOfWork commited = Instancia.Commited) - { - Empresa empresa = new Empresa(); - empresa.set_Nome(customer.get_Name()); - empresa.set_Documento(customer.get_Document()); - empresa.set_Bairro(customer.get_District()); - empresa.set_Cidade(customer.get_City()); - empresa.set_Complemento(customer.get_Adjunct()); - empresa.set_Numero(customer.get_Number()); - empresa.set_Cep(customer.get_PostCode()); - empresa.set_Estado(customer.get_State()); - empresa.set_Email(customer.get_Mail()); - empresa.set_PrimeiroPrefixo(customer.get_AreaCode()); - empresa.set_PrimeiroTelefone(customer.get_Phone()); - empresa.set_SegundoPrefixo(customer.get_SecondAreaCode()); - empresa.set_SegundoTelefone(customer.get_SecondPhone()); - empresa.set_Serial(ApplicationHelper.NumeroSerial); - empresa.set_Site(customer.get_Site()); - commited.get_EmpresaRepository().SaveOrUpdate(empresa); - commited.Commit(); - customer3 = customer; - } - } - catch (Exception exception) - { - num = base.Registrar(exception, 277, num, customer, true); - continue; - } - return customer3; - } - return customer1; - }); - return customer2; - } - - public async Task Save(Empresa empresa) - { - int num = 3; - base.Sucesso = true; - Empresa empresa2 = empresa; - Empresa empresa3 = await Task.Run(() => { - Empresa empresa4; - string str; - while (num > 0) - { - empresa = empresa2; - try - { - using (Gestor.Infrastructure.UnitOfWork.Logic.UnitOfWork commited = Instancia.Commited) - { - TipoAcao tipoAcao = (empresa.get_Id() == 0 ? 0 : 1); - empresa = (empresa.get_Id() == 0 ? commited.get_EmpresaRepository().SaveOrUpdate(empresa) : commited.get_EmpresaRepository().Merge(empresa)); - IPHostEntry hostEntry = Dns.GetHostEntry(Dns.GetHostName()); - if (Recursos.Usuario.get_Id() != 0) - { - RegistroLog registroLog = new RegistroLog(); - registroLog.set_Acao(tipoAcao); - registroLog.set_Usuario(Recursos.Usuario); - registroLog.set_DataHora(Funcoes.GetNetworkTime()); - Empresa empresa1 = empresa; - JsonSerializerSettings jsonSerializerSetting = new JsonSerializerSettings(); - jsonSerializerSetting.set_ReferenceLoopHandling(1); - registroLog.set_Descricao(JsonConvert.SerializeObject(empresa1, jsonSerializerSetting)); - registroLog.set_EntidadeId(empresa.get_Id()); - registroLog.set_Tela(18); - registroLog.set_Versao(LoginViewModel.VersaoAtual); - registroLog.set_NomeMaquina(Environment.MachineName); - registroLog.set_UsuarioMaquina(Environment.UserName); - IPAddress[] addressList = hostEntry.AddressList; - Func u003cu003e9_31 = EmpresaServico.u003cu003ec.u003cu003e9__3_1; - if (u003cu003e9_31 == null) - { - u003cu003e9_31 = (IPAddress ip) => ip.AddressFamily == AddressFamily.InterNetwork; - EmpresaServico.u003cu003ec.u003cu003e9__3_1 = u003cu003e9_31; - } - IPAddress pAddress = ((IEnumerable)addressList).FirstOrDefault(u003cu003e9_31); - if (pAddress != null) - { - str = pAddress.ToString(); - } - else - { - str = null; - } - registroLog.set_Ip(str); - base.SaveLog(registroLog, commited); - } - commited.Commit(); - empresa4 = empresa; - } - } - catch (Exception exception) - { - num = base.Registrar(exception, 277, num, empresa, true); - continue; - } - return empresa4; - } - return empresa2; - }); - return empresa3; - } - } -} \ No newline at end of file -- cgit v1.2.3