public ActionResult DeleteConfirmed(int id) { ShoeStuff shoeStuff = db.ShoeStuffs.Find(id); db.ShoeStuffs.Remove(shoeStuff); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ShoeID,Name,Photo,Type,Color,Season,Occasion")] ShoeStuff shoeStuff) { if (ModelState.IsValid) { db.Entry(shoeStuff).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(shoeStuff)); }
public ActionResult Create([Bind(Include = "ShoeID,Name,Photo,Type,Color,Season,Occasion")] ShoeStuff shoeStuff) { if (ModelState.IsValid) { db.ShoeStuffs.Add(shoeStuff); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(shoeStuff)); }
// GET: ShoeStuffs/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ShoeStuff shoeStuff = db.ShoeStuffs.Find(id); if (shoeStuff == null) { return(HttpNotFound()); } return(View(shoeStuff)); }