public ActionResult DeleteConfirmed(int id) { Enrollment_Staff enrollment_Staff = db.Enrollment_Staffs.Find(id); db.Enrollment_Staffs.Remove(enrollment_Staff); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Enrollment_StaffID,DepartmentID,InstructorID,Staff_Title")] Enrollment_Staff enrollment_Staff) { if (ModelState.IsValid) { db.Entry(enrollment_Staff).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.DepartmentID = new SelectList(db.Departments, "DepartmentID", "Title", enrollment_Staff.DepartmentID); ViewBag.InstructorID = new SelectList(db.Instructors, "InstructorID", "LastName", enrollment_Staff.InstructorID); return(View(enrollment_Staff)); }
// GET: Enrollment_Staff/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Enrollment_Staff enrollment_Staff = db.Enrollment_Staffs.Find(id); if (enrollment_Staff == null) { return(HttpNotFound()); } return(View(enrollment_Staff)); }
// GET: Enrollment_Staff/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Enrollment_Staff enrollment_Staff = db.Enrollment_Staffs.Find(id); if (enrollment_Staff == null) { return(HttpNotFound()); } ViewBag.DepartmentID = new SelectList(db.Departments, "DepartmentID", "Title", enrollment_Staff.DepartmentID); ViewBag.InstructorID = new SelectList(db.Instructors, "InstructorID", "LastName", enrollment_Staff.InstructorID); return(View(enrollment_Staff)); }