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