public ActionResult DeleteConfirmed(int id) { HackySack hackySack = db.hackySacks.Find(id); db.hackySacks.Remove(hackySack); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ID,Color,FillBeads,Type,Price,Quantity")] HackySack hackySack) { if (ModelState.IsValid) { db.Entry(hackySack).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(hackySack)); }
public ActionResult Create([Bind(Include = "ID,Color,FillBeads,Type,Price,Quantity")] HackySack hackySack) { if (ModelState.IsValid) { db.hackySacks.Add(hackySack); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(hackySack)); }
// GET: HackySacks/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } HackySack hackySack = db.hackySacks.Find(id); if (hackySack == null) { return(HttpNotFound()); } return(View(hackySack)); }