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); }
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); }