using System; using System.Linq; using Ultimus.Utilitarios; using ULA.Cathay.CreditoModel.Credito; namespace ULA.Cathay.CreditoModel.DAL.Credito { public class ConfiguracionNotificacionDAL { private UltimusLogs logs = new UltimusLogs("ConfiguracionNotificacionDAL"); public ConfiguracionNotificacion Obtener(string DescripcionEtapa, string NombreProceso, int IdNotificationType) { ConfiguracionNotificacion resp = new ConfiguracionNotificacion(); try { using (CreditoContex db = new CreditoContex()) { var _Etapas = db.Etapas.Where(x => x.DescripcionEtapa.Trim() == DescripcionEtapa.Trim()).FirstOrDefault(); var _Procesos = db.Procesos.Where(x => x.NombreProceso.Trim() == NombreProceso.Trim()).FirstOrDefault(); resp = db.ConfiguracionNotificacion.Where(x => x.IdEtapa == _Etapas.IdEtapa && x.IdNotificationType == IdNotificationType && x.IdProceso == _Procesos.IdProceso).FirstOrDefault(); } } catch (Exception ex) { logs.Error(ex); } return resp; } } }