示例#1
0
        /// <summary>
        /// Metodo para almacenar el gasto al inventario
        /// </summary>
        /// <param name="gastoInventarioID"></param>
        public GastoInventarioInfo ObtenerPorID(int gastoInventarioID)
        {
            GastoInventarioInfo gastoInventario = null;

            try
            {
                Logger.Info();
                var     parameters = AuxGastoInventarioDAL.ObtenerParametrosObtenerPorID(gastoInventarioID);
                DataSet ds         = Retrieve("GastoInventario_ObtenerPorID", parameters);
                if (ValidateDataSet(ds))
                {
                    gastoInventario = MapGastoInventarioDAL.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(gastoInventario);
        }
示例#2
0
        /// <summary>
        /// Metodo para almacenar el gasto al inventario
        /// </summary>
        /// <param name="gasto"></param>
        public int Guardar(GastoInventarioInfo gasto)
        {
            int gastoInventarioID;

            try
            {
                Logger.Info();
                var parameters = AuxGastoInventarioDAL.ObtenerParametrosGuardarGastoInventario(gasto);
                gastoInventarioID = Create("GastoInventario_GuardarGasto", 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(gastoInventarioID);
        }