diff options
| author | Lucas Faria Mendes <lucas.fariamo08@gmail.com> | 2026-03-30 13:38:18 +0000 |
|---|---|---|
| committer | Lucas Faria Mendes <lucas.fariamo08@gmail.com> | 2026-03-30 13:38:18 +0000 |
| commit | 1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1 (patch) | |
| tree | e1c3b20ea08f0cf71122a1e73f0d395f8fd83874 /Gestor.Infrastructure/Gestor.Infrastructure.Repository.Logic/EstipulanteRepository.cs | |
| parent | 674ca83ba9243a9e95a7568c797668dab6aee26a (diff) | |
| download | gestor-1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1.tar.gz gestor-1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1.zip | |
chore: location
Diffstat (limited to 'Gestor.Infrastructure/Gestor.Infrastructure.Repository.Logic/EstipulanteRepository.cs')
| -rw-r--r-- | Gestor.Infrastructure/Gestor.Infrastructure.Repository.Logic/EstipulanteRepository.cs | 93 |
1 files changed, 0 insertions, 93 deletions
diff --git a/Gestor.Infrastructure/Gestor.Infrastructure.Repository.Logic/EstipulanteRepository.cs b/Gestor.Infrastructure/Gestor.Infrastructure.Repository.Logic/EstipulanteRepository.cs deleted file mode 100644 index b0ab6cd..0000000 --- a/Gestor.Infrastructure/Gestor.Infrastructure.Repository.Logic/EstipulanteRepository.cs +++ /dev/null @@ -1,93 +0,0 @@ -using AutoMapper;
-using Gestor.Infrastructure.Entities.Seguros;
-using Gestor.Infrastructure.Mappers;
-using Gestor.Infrastructure.Repository.Generic;
-using Gestor.Infrastructure.Repository.Interface;
-using Gestor.Infrastructure.UnitOfWork.Generic;
-using Gestor.Model.Domain.Seguros;
-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;
-
-namespace Gestor.Infrastructure.Repository.Logic
-{
- public class EstipulanteRepository : GenericRepository<EstipulanteDb>, IEstipulanteRepository, IGenericRepository<EstipulanteDb>
- {
- private readonly GenericUnitOfWork _unitOfWork;
-
- public EstipulanteRepository(GenericUnitOfWork unitOfWork) : base(unitOfWork.Session)
- {
- this._unitOfWork = unitOfWork;
- }
-
- public void Delete(long id)
- {
- base.Delete(base.FindEntityById(id));
- }
-
- public List<Estipulante> Find(string value, long idempresa = 0L)
- {
- string str = (idempresa == 0 ? string.Format(" AND idempresa = {0}", idempresa) : "");
- string str1 = string.Concat(new string[] { " AND (UPPER(ISNULL(nome, '')) LIKE '%", value.ToUpper(), "%' OR UPPER(ISNULL(cpfcnpj, '')) LIKE '%", value.ToUpper(), "%') " });
- return this.Select(string.Concat(str, str1));
- }
-
- public List<Estipulante> Find()
- {
- return this.Select("");
- }
-
- public Estipulante FindById(long id)
- {
- EstipulanteDb estipulanteDb = base.FindEntityById(id);
- return ApplicationMapper.Mapper.Map<EstipulanteDb, Estipulante>(estipulanteDb);
- }
-
- public Estipulante Merge(Estipulante estipulante)
- {
- EstipulanteDb estipulanteDb = ApplicationMapper.Mapper.Map<Estipulante, EstipulanteDb>(estipulante);
- base.Merge(estipulanteDb);
- return ApplicationMapper.Mapper.Map<EstipulanteDb, Estipulante>(estipulanteDb);
- }
-
- public Estipulante SaveOrUpdate(Estipulante estipulante)
- {
- EstipulanteDb estipulanteDb = ApplicationMapper.Mapper.Map<Estipulante, EstipulanteDb>(estipulante);
- this.SaveOrUpdate(estipulanteDb);
- return ApplicationMapper.Mapper.Map<EstipulanteDb, Estipulante>(estipulanteDb);
- }
-
- private List<Estipulante> Select(string condition)
- {
- object connection;
- DataTable dataTable = new DataTable();
- SessionFactoryImpl sessionFactory = this._unitOfWork.Session.SessionFactory as SessionFactoryImpl;
- if (sessionFactory != null)
- {
- connection = sessionFactory.ConnectionProvider.GetConnection();
- }
- else
- {
- connection = null;
- }
- using (SqlConnection sqlConnection = connection as SqlConnection)
- {
- using (SqlCommand sqlCommand = sqlConnection.CreateCommand())
- {
- sqlCommand.CommandText = string.Concat("SELECT DISTINCT * FROM estipulante WHERE 1=1 ", condition, ";");
- using (SqlDataAdapter sqlDataAdapter = new SqlDataAdapter())
- {
- sqlDataAdapter.SelectCommand = sqlCommand;
- sqlDataAdapter.Fill(dataTable);
- }
- }
- }
- return dataTable.MapEstipulante();
- }
- }
-}
\ No newline at end of file |