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/ProdutoServico.cs | 92 ---------------------- 1 file changed, 92 deletions(-) delete mode 100644 Gestor.Application/Servicos/Ferramentas/ProdutoServico.cs (limited to 'Gestor.Application/Servicos/Ferramentas/ProdutoServico.cs') diff --git a/Gestor.Application/Servicos/Ferramentas/ProdutoServico.cs b/Gestor.Application/Servicos/Ferramentas/ProdutoServico.cs deleted file mode 100644 index 76fd16d..0000000 --- a/Gestor.Application/Servicos/Ferramentas/ProdutoServico.cs +++ /dev/null @@ -1,92 +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.Generic; -using Gestor.Model.Domain.Seguros; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Runtime.CompilerServices; -using System.Threading.Tasks; - -namespace Gestor.Application.Servicos.Ferramentas -{ - internal class ProdutoServico : BaseServico - { - public ProdutoServico() - { - } - - internal async Task BuscarProdutoPorId(long id) - { - int num = 3; - Produto produto1 = await Task.Run(() => { - Produto produto; - while (num > 0) - { - try - { - using (UnitOfWork read = Instancia.Read) - { - produto = read.get_ProdutoRepository().FindById(id); - } - } - catch (Exception exception) - { - num = base.Registrar(exception, 116, num, id, true); - continue; - } - return produto; - } - return new Produto(); - }); - return produto1; - } - - public async Task Save(Produto produto) - { - int num = 3; - base.Sucesso = true; - Produto produto1 = produto; - Produto produto2 = await Task.Run(() => { - Produto produto3; - bool flag; - while (num > 0) - { - List registroLogs = new List(); - produto = produto1; - try - { - using (UnitOfWork commited = Instancia.Commited) - { - flag = (produto.get_Id() == 0 ? false : true); - if (flag) - { - registroLogs.Add(base.CreateLog(produto.get_Id(), produto, 10)); - } - produto = (produto.get_Id() == 0 ? commited.get_ProdutoRepository().SaveOrUpdate(produto) : commited.get_ProdutoRepository().Merge(produto)); - if (!flag) - { - registroLogs.Add(base.CreateLog(produto.get_Id(), produto.GetValorOriginal(), 10, 0)); - } - base.SaveLog(registroLogs, commited); - commited.Commit(); - produto3 = produto; - } - } - catch (Exception exception) - { - num = base.Registrar(exception, 226, num, produto, true); - continue; - } - return produto3; - } - return produto1; - }); - return produto2; - } - } -} \ No newline at end of file -- cgit v1.2.3