public ActionResult DeleteConfirmed(int id) { Teacher_Class teacher_Class = db.Teacher_Class.Find(id); db.Teacher_Class.Remove(teacher_Class); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,TeacherId,ClassId")] Teacher_Class teacher_Class) { if (ModelState.IsValid) { db.Entry(teacher_Class).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ClassId = new SelectList(db.Classes, "Id", "ClassTitle", teacher_Class.ClassId); ViewBag.TeacherId = new SelectList(db.Teachers, "Id", "FirstName", teacher_Class.TeacherId); return(View(teacher_Class)); }
// GET: Teacher_Class/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Teacher_Class teacher_Class = db.Teacher_Class.Find(id); if (teacher_Class == null) { return(HttpNotFound()); } return(View(teacher_Class)); }
// GET: Teacher_Class/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Teacher_Class teacher_Class = db.Teacher_Class.Find(id); if (teacher_Class == null) { return(HttpNotFound()); } ViewBag.ClassId = new SelectList(db.Classes, "Id", "ClassTitle", teacher_Class.ClassId); ViewBag.TeacherId = new SelectList(db.Teachers, "Id", "FirstName", teacher_Class.TeacherId); return(View(teacher_Class)); }