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