Example #1
0
 public ActionResult DeleteProduct(int id, ProductBEAN productBEAN)  //Deletes the requested Product (identified by the Product ID)
 {
     try
     {
         Product myProduct = _productService.GetProduct(id);
         _productService.DeleteProduct(myProduct);
     }
     catch
     {
     }
     return(RedirectToAction("Products", new { controller = "Product" }));
 }
Example #2
0
        public ActionResult EditProduct(int id, ProductBEAN productBEAN) //Edits a product in the Product Table
        {
            try
            {
                Product myProduct = new Product
                {
                    ProductId = productBEAN.ProductId, //Collects Data to be edited from the BEAN
                    MeatId    = productBEAN.MeatId,
                    Name      = productBEAN.Name
                };

                _productService.EditProduct(myProduct); //Pulls the Method for Editing Products from the DAO
            }
            catch
            {
            }
            return(RedirectToAction("Products", new { controller = "Product" }));
        }