public ActionResult DeleteConfirmed(int id) { FACULTY_TABLE faculty_table = db.FACULTY_TABLE.Find(id); db.FACULTY_TABLE.Remove(faculty_table); db.SaveChanges(); TempData["notice"] = "The Campus Has Been Successfully Deleted!"; return(RedirectToAction("Index")); }
// // GET: /Faculty/Edit/5 public ActionResult Edit(int id = 0) { FACULTY_TABLE faculty_table = db.FACULTY_TABLE.Find(id); if (faculty_table == null) { return(HttpNotFound()); } return(View(faculty_table)); }
public ActionResult Edit(FACULTY_TABLE faculty_table) { if (ModelState.IsValid) { db.Entry(faculty_table).State = EntityState.Modified; db.SaveChanges(); TempData["notice"] = "The Faculty Has Been Successfully Altered!"; return(RedirectToAction("Index")); } return(View(faculty_table)); }
public ActionResult Create(FACULTY_TABLE faculty_table) { //reset the id if (ModelState.ContainsKey("FACULTY_ID")) { ModelState["FACULTY_ID"].Errors.Clear(); } if (ModelState.IsValid) { db.FACULTY_TABLE.Add(faculty_table); db.SaveChanges(); TempData["notice"] = "New Faculty Has Been Successfully registered!"; return(RedirectToAction("Index")); } return(View(faculty_table)); }