public ActionResult DeleteConfirmed(int id) { StudentCounselor studentCounselor = db.StudentCounselors.Find(id); db.StudentCounselors.Remove(studentCounselor); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ID,StudentID,CounselorID")] StudentCounselor studentCounselor) { if (ModelState.IsValid) { db.Entry(studentCounselor).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CounselorID = new SelectList(db.Counselors, "ID", "LastName", studentCounselor.CounselorID); ViewBag.StudentID = new SelectList(db.Students, "ID", "LastName", studentCounselor.StudentID); return(View(studentCounselor)); }
// GET: StudentCounselors/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } StudentCounselor studentCounselor = db.StudentCounselors.Find(id); if (studentCounselor == null) { return(HttpNotFound()); } return(View(studentCounselor)); }
// GET: StudentCounselors/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } StudentCounselor studentCounselor = db.StudentCounselors.Find(id); if (studentCounselor == null) { return(HttpNotFound()); } ViewBag.CounselorID = new SelectList(db.Counselors, "ID", "LastName", studentCounselor.CounselorID); ViewBag.StudentID = new SelectList(db.Students, "ID", "LastName", studentCounselor.StudentID); return(View(studentCounselor)); }