public ActionResult DeleteConfirmed(int id) { CommentsSet commentsSet = db.CommentsSet.Find(id); db.CommentsSet.Remove(commentsSet); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Text,DateTime,User_Id,Game_Id")] CommentsSet commentsSet) { if (ModelState.IsValid) { db.Entry(commentsSet).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Game_Id = new SelectList(db.GameSet, "Id", "Name", commentsSet.Game_Id); ViewBag.User_Id = new SelectList(db.UserSet, "Id", "Login", commentsSet.User_Id); return(View(commentsSet)); }
// GET: CommentsSets/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CommentsSet commentsSet = db.CommentsSet.Find(id); if (commentsSet == null) { return(HttpNotFound()); } return(View(commentsSet)); }
// GET: CommentsSets/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CommentsSet commentsSet = db.CommentsSet.Find(id); if (commentsSet == null) { return(HttpNotFound()); } ViewBag.Game_Id = new SelectList(db.GameSet, "Id", "Name", commentsSet.Game_Id); ViewBag.User_Id = new SelectList(db.UserSet, "Id", "Login", commentsSet.User_Id); return(View(commentsSet)); }