public ActionResult DeleteConfirmed(int id) { tblClassTeacher tblclassteacher = _db.tblClassTeachers.Find(id); _db.tblClassTeachers.Remove(tblclassteacher); _db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ClassTeacherId,ClassId,UserId,CreateDatetime,ChangeDatetime")] tblClassTeacher tblclassteacher) { if (ModelState.IsValid) { _db.Entry(tblclassteacher).State = EntityState.Modified; _db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ClassId = new SelectList(_db.tblClasses, "ClassId", "ClassDesc", tblclassteacher.ClassId); ViewBag.UserId = new SelectList(_db.tblUsers, "UserId", "UserEmail", tblclassteacher.UserId); return(View(tblclassteacher)); }
// GET: /Default1/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tblClassTeacher tblclassteacher = _db.tblClassTeachers.Find(id); if (tblclassteacher == null) { return(HttpNotFound()); } return(View(tblclassteacher)); }
// GET: /Default1/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tblClassTeacher tblclassteacher = _db.tblClassTeachers.Find(id); if (tblclassteacher == null) { return(HttpNotFound()); } ViewBag.ClassId = new SelectList(_db.tblClasses, "ClassId", "ClassDesc", tblclassteacher.ClassId); ViewBag.UserId = new SelectList(_db.tblUsers, "UserId", "UserEmail", tblclassteacher.UserId); return(View(tblclassteacher)); }