示例#1
0
        /// <summary>
        ///   Obtiene una lista de TipoGanado filtrando por el estatus Activo = 1, Inactivo = 0
        /// </summary>
        /// <returns></returns>
        internal List <TipoGanadoInfo> ObtenerTodos(EstatusEnum estatus)
        {
            List <TipoGanadoInfo> result = null;

            try
            {
                Logger.Info();
                Dictionary <string, object> parameters = AuxTipoGanadoDAL.ObtenerTodos(estatus);
                DataSet ds = Retrieve("TipoGanado_ObtenerTodos", parameters);
                if (ValidateDataSet(ds))
                {
                    result = MapTipoGanadoDAL.ObtenerTodos(ds);
                }
            }
            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);
            }
            return(result);
        }
示例#2
0
        /// <summary>
        ///     Obtiene una lista de todos los TipoOrganizaciones
        /// </summary>
        /// <returns></returns>
        internal List <TipoGanadoInfo> ObtenerTodos()
        {
            List <TipoGanadoInfo> result = null;

            try
            {
                Logger.Info();
                DataSet ds = Retrieve("[dbo].[TipoGanado_ObtenerTodos]");
                if (ValidateDataSet(ds))
                {
                    result = MapTipoGanadoDAL.ObtenerTodos(ds);
                }
            }
            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);
            }
            return(result);
        }