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