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 --- .../AdiantamentoRepository.cs | 168 --------------------- 1 file changed, 168 deletions(-) delete mode 100644 Gestor.Infrastructure/Gestor.Infrastructure.Repository.Logic/AdiantamentoRepository.cs (limited to 'Gestor.Infrastructure/Gestor.Infrastructure.Repository.Logic/AdiantamentoRepository.cs') diff --git a/Gestor.Infrastructure/Gestor.Infrastructure.Repository.Logic/AdiantamentoRepository.cs b/Gestor.Infrastructure/Gestor.Infrastructure.Repository.Logic/AdiantamentoRepository.cs deleted file mode 100644 index aff2bf7..0000000 --- a/Gestor.Infrastructure/Gestor.Infrastructure.Repository.Logic/AdiantamentoRepository.cs +++ /dev/null @@ -1,168 +0,0 @@ -using AutoMapper; -using Gestor.Infrastructure.Entities.Generic; -using Gestor.Infrastructure.Entities.Seguros; -using Gestor.Infrastructure.Helpers; -using Gestor.Infrastructure.Mappers; -using Gestor.Infrastructure.Repository.Generic; -using Gestor.Infrastructure.Repository.Interface; -using Gestor.Infrastructure.UnitOfWork.Generic; -using Gestor.Model.Common; -using Gestor.Model.Domain.Seguros; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; - -namespace Gestor.Infrastructure.Repository.Logic -{ - public class AdiantamentoRepository : GenericRepository, IAdiantamentoRepository, IGenericRepository - { - private readonly GenericUnitOfWork _unitOfWork; - - public AdiantamentoRepository(GenericUnitOfWork unitOfWork) : base(unitOfWork.Session) - { - this._unitOfWork = unitOfWork; - } - - public List AddRange(List adiantamentos) - { - List adiantamentoDbs = ApplicationMapper.Mapper.Map, List>(adiantamentos); - base.AddRange(adiantamentoDbs); - return ApplicationMapper.Mapper.Map, List>(adiantamentoDbs); - } - - public List BuscarAdiantamentos(long id, bool concluido = false) - { - List list = ( - from x in base.All() - where x.Vendedor.Id == id && x.Pago == concluido - select x).ToList(); - return ApplicationMapper.Mapper.Map, List>(list); - } - - public void Delete(long id) - { - base.Delete(base.FindEntityById(id)); - } - - public List Find(bool ativo) - { - return this.Select((new List() - { - new Condicao() - { - Campo = "ativo", - Valores = null - }, - new Condicao() - { - Campo = "pago", - Valores = "1".CriarValor() - } - }).CreateParameters(0)); - } - - public List Find(long id) - { - return this.Select((new List() - { - new Condicao() - { - Campo = "idvendedor", - Valores = id.CriarValor() - } - }).CreateParameters(0)); - } - - public List Find(string nome) - { - return this.Select((new List() - { - new Condicao() - { - Campo = "historico", - Valores = nome.CriarValor() - } - }).CreateParameters(0)); - } - - public List FindByDate(DateTime inicio, DateTime fim, List vendedores = null, bool segundavia = false) - { - List condicaos = new List() - { - new Condicao() - { - Campo = (segundavia ? "CAST(Pagamento AS DATE)" : "CAST(data AS DATE)"), - Valores = inicio.CriarValor(), - Operador = Operador.MaiorEIgual - }, - new Condicao() - { - Campo = (segundavia ? "CAST(Pagamento AS DATE)" : "CAST(data AS DATE)"), - Valores = fim.CriarValor(), - Operador = Operador.MenorEIgual - } - }; - condicaos.AddRange((!segundavia ? new List() - { - new Condicao() - { - Campo = "pago", - Valores = null, - Operacao = Operacao.Or, - Grupo = 1 - }, - new Condicao() - { - Campo = "pago", - Valores = "1".CriarValor(), - Operacao = Operacao.Or, - Grupo = 1, - Operador = Operador.Diferente - } - } : new List() - { - new Condicao() - { - Campo = "pago", - Valores = "1".CriarValor() - } - })); - if (vendedores != null && vendedores.Count > 0) - { - condicaos.Add(new Condicao() - { - Campo = "idvendedor", - Valores = vendedores.CriarValor() - }); - } - return this.Select(condicaos.CreateParameters(0)); - } - - public Adiantamento FindById(long id) - { - AdiantamentoDb adiantamentoDb = base.FindEntityById(id); - return ApplicationMapper.Mapper.Map(adiantamentoDb); - } - - public Adiantamento Merge(Adiantamento adiantamento) - { - AdiantamentoDb adiantamentoDb = ApplicationMapper.Mapper.Map(adiantamento); - base.Merge(adiantamentoDb); - return ApplicationMapper.Mapper.Map(adiantamentoDb); - } - - public Adiantamento SaveOrUpdate(Adiantamento adiantamento) - { - AdiantamentoDb adiantamentoDb = ApplicationMapper.Mapper.Map(adiantamento); - this.SaveOrUpdate(adiantamentoDb); - return ApplicationMapper.Mapper.Map(adiantamentoDb); - } - - private List Select(SqlQueryCondition sqlCondition) - { - return this._unitOfWork.Select(sqlCondition, "SELECT DISTINCT * FROM adiantamento WHERE", "").MapAdiantamento(); - } - } -} \ No newline at end of file -- cgit v1.2.3