60 lines
1.5 KiB
C#
60 lines
1.5 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using ULA.Cathay.CreditoModel.Credito;
|
|
using Ultimus.Utilitarios;
|
|
using System.Data.Entity.Validation;
|
|
|
|
namespace ULA.Cathay.CreditoModel.DAL.Credito
|
|
{
|
|
public class NotarioDAL
|
|
{
|
|
private UltimusLogs logger = new UltimusLogs("Notario");
|
|
|
|
public Notario ObtenerNotario(int? IdNotario)
|
|
{
|
|
Notario listaNotario = new Notario();
|
|
|
|
try
|
|
{
|
|
using (CreditoContex db = new CreditoContex())
|
|
listaNotario = db.Notario.Where(e => e.IdNotario == IdNotario).FirstOrDefault(); ;
|
|
}
|
|
catch (DbEntityValidationException ex1)
|
|
{
|
|
logger.Error(ex1);
|
|
throw ex1;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
logger.Error(ex);
|
|
throw ex;
|
|
}
|
|
|
|
return listaNotario;
|
|
}
|
|
|
|
public List<Notario> Obtener()
|
|
{
|
|
List<Notario> respuesta = new List<Notario>();
|
|
try
|
|
{
|
|
using (CreditoContex db = new CreditoContex())
|
|
respuesta = db.Notario.Where(x => x.Estado == true).ToList();
|
|
}
|
|
catch (DbEntityValidationException ex1)
|
|
{
|
|
logger.Error(ex1);
|
|
throw ex1;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
logger.Error(ex);
|
|
throw ex;
|
|
}
|
|
|
|
return respuesta;
|
|
|
|
}
|
|
}
|
|
}
|