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/Financeiro/BancosContasServico.cs | 362 --------------------- 1 file changed, 362 deletions(-) delete mode 100644 Gestor.Application/Servicos/Financeiro/BancosContasServico.cs (limited to 'Gestor.Application/Servicos/Financeiro/BancosContasServico.cs') diff --git a/Gestor.Application/Servicos/Financeiro/BancosContasServico.cs b/Gestor.Application/Servicos/Financeiro/BancosContasServico.cs deleted file mode 100644 index 68c9a50..0000000 --- a/Gestor.Application/Servicos/Financeiro/BancosContasServico.cs +++ /dev/null @@ -1,362 +0,0 @@ -using Gestor.Application.Helpers; -using Gestor.Application.Servicos.Generic; -using Gestor.Infrastructure.Repository.Interface; -using Gestor.Infrastructure.UnitOfWork.Generic; -using Gestor.Infrastructure.UnitOfWork.Logic; -using Gestor.Model.Domain.Common; -using Gestor.Model.Domain.Financeiro; -using Gestor.Model.Domain.Generic; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Runtime.CompilerServices; -using System.Threading.Tasks; - -namespace Gestor.Application.Servicos.Financeiro -{ - internal class BancosContasServico : BaseServico - { - public BancosContasServico() - { - } - - public async Task> BuscarBancos() - { - int num = 3; - List bancosContas1 = await Task.Run>(() => { - List bancosContas; - while (num > 0) - { - try - { - using (UnitOfWork read = Instancia.Read) - { - bancosContas = read.get_BancosContasRepository().Find(); - } - } - catch (Exception exception) - { - num = base.Registrar(exception, 145, num, null, true); - continue; - } - return bancosContas; - } - return new List(); - }); - return bancosContas1; - } - - public async Task BuscarSaldo(DateTime inicio, long id) - { - int num = 3; - Saldo saldo1 = await Task.Run(() => { - Saldo saldo; - while (num > 0) - { - try - { - using (UnitOfWork read = Instancia.Read) - { - saldo = read.get_SaldoRepository().BuscarPorData(inicio, id); - } - } - catch (Exception exception) - { - num = base.Registrar(exception, 151, num, new { inicio = inicio, id = id }, true); - continue; - } - return saldo; - } - return new Saldo(); - }); - return saldo1; - } - - public async Task BuscarSaldoAberto(long id) - { - int num = 3; - Saldo saldo1 = await Task.Run(() => { - Saldo saldo; - while (num > 0) - { - try - { - using (UnitOfWork read = Instancia.Read) - { - saldo = read.get_SaldoRepository().BuscarAberto(id); - } - } - catch (Exception exception) - { - num = base.Registrar(exception, 147, num, id, true); - continue; - } - return saldo; - } - return new Saldo(); - }); - return saldo1; - } - - public async Task> BuscarSaldoAberto(List ids) - { - int num = 3; - List saldos2 = await Task.Run>(() => { - List saldos; - while (num > 0) - { - try - { - List saldos1 = new List(); - using (UnitOfWork read = Instancia.Read) - { - ids.ForEach((long id) => { - Saldo saldo = read.get_SaldoRepository().BuscarAberto(id); - if (saldo == null) - { - return; - } - saldos1.Add(saldo); - }); - } - saldos = saldos1; - } - catch (Exception exception) - { - num = base.Registrar(exception, 148, num, ids, true); - continue; - } - return saldos; - } - return new List(); - }); - return saldos2; - } - - public async Task BuscarSaldoInicial(long id) - { - int num = 3; - Saldo saldo1 = await Task.Run(() => { - Saldo saldo; - while (num > 0) - { - try - { - using (UnitOfWork read = Instancia.Read) - { - saldo = read.get_SaldoRepository().BuscarPorMenorData(id); - } - } - catch (Exception exception) - { - num = base.Registrar(exception, 151, num, new { id = id }, true); - continue; - } - return saldo; - } - return new Saldo(); - }); - return saldo1; - } - - public async Task> BuscarSaldos(long id) - { - int num = 3; - List saldos1 = await Task.Run>(() => { - List saldos; - while (num > 0) - { - try - { - using (UnitOfWork read = Instancia.Read) - { - saldos = read.get_SaldoRepository().BuscarPorConta(id); - } - } - catch (Exception exception) - { - num = base.Registrar(exception, 150, num, id, true); - continue; - } - return saldos; - } - return new List(); - }); - return saldos1; - } - - public async Task Delete(BancosContas bancosContas) - { - int num = 3; - bool flag1 = await Task.Run(() => { - bool flag; - while (num > 0) - { - List registroLogs = new List(); - try - { - using (UnitOfWork commited = Instancia.Commited) - { - registroLogs.Add(base.CreateLog(bancosContas.get_Id(), bancosContas.GetValorOriginal(), 26, 2)); - commited.get_BancosContasRepository().Delete(bancosContas.get_Id()); - base.SaveLog(registroLogs, commited); - commited.Commit(); - flag = true; - } - } - catch (Exception exception) - { - num = base.Registrar(exception, 246, num, bancosContas, true); - continue; - } - return flag; - } - return false; - }); - return flag1; - } - - public async Task DeleteSaldo(Saldo saldo) - { - int num = 3; - bool flag1 = await Task.Run(() => { - bool flag; - while (num > 0) - { - List registroLogs = new List(); - try - { - using (UnitOfWork commited = Instancia.Commited) - { - registroLogs.Add(base.CreateLog(saldo.get_Id(), saldo.GetValorOriginal(), 26, 2)); - commited.get_SaldoRepository().Delete(saldo.get_Id()); - base.SaveLog(registroLogs, commited); - commited.Commit(); - flag = true; - } - } - catch (Exception exception) - { - num = base.Registrar(exception, 248, num, saldo, true); - continue; - } - return flag; - } - return false; - }); - return flag1; - } - - public async Task FecharSaldo(Saldo saldo) - { - int num = 3; - Saldo saldo1 = await Task.Run(() => { - Saldo saldo2; - while (num > 0) - { - try - { - using (UnitOfWork read = Instancia.Read) - { - saldo2 = read.get_LancamentoRepository().FecharSaldo(saldo); - } - } - catch (Exception exception) - { - num = base.Registrar(exception, 149, num, saldo, true); - continue; - } - return saldo2; - } - return new Saldo(); - }); - return saldo1; - } - - public async Task Save(BancosContas bancosContas) - { - int num = 3; - base.Sucesso = true; - BancosContas bancosConta1 = bancosContas; - BancosContas bancosConta2 = await Task.Run(() => { - BancosContas bancosConta; - bool flag; - while (num > 0) - { - List registroLogs = new List(); - bancosContas = bancosConta1; - try - { - using (UnitOfWork commited = Instancia.Commited) - { - flag = (bancosContas.get_Id() == 0 ? false : true); - if (flag) - { - registroLogs.Add(base.CreateLog(bancosContas.get_Id(), bancosContas, 26)); - } - bancosContas = (bancosContas.get_Id() == 0 ? commited.get_BancosContasRepository().SaveOrUpdate(bancosContas) : commited.get_BancosContasRepository().Merge(bancosContas)); - if (!flag) - { - registroLogs.Add(base.CreateLog(bancosContas.get_Id(), bancosContas.GetValorOriginal(), 26, 0)); - } - base.SaveLog(registroLogs, commited); - commited.Commit(); - bancosConta = bancosContas; - } - } - catch (Exception exception) - { - num = base.Registrar(exception, 245, num, bancosContas, true); - continue; - } - return bancosConta; - } - return bancosConta1; - }); - return bancosConta2; - } - - public async Task Save(Saldo saldo) - { - int num = 3; - base.Sucesso = true; - Saldo saldo1 = saldo; - Saldo saldo2 = await Task.Run(() => { - Saldo saldo3; - bool flag; - while (num > 0) - { - List registroLogs = new List(); - saldo = saldo1; - try - { - using (UnitOfWork commited = Instancia.Commited) - { - flag = (saldo.get_Id() == 0 ? false : true); - if (flag) - { - registroLogs.Add(base.CreateLog(saldo.get_Conta().get_Id(), saldo, 26)); - } - saldo = (saldo.get_Id() == 0 ? commited.get_SaldoRepository().SaveOrUpdate(saldo) : commited.get_SaldoRepository().Merge(saldo)); - if (!flag) - { - registroLogs.Add(base.CreateLog(saldo.get_Conta().get_Id(), saldo.GetValorOriginal(), 26, 0)); - } - base.SaveLog(registroLogs, commited); - commited.Commit(); - saldo3 = saldo; - } - } - catch (Exception exception) - { - num = base.Registrar(exception, 247, num, saldo, true); - continue; - } - return saldo3; - } - return saldo1; - }); - return saldo2; - } - } -} \ No newline at end of file -- cgit v1.2.3