public ActionResult DeleteConfirmed(int id) { SupportingTeacher supportingTeacher = db.SupportingTeacher.Find(id); db.SupportingTeacher.Remove(supportingTeacher); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ID,ModuleID,TeacherID")] SupportingTeacher supportingTeacher) { if (ModelState.IsValid) { db.Entry(supportingTeacher).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ModuleID = new SelectList(db.Module, "ID", "ModuleCode", supportingTeacher.ModuleID); ViewBag.TeacherID = new SelectList(db.Teacher, "ID", "FirstName", supportingTeacher.TeacherID); return(View(supportingTeacher)); }
public ActionResult AddSupportingTeacher(int moduleID, int teacherID) { SupportingTeacher teacher = new SupportingTeacher(); teacher.ModuleID = moduleID; teacher.TeacherID = teacherID; if (ModelState.IsValid) { db.SupportingTeacher.Add(teacher); db.SaveChanges(); return(RedirectToAction("Index")); } return(View()); }
// GET: SupportingTeachers/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } SupportingTeacher supportingTeacher = db.SupportingTeacher.Find(id); if (supportingTeacher == null) { return(HttpNotFound()); } return(View(supportingTeacher)); }
// GET: SupportingTeachers/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } SupportingTeacher supportingTeacher = db.SupportingTeacher.Find(id); if (supportingTeacher == null) { return(HttpNotFound()); } ViewBag.ModuleID = new SelectList(db.Module, "ID", "ModuleCode", supportingTeacher.ModuleID); ViewBag.TeacherID = new SelectList(db.Teacher, "ID", "FirstName", supportingTeacher.TeacherID); return(View(supportingTeacher)); }