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/VendedorUsuarioServico.cs | 160 --------------------- 1 file changed, 160 deletions(-) delete mode 100644 Gestor.Application/Servicos/VendedorUsuarioServico.cs (limited to 'Gestor.Application/Servicos/VendedorUsuarioServico.cs') diff --git a/Gestor.Application/Servicos/VendedorUsuarioServico.cs b/Gestor.Application/Servicos/VendedorUsuarioServico.cs deleted file mode 100644 index 4804dac..0000000 --- a/Gestor.Application/Servicos/VendedorUsuarioServico.cs +++ /dev/null @@ -1,160 +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.Generic; -using Gestor.Model.Domain.Seguros; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Runtime.CompilerServices; -using System.Threading.Tasks; - -namespace Gestor.Application.Servicos -{ - public class VendedorUsuarioServico : BaseServico - { - public VendedorUsuarioServico() - { - } - - public async Task Delete(List vinculo) - { - int num = 3; - bool flag1 = await Task.Run(() => { - bool flag; - while (num > 0) - { - try - { - using (UnitOfWork commited = Instancia.Commited) - { - vinculo.ForEach((VendedorUsuario x) => commited.get_VendedorUsuarioRepository().Delete(x.get_Id())); - commited.Commit(); - } - flag = true; - } - catch (Exception exception) - { - num = base.Registrar(exception, 272, num, vinculo, true); - continue; - } - return flag; - } - return false; - }); - return flag1; - } - - public async Task> FindByVinculo(Usuario usuario) - { - int num = 3; - List vendedorUsuarios = await Task.Run>(() => { - List list; - while (num > 0) - { - try - { - using (UnitOfWork read = Instancia.Read) - { - list = read.get_VendedorUsuarioRepository().FindByVinculo(usuario.get_Id()).ToList(); - } - } - catch (Exception exception) - { - num = base.Registrar(exception, 106, num, usuario, true); - continue; - } - return list; - } - return new List(); - }); - return vendedorUsuarios; - } - - public async Task FindVinculo(Vendedor vendedor) - { - int num = 3; - bool flag1 = await Task.Run(() => { - bool flag; - while (num > 0) - { - try - { - using (UnitOfWork read = Instancia.Read) - { - flag = read.get_VendedorUsuarioRepository().Exist(vendedor.get_Id()); - } - } - catch (Exception exception) - { - num = base.Registrar(exception, 271, num, vendedor, true); - continue; - } - return flag; - } - return false; - }); - return flag1; - } - - public async Task FindVinculoByUsuario(long idusuario) - { - int num = 3; - bool flag1 = await Task.Run(() => { - bool flag; - while (num > 0) - { - try - { - using (UnitOfWork read = Instancia.Read) - { - flag = read.get_VendedorUsuarioRepository().ExistVinculoUsuario(idusuario); - } - } - catch (Exception exception) - { - num = base.Registrar(exception, 106, num, null, true); - continue; - } - return flag; - } - return false; - }); - return flag1; - } - - public async Task> SaveOrUpdate(List vinculo) - { - int num = 3; - base.Sucesso = true; - List vendedorUsuarios1 = vinculo; - List vendedorUsuarios2 = await Task.Run>(() => { - List vendedorUsuarios; - while (num > 0) - { - vinculo = vendedorUsuarios1; - try - { - using (UnitOfWork commited = Instancia.Commited) - { - vinculo.ForEach((VendedorUsuario x) => commited.get_VendedorUsuarioRepository().SaveOrUpdate(x)); - commited.Commit(); - } - vendedorUsuarios = vinculo; - } - catch (Exception exception) - { - num = base.Registrar(exception, 271, num, vinculo, true); - continue; - } - return vendedorUsuarios; - } - return vendedorUsuarios1; - }); - return vendedorUsuarios2; - } - } -} \ No newline at end of file -- cgit v1.2.3