public ActionResult DeleteConfirmed(int id) { postType posttype = db.postType.Find(id); db.postType.Remove(posttype); db.SaveChanges(); return(RedirectToAction("Index")); }
// // GET: /post/Delete/5 public ActionResult Delete(int id = 0) { postType posttype = db.postType.Find(id); if (posttype == null) { return(HttpNotFound()); } return(View(posttype)); }
public ActionResult Edit(postType posttype) { if (ModelState.IsValid) { db.Entry(posttype).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(posttype)); }
public ActionResult Create(postType posttype) { if (ModelState.IsValid) { db.postType.Add(posttype); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(posttype)); }