Ejemplo n.º 1
0
 /// <summary>
 ///  Obtiene una lista de Costos filtrando por el estatus Activo = 1, Inactivo = 0
 /// </summary>
 /// <returns></returns>
 internal IList <CostoInfo> ObtenerTodos(EstatusEnum estatus)
 {
     try
     {
         Logger.Info();
         Dictionary <string, object> parameters = AuxCostoDAL.ObtenerTodos(estatus);
         using (IDataReader reader = RetrieveReader("Costo_ObtenerTodos", parameters))
         {
             IList <CostoInfo> result = null;
             if (ValidateDataReader(reader))
             {
                 result = MapCostoDAL.ObtenerTodos(reader);
             }
             if (Connection.State == ConnectionState.Open)
             {
                 Connection.Close();
             }
             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);
     }
 }