Example #1
0
 /// <summary>
 /// Obtiene un lista paginada
 /// </summary>
 /// <param name="pagina"></param>
 /// <param name="filtro"></param>
 /// <returns></returns>
 internal ResultadoInfo <RolInfo> ObtenerPorPagina(PaginacionInfo pagina, RolInfo filtro)
 {
     try
     {
         Dictionary <string, object> parameters = AuxRolDAL.ObtenerParametrosPorPagina(pagina, filtro);
         DataSet ds = Retrieve("Rol_ObtenerPorPagina", parameters);
         ResultadoInfo <RolInfo> result = null;
         if (ValidateDataSet(ds))
         {
             result = MapRolDAL.ObtenerPorPagina(ds);
         }
         return(result);
     }
     catch (SqlException ex)
     {
         Logger.Error(ex);
         throw new ExcepcionServicio(MethodBase.GetCurrentMethod(), ex);
     }
     catch (DataException ex)
     {
         Logger.Error(ex);
         throw new ExcepcionServicio(MethodBase.GetCurrentMethod(), ex);
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
         throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex);
     }
 }
Example #2
0
 /// <summary>
 /// Obtiene una lista de Niveles de Alerta del SP NivelAlerta_ObtenerNivelAlerta
 /// </summary>
 /// <returns>Lista de los niveles de alerta</returns>
 public IList <NivelAlertaInfo> ObtenerNivelAlerta()
 {
     try
     {
         Logger.Info();
         DataSet ds = Retrieve("NivelAlerta_ObtenerNivelAlerta");
         IList <NivelAlertaInfo> result;
         if (ValidateDataSet(ds))
         {
             result = MapRolDAL.ObtenerNivelAlerta(ds);
         }
         else
         {
             result = new List <NivelAlertaInfo>();
         }
         return(result);
     }
     catch (SqlException ex)
     {
         Logger.Error(ex);
         throw new ExcepcionServicio(MethodBase.GetCurrentMethod(), ex);
     }
     catch (DataException ex)
     {
         Logger.Error(ex);
         throw new ExcepcionServicio(MethodBase.GetCurrentMethod(), ex);
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
         throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex);
     }
 }
Example #3
0
 /// <summary>
 /// Obtiene una lista filtrando por el estatus Activo = 1, Inactivo = 0
 /// </summary>
 /// <returns></returns>
 internal IList <RolInfo> ObtenerTodos(EstatusEnum estatus)
 {
     try
     {
         Logger.Info();
         Dictionary <string, object> parameters = AuxRolDAL.ObtenerTodos(estatus);
         DataSet         ds     = Retrieve("Rol_ObtenerTodos", parameters);
         IList <RolInfo> result = null;
         if (ValidateDataSet(ds))
         {
             result = MapRolDAL.ObtenerTodos(ds);
         }
         return(result);
     }
     catch (SqlException ex)
     {
         Logger.Error(ex);
         throw new ExcepcionServicio(MethodBase.GetCurrentMethod(), ex);
     }
     catch (DataException ex)
     {
         Logger.Error(ex);
         throw new ExcepcionServicio(MethodBase.GetCurrentMethod(), ex);
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
         throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex);
     }
 }
Example #4
0
 /// <summary>
 /// Obtiene un registro de Rol
 /// </summary>
 /// <param name="descripcion">DescripciĆ³n de la Rol</param>
 /// <returns></returns>
 internal RolInfo ObtenerPorDescripcion(string descripcion)
 {
     try
     {
         Logger.Info();
         Dictionary <string, object> parameters = AuxRolDAL.ObtenerParametrosPorDescripcion(descripcion);
         DataSet ds     = Retrieve("Rol_ObtenerPorDescripcion", parameters);
         RolInfo result = null;
         if (ValidateDataSet(ds))
         {
             result = MapRolDAL.ObtenerPorDescripcion(ds);
         }
         return(result);
     }
     catch (SqlException ex)
     {
         Logger.Error(ex);
         throw new ExcepcionServicio(MethodBase.GetCurrentMethod(), ex);
     }
     catch (DataException ex)
     {
         Logger.Error(ex);
         throw new ExcepcionServicio(MethodBase.GetCurrentMethod(), ex);
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
         throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex);
     }
 }
Example #5
0
 /// <summary>
 /// Obtiene una lista de Rol
 /// </summary>
 /// <returns></returns>
 internal IList <RolInfo> ObtenerTodos()
 {
     try
     {
         Logger.Info();
         DataSet         ds     = Retrieve("Rol_ObtenerTodos");
         IList <RolInfo> result = null;
         if (ValidateDataSet(ds))
         {
             result = MapRolDAL.ObtenerTodos(ds);
         }
         return(result);
     }
     catch (SqlException ex)
     {
         Logger.Error(ex);
         throw new ExcepcionServicio(MethodBase.GetCurrentMethod(), ex);
     }
     catch (DataException ex)
     {
         Logger.Error(ex);
         throw new ExcepcionServicio(MethodBase.GetCurrentMethod(), ex);
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
         throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex);
     }
 }