public ActionResult DeleteConfirmed(int id) { UserBoardgameComment userBoardgameComment = db.UserBoardgameComments.Find(id); db.UserBoardgameComments.Remove(userBoardgameComment); db.SaveChanges(); return(RedirectToAction("Index")); }
public static void AddNote(UserBoardgameComment comment, string userID) { var result = from netUser in db.AspNetUsers where netUser.Id == userID select netUser; AspNetUser user = result.FirstOrDefault(); user.UserBoardgameComments.Add(comment); db.SaveChanges(); }
public ActionResult Edit([Bind(Include = "UserBoardgameCommentID,ASPUsersID,LocalBoardgameID,BoardgameComment")] UserBoardgameComment userBoardgameComment) { if (ModelState.IsValid) { db.Entry(userBoardgameComment).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ASPUsersID = new SelectList(db.AspNetUsers, "Id", "Email", userBoardgameComment.ASPUsersID); ViewBag.LocalBoardgameID = new SelectList(db.BoardGames, "LocalBoardgameID", "Thumbnail", userBoardgameComment.LocalBoardgameID); return(View(userBoardgameComment)); }
// GET: UserBoardgameComments/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } UserBoardgameComment userBoardgameComment = db.UserBoardgameComments.Find(id); if (userBoardgameComment == null) { return(HttpNotFound()); } return(View(userBoardgameComment)); }
// GET: UserBoardgameComments/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } UserBoardgameComment userBoardgameComment = db.UserBoardgameComments.Find(id); if (userBoardgameComment == null) { return(HttpNotFound()); } ViewBag.ASPUsersID = new SelectList(db.AspNetUsers, "Id", "Email", userBoardgameComment.ASPUsersID); ViewBag.LocalBoardgameID = new SelectList(db.BoardGames, "LocalBoardgameID", "Thumbnail", userBoardgameComment.LocalBoardgameID); return(View(userBoardgameComment)); }
public static void RemoveNote(UserBoardgameComment comment, string userID) { db.UserBoardgameComments.Remove(comment); db.SaveChanges(); }
public static void ChangeNote(UserBoardgameComment comment, string userID) { db.Entry(comment).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); }