public ActionResult DeleteConfirmed(int id) { StudentPlan studentPlan = db.StudentPlans.Find(id); db.StudentPlans.Remove(studentPlan); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "StudentPlanId,EnrollmentId,StudentId,CourseId,SemesterId,ProgramId")] StudentPlan studentPlan) { if (ModelState.IsValid) { db.Entry(studentPlan).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CourseId = new SelectList(db.Course, "CourseId", "Number", studentPlan.CourseId); ViewBag.ProgramId = new SelectList(db.Program, "ProgramId", "Name", studentPlan.ProgramId); ViewBag.SemesterId = new SelectList(db.Semester, "SemesterId", "Season", studentPlan.SemesterId); ViewBag.StudentId = new SelectList(db.Student, "StudentId", "UserId", studentPlan.StudentId); return(View(studentPlan)); }
// GET: AdminStudentPlans/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } StudentPlan studentPlan = db.StudentPlans.Find(id); if (studentPlan == null) { return(HttpNotFound()); } return(View(studentPlan)); }
// GET: AdminStudentPlans/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } StudentPlan studentPlan = db.StudentPlans.Find(id); if (studentPlan == null) { return(HttpNotFound()); } ViewBag.CourseId = new SelectList(db.Course, "CourseId", "Number", studentPlan.CourseId); ViewBag.ProgramId = new SelectList(db.Program, "ProgramId", "Name", studentPlan.ProgramId); ViewBag.SemesterId = new SelectList(db.Semester, "SemesterId", "Season", studentPlan.SemesterId); ViewBag.StudentId = new SelectList(db.Student, "StudentId", "UserId", studentPlan.StudentId); return(View(studentPlan)); }