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 --- .../PlanosRepository.cs | 101 --------------------- 1 file changed, 101 deletions(-) delete mode 100644 Gestor.Infrastructure/Gestor.Infrastructure.Repository.Logic/PlanosRepository.cs (limited to 'Gestor.Infrastructure/Gestor.Infrastructure.Repository.Logic/PlanosRepository.cs') diff --git a/Gestor.Infrastructure/Gestor.Infrastructure.Repository.Logic/PlanosRepository.cs b/Gestor.Infrastructure/Gestor.Infrastructure.Repository.Logic/PlanosRepository.cs deleted file mode 100644 index d76619d..0000000 --- a/Gestor.Infrastructure/Gestor.Infrastructure.Repository.Logic/PlanosRepository.cs +++ /dev/null @@ -1,101 +0,0 @@ -using AutoMapper; -using Gestor.Infrastructure.Entities.Financeiro; -using Gestor.Infrastructure.Entities.Generic; -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.Domain.Financeiro; -using NHibernate; -using NHibernate.Connection; -using NHibernate.Impl; -using System; -using System.Collections.Generic; -using System.Data; -using System.Data.Common; -using System.Data.SqlClient; -using System.Linq; -using System.Linq.Expressions; -using System.Reflection; -using System.Runtime.CompilerServices; - -namespace Gestor.Infrastructure.Repository.Logic -{ - public class PlanosRepository : GenericRepository, IPlanosRepository, IGenericRepository - { - private readonly GenericUnitOfWork _unitOfWork; - - public PlanosRepository(GenericUnitOfWork unitOfWork) : base(unitOfWork.Session) - { - this._unitOfWork = unitOfWork; - } - - public List Find(string description) - { - PlanosRepository.u003cu003ec__DisplayClass3_0 variable = null; - IQueryable planosDbs = base.All(); - ParameterExpression parameterExpression = Expression.Parameter(typeof(PlanosDb), "x"); - List list = planosDbs.Where(Expression.Lambda>(Expression.Call(Expression.Call(Expression.Property(parameterExpression, (MethodInfo)MethodBase.GetMethodFromHandle(typeof(PlanosDb).GetMethod("get_Descricao").MethodHandle)), (MethodInfo)MethodBase.GetMethodFromHandle(typeof(string).GetMethod("ToUpper").MethodHandle), Array.Empty()), (MethodInfo)MethodBase.GetMethodFromHandle(typeof(string).GetMethod("Contains", new Type[] { typeof(string) }).MethodHandle), new Expression[] { Expression.Field(Expression.Constant(variable, typeof(PlanosRepository.u003cu003ec__DisplayClass3_0)), FieldInfo.GetFieldFromHandle(typeof(PlanosRepository.u003cu003ec__DisplayClass3_0).GetField("description").FieldHandle)) }), new ParameterExpression[] { parameterExpression })).ToList(); - return ApplicationMapper.Mapper.Map, List>(list); - } - - public List Find() - { - object connection; - SessionFactoryImpl sessionFactory = this._unitOfWork.Session.SessionFactory as SessionFactoryImpl; - DataTable dataTable = new DataTable(); - if (sessionFactory != null) - { - connection = sessionFactory.ConnectionProvider.GetConnection(); - } - else - { - connection = null; - } - using (SqlConnection sqlConnection = connection as SqlConnection) - { - using (SqlCommand sqlCommand = sqlConnection.CreateCommand()) - { - AuxiliarFinanceiro.Criar(sqlCommand); - sqlCommand.CommandText = "SELECT DISTINCT cs.idcplanos as id, cs.descricao as nome, cs.ativo, cs.idcplano, cs.idtipoconta, cs.ctipo, cp.descricao FROM cplanos cs INNER JOIN cplano cp ON cs.idcplano = cp.idcplano;"; - using (SqlDataAdapter sqlDataAdapter = new SqlDataAdapter()) - { - sqlDataAdapter.SelectCommand = sqlCommand; - sqlDataAdapter.Fill(dataTable); - } - } - } - return CustomMap.MapPlanos(dataTable); - } - - public Planos FindById(long id) - { - PlanosDb planosDb = base.FindEntityById(id); - return ApplicationMapper.Mapper.Map(planosDb); - } - - public List FindByPlanoId(long id) - { - List list = ( - from x in base.All() - where x.Plano.Id == id - select x).ToList(); - return ApplicationMapper.Mapper.Map, List>(list); - } - - public Planos Merge(Planos planos) - { - PlanosDb planosDb = ApplicationMapper.Mapper.Map(planos); - base.Merge(planosDb); - return ApplicationMapper.Mapper.Map(planosDb); - } - - public Planos SaveOrUpdate(Planos planos) - { - PlanosDb planosDb = ApplicationMapper.Mapper.Map(planos); - this.SaveOrUpdate(planosDb); - return ApplicationMapper.Mapper.Map(planosDb); - } - } -} \ No newline at end of file -- cgit v1.2.3