public int InsertarProductoView(CEN_Detalle_Presentacion_Product objProd)
        {
            int           response = 0;
            SqlConnection con      = null;
            SqlCommand    cmd      = null;
            CADConexion   CadCx    = new CADConexion();

            try
            {
                con             = new SqlConnection(CadCx.CxSQL());
                cmd             = new SqlCommand("pa_registrar_detProducto", con);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@p_codProduc", objProd.codProductos);
                cmd.Parameters.AddWithValue("@p_codPresentacion", objProd.codDetPresents);
                cmd.Parameters.AddWithValue("@p_cantDetall", objProd.cantUniBases);
                cmd.Parameters.Add("@resultado", SqlDbType.Int).Direction = ParameterDirection.Output;
                con.Open();
                cmd.ExecuteNonQuery();
                response = Convert.ToInt32(cmd.Parameters["@resultado"].Value);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                con.Close();
            }
            return(response);
        }
Ejemplo n.º 2
0
        public int ActualizarDetalleProduct(CEN_Detalle_Presentacion_Product objDet, string codProducto, int codDetProd)
        {
            CADProductoView objCLNDetProduct = null;

            try
            {
                objCLNDetProduct = new CADProductoView();
                return(objCLNDetProduct.ActualizarDetProduct(objDet, codProducto, codDetProd));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 3
0
        public int InsertarDetProducto(CEN_Detalle_Presentacion_Product objDetProducto)
        {
            CADProductoView objCADdetProduct = null;

            try
            {
                objCADdetProduct = new CADProductoView();
                return(objCADdetProduct.InsertarProductoView(objDetProducto));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static int InsertDetalleProducto(string codProducto, int codPresentacion, int cantUB)
        {
            CLNProducto objCLNProduc = null;
            CEN_Detalle_Presentacion_Product objCENdetalle = new CEN_Detalle_Presentacion_Product()
            {
                codProductos   = codProducto,
                codDetPresents = Convert.ToInt32(codPresentacion),
                cantUniBases   = Convert.ToInt32(cantUB)
            };

            try
            {
                objCLNProduc = new CLNProducto();
                int ok = objCLNProduc.InsertarDetProducto(objCENdetalle);
                return(ok);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static int ActualizarDetProduct(int codPresentacion, int cantidad, string codProducto)
        {
            CEN_Detalle_Presentacion_Product objCENPresentacion = new CEN_Detalle_Presentacion_Product()
            {
                codDetPresents = Convert.ToInt16(codPresentacion),
                cantUniBases   = Convert.ToInt32(cantidad),
                codProductos   = Convert.ToString(codProducto)
            };
            CLNProducto objCLNProductoPresentacion = null;
            string      codProduct = codProducto;

            try
            {
                objCLNProductoPresentacion = new CLNProducto();
                int ok = objCLNProductoPresentacion.ActualizarDetalleProduct(objCENPresentacion, codProduct, codPresentacion);
                return(ok);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }