コード例 #1
0
        /// <summary>
        ///     Obtiene un CostoOrganizacionInfo por Id
        /// </summary>
        /// <param name="infoId"></param>
        /// <returns></returns>
        internal CostoOrganizacionInfo ObtenerPorID(int infoId)
        {
            CostoOrganizacionInfo result = null;

            try
            {
                Logger.Info();
                Dictionary <string, object> parameters = AuxCostoOrganizacionDAL.ObtenerParametroPorID(infoId);
                DataSet ds = Retrieve("[dbo].[CostoOrganizacion_ObtenerPorID]", parameters);
                if (ValidateDataSet(ds))
                {
                    result = MapCostoOrganizacionDAL.ObtenerPorID(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 CostoOrganizacions filtrando por el estatus Activo = 1, Inactivo = 0
        /// </summary>
        /// <returns></returns>
        internal IList <CostoOrganizacionInfo> ObtenerTodos(EstatusEnum estatus)
        {
            try
            {
                Logger.Info();
                Dictionary <string, object> parameters = AuxCostoOrganizacionDAL.ObtenerTodos(estatus);
                DataSet ds = Retrieve("CostoOrganizacion_ObtenerTodos", parameters);
                IList <CostoOrganizacionInfo> result = null;
                if (ValidateDataSet(ds))
                {
                    result = MapCostoOrganizacionDAL.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);
            }
        }
コード例 #3
0
        /// <summary>
        ///     Obtiene un lista paginada
        /// </summary>
        /// <param name="pagina"></param>ObtenerPorOrganizacion
        /// <param name="filtro"></param>
        /// <returns></returns>
        internal ResultadoInfo <CostoOrganizacionInfo> ObtenerPorPagina(PaginacionInfo pagina, CostoOrganizacionInfo filtro)
        {
            ResultadoInfo <CostoOrganizacionInfo> costoOrganizacionLista = null;

            try
            {
                Dictionary <string, object> parameters = AuxCostoOrganizacionDAL.ObtenerParametrosPorPagina(pagina, filtro);
                DataSet ds = Retrieve("CostoOrganizacion_ObtenerPorPagina", parameters);
                if (ValidateDataSet(ds))
                {
                    costoOrganizacionLista = MapCostoOrganizacionDAL.ObtenerPorPagina(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(costoOrganizacionLista);
        }
コード例 #4
0
        /// <summary>
        ///     Metodo que crear un CostoOrganizacion
        /// </summary>
        /// <param name="info"></param>
        internal int Crear(CostoOrganizacionInfo info)
        {
            int infoId;

            try
            {
                Logger.Info();
                Dictionary <string, object> parameters = AuxCostoOrganizacionDAL.ObtenerParametrosGuardado(info);
                infoId = Create("[dbo].[CostoOrganizacion_Crear]", parameters);
            }
            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(infoId);
        }
コード例 #5
0
 /// <summary>
 ///     Metodo que actualiza un CostoOrganizacion
 /// </summary>
 /// <param name="info"></param>
 internal void Actualizar(CostoOrganizacionInfo info)
 {
     try
     {
         Dictionary <string, object> parameters = AuxCostoOrganizacionDAL.ObtenerParametrosActualizar(info);
         Update("[dbo].[CostoOrganizacion_Actualizar]", parameters);
     }
     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);
     }
 }