81 lines
3.1 KiB
C#
81 lines
3.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using ULA.Cathay.CreditoModel.Credito;
|
|
using System.Data.Entity;
|
|
using Ultimus.Utilitarios;
|
|
|
|
namespace ULA.Cathay.CreditoModel.DAL.Credito
|
|
{
|
|
public class DocumentosEtapaDAL
|
|
{
|
|
|
|
private UltimusLogs logger = new UltimusLogs("DocumentosEtapaDAL");
|
|
|
|
private CreditoContex db = new CreditoContex();
|
|
|
|
#region Obtener
|
|
|
|
public List<DocumentosEtapa> Obtener(int IdEtapa)
|
|
{
|
|
List<DocumentosEtapa> listaDocumentosEtapa = null;
|
|
|
|
try
|
|
{
|
|
listaDocumentosEtapa = new List<DocumentosEtapa>();
|
|
|
|
listaDocumentosEtapa = db.DocumentosEtapa
|
|
.Include(e => e.TipoDocumento)
|
|
.Include(e => e.Etapas)
|
|
.Include(e => e.TipoFacilidad)
|
|
.Where(e=> e.IdEtapa == IdEtapa && e.Estado == true)
|
|
.AsNoTracking()
|
|
.ToList();
|
|
|
|
foreach (var itemDocumentosEtapa in listaDocumentosEtapa)
|
|
{
|
|
itemDocumentosEtapa.Etapas.ClearVirtualProperties();
|
|
itemDocumentosEtapa.TipoDocumento.ClearVirtualProperties();
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
logger.Error(ex);
|
|
}
|
|
return listaDocumentosEtapa;
|
|
}
|
|
|
|
|
|
public List<DocumentosCategoria> Obtener(int? idtipocliente, int? idtipocategoria, int? idclasificacioncliente, int? idtipoingreso)
|
|
{
|
|
List<DocumentosCategoria> listaDocumentosCategoria = null;
|
|
|
|
try
|
|
{
|
|
listaDocumentosCategoria = new List<DocumentosCategoria>();
|
|
|
|
listaDocumentosCategoria = db.DocumentosCategoria
|
|
.Include(e => e.ClasificacionCliente)
|
|
.Include(e => e.TipoCategoria)
|
|
.Include(e => e.TipoCliente)
|
|
.Include(e => e.TipoDocumento)
|
|
.Include(e => e.TipoFuenteIngreso)
|
|
.Where(x => ((x.IdTipoCliente == idtipocliente) || (idtipocliente == null))
|
|
&& ((x.IdTipoCategoria == idtipocategoria) || (idtipocategoria == null))
|
|
&& ((x.IdClasificacionCliente == idclasificacioncliente) || (idclasificacioncliente == null))
|
|
&& ((x.IdTipoIngreso == idtipoingreso)) || (idtipoingreso == null))
|
|
.ToList();
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
logger.Error(ex);
|
|
}
|
|
return listaDocumentosCategoria;
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
}
|
|
}
|