public ActionResult DeleteConfirmed(int id) { NGroupMessageTeacher nGroupMessageTeacher = db.NGroupMessageTeachers.Find(id); db.NGroupMessageTeachers.Remove(nGroupMessageTeacher); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "GroupID,TID,message,Time,Media")] NGroupMessageTeacher nGroupMessageTeacher) { if (ModelState.IsValid) { db.Entry(nGroupMessageTeacher).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.GroupID = new SelectList(db.Groups, "GroupID", "GroupName", nGroupMessageTeacher.GroupID); ViewBag.TID = new SelectList(db.Teachers, "TID", "Name", nGroupMessageTeacher.TID); return(View(nGroupMessageTeacher)); }
// GET: NGroupMessageTeachers/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } NGroupMessageTeacher nGroupMessageTeacher = db.NGroupMessageTeachers.Find(id); if (nGroupMessageTeacher == null) { return(HttpNotFound()); } return(View(nGroupMessageTeacher)); }
// GET: NGroupMessageTeachers/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } NGroupMessageTeacher nGroupMessageTeacher = db.NGroupMessageTeachers.Find(id); if (nGroupMessageTeacher == null) { return(HttpNotFound()); } ViewBag.GroupID = new SelectList(db.Groups, "GroupID", "GroupName", nGroupMessageTeacher.GroupID); ViewBag.TID = new SelectList(db.Teachers, "TID", "Name", nGroupMessageTeacher.TID); return(View(nGroupMessageTeacher)); }