public ActionResult DeleteConfirmed(int id) { DirectorComment directorcomment = db.DirectorComments.Find(id); db.DirectorComments.Remove(directorcomment); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "DirectorCommentID,DirectorID,Comment,DateAdded")] DirectorComment directorComment) { if (ModelState.IsValid) { db.Entry(directorComment).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.DirectorID = new SelectList(db.Directors, "DirectorID", "DirectorName", directorComment.DirectorID); return(View(directorComment)); }
public ActionResult Create([Bind(Include = "DirectorCommentID,DirectorID,DirectorName,UserID,Comment,Posted")] DirectorComment directorcomment) { if (ModelState.IsValid) { db.DirectorComments.Add(directorcomment); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.DirectorID = new SelectList(db.Directors, "DirectorID", "DirectorName", directorcomment.DirectorID); ViewBag.UserID = new SelectList(db.Users, "UserID", "UserName", directorcomment.UserID); return(View(directorcomment)); }
// GET: /DirectorComment/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } DirectorComment directorcomment = db.DirectorComments.Find(id); if (directorcomment == null) { return(HttpNotFound()); } return(View(directorcomment)); }
// GET: DirectorComments/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } DirectorComment directorComment = db.DirectorComments.Find(id); if (directorComment == null) { return(HttpNotFound()); } ViewBag.DirectorID = new SelectList(db.Directors, "DirectorID", "DirectorName", directorComment.DirectorID); return(View(directorComment)); }