Esempio n. 1
0
 public ActionResult Delete(int id, Product collection)
 {
     try
     {
         // TODO: Add delete logic here
         var result = new ProductDb().DeleteProduct(ref err, ref rows, id);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
Esempio n. 2
0
 public ActionResult Edit(int id, Product collection)
 {
     try
     {
         // TODO: Add update logic here
         var result = new ProductDb().InsertUpdateProduct(ref err, ref rows, collection);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
Esempio n. 3
0
        // GET: Product/Delete/5
        public ActionResult Delete(int id)
        {
            var product = new ProductDb().GetProductByID(ref err, id);

            return(View(product));
        }
Esempio n. 4
0
        // GET: Product
        public ActionResult Index()
        {
            var products = new ProductDb().GetProducts(ref err);

            return(View(products));
        }