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/FornecedorServico.cs | 123 --------------------- 1 file changed, 123 deletions(-) delete mode 100644 Gestor.Application/Servicos/Financeiro/FornecedorServico.cs (limited to 'Gestor.Application/Servicos/Financeiro/FornecedorServico.cs') diff --git a/Gestor.Application/Servicos/Financeiro/FornecedorServico.cs b/Gestor.Application/Servicos/Financeiro/FornecedorServico.cs deleted file mode 100644 index 674f46a..0000000 --- a/Gestor.Application/Servicos/Financeiro/FornecedorServico.cs +++ /dev/null @@ -1,123 +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.Common; -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 -{ - public class FornecedorServico : BaseServico - { - public FornecedorServico() - { - } - - public async Task> BuscarFornecedores() - { - int num = 3; - List fornecedors1 = await Task.Run>(() => { - List fornecedors; - while (num > 0) - { - try - { - using (UnitOfWork read = Instancia.Read) - { - fornecedors = read.get_FornecedorRepository().Find(); - } - } - catch (Exception exception) - { - num = base.Registrar(exception, 166, num, null, true); - continue; - } - return fornecedors; - } - return new List(); - }); - return fornecedors1; - } - - public async Task Delete(Fornecedor fornecedor) - { - 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(fornecedor.get_Id(), fornecedor.GetValorOriginal(), 24, 2)); - commited.get_FornecedorRepository().Delete(fornecedor.get_Id()); - base.SaveLog(registroLogs, commited); - commited.Commit(); - flag = true; - } - } - catch (Exception exception) - { - num = base.Registrar(exception, 244, num, fornecedor, true); - continue; - } - return flag; - } - return false; - }); - return flag1; - } - - public async Task Save(Fornecedor fornecedor) - { - int num = 3; - base.Sucesso = true; - Fornecedor fornecedor1 = fornecedor; - Fornecedor fornecedor2 = await Task.Run(() => { - Fornecedor fornecedor3; - while (num > 0) - { - List registroLogs = new List(); - fornecedor = fornecedor1; - try - { - using (UnitOfWork commited = Instancia.Commited) - { - TipoAcao tipoAcao = (fornecedor.get_Id() == 0 ? 0 : 1); - if (tipoAcao == 1) - { - registroLogs.Add(base.CreateLog(fornecedor.get_Id(), fornecedor, 24)); - } - fornecedor = (tipoAcao == null ? commited.get_FornecedorRepository().SaveOrUpdate(fornecedor) : commited.get_FornecedorRepository().Merge(fornecedor)); - if (tipoAcao == null) - { - registroLogs.Add(base.CreateLog(fornecedor.get_Id(), fornecedor.GetValorOriginal(), 24, 0)); - } - base.SaveLog(registroLogs, commited); - commited.Commit(); - fornecedor3 = fornecedor; - } - } - catch (Exception exception) - { - num = base.Registrar(exception, 243, num, fornecedor, true); - continue; - } - return fornecedor3; - } - return fornecedor1; - }); - return fornecedor2; - } - } -} \ No newline at end of file -- cgit v1.2.3