public ActionResult Edit(product p)
 {
     var res = prod.EditProduct(p);
     var pr = prod.GetProduct(p.product_id);
     ViewBag.Response = res;
     return View(pr);
 }
Exemplo n.º 2
0
        public int EditProduct(product obj)
        {
            var p = prod.Edit(obj);

            return p == true ? 1 : 0;

        }
        public product createObject(string pname, string pdescription, string rnumber, decimal? pprice, int? quantity)
        {
            var p = new product()
            {
                product_name = pname,
                product_description = pdescription,
                reference_number = rnumber,
                product_price = pprice,
                quantity = quantity,
                active = true
            };

            return p;
        }
Exemplo n.º 4
0
        public int AddProduct(product item)
        {
            var res = prod.Add(item);

            return res == true ? 1 : 0;
        }