public ActionResult DeleteConfirmed(int id) { t_CommentVotes t_CommentVotes = db.t_CommentVotes.Find(id); db.t_CommentVotes.Remove(t_CommentVotes); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "VoteID,CommentID,UserID,IsUpvote")] t_CommentVotes t_CommentVotes) { if (ModelState.IsValid) { db.Entry(t_CommentVotes).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CommentID = new SelectList(db.t_Comments, "CommentID", "Text", t_CommentVotes.CommentID); ViewBag.UserID = new SelectList(db.t_Users, "UserID", "Username", t_CommentVotes.UserID); return(View(t_CommentVotes)); }
// GET: CommentVotes/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } t_CommentVotes t_CommentVotes = db.t_CommentVotes.Find(id); if (t_CommentVotes == null) { return(HttpNotFound()); } return(View(t_CommentVotes)); }
// GET: CommentVotes/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } t_CommentVotes t_CommentVotes = db.t_CommentVotes.Find(id); if (t_CommentVotes == null) { return(HttpNotFound()); } ViewBag.CommentID = new SelectList(db.t_Comments, "CommentID", "Text", t_CommentVotes.CommentID); ViewBag.UserID = new SelectList(db.t_Users, "UserID", "Username", t_CommentVotes.UserID); return(View(t_CommentVotes)); }