public ActionResult DeleteConfirmed(int id) { itemsForSale itemsForSale = db.itemsForSales.Find(id); db.itemsForSales.Remove(itemsForSale); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "itemID,userID,name,price,description,image,category")] itemsForSale itemsForSale) { if (ModelState.IsValid) { db.Entry(itemsForSale).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(itemsForSale)); }
public ActionResult Create([Bind(Include = "itemID,userID,name,price,description,image,category")] itemsForSale itemsForSale) { if (ModelState.IsValid) { db.itemsForSales.Add(itemsForSale); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(itemsForSale)); }
// GET: itemsForSales/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } itemsForSale itemsForSale = db.itemsForSales.Find(id); if (itemsForSale == null) { return(HttpNotFound()); } return(View(itemsForSale)); }