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()); } }
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()); } }
// GET: Product/Delete/5 public ActionResult Delete(int id) { var product = new ProductDb().GetProductByID(ref err, id); return(View(product)); }
// GET: Product public ActionResult Index() { var products = new ProductDb().GetProducts(ref err); return(View(products)); }