public ActionResult DeleteConfirmed(int id) { WardrobeType wardrobeType = db.WardrobeTypes.Find(id); db.WardrobeTypes.Remove(wardrobeType); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "TypeID,Description")] WardrobeType wardrobeType) { if (ModelState.IsValid) { db.Entry(wardrobeType).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(wardrobeType)); }
public ActionResult Create([Bind(Include = "TypeID,Description")] WardrobeType wardrobeType) { if (ModelState.IsValid) { db.WardrobeTypes.Add(wardrobeType); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(wardrobeType)); }
// GET: WardrobeTypes/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } WardrobeType wardrobeType = db.WardrobeTypes.Find(id); if (wardrobeType == null) { return(HttpNotFound()); } return(View(wardrobeType)); }