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