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