public ActionResult DeleteConfirmed(int id) { Game_Sessions game_Sessions = db.Game_Sessions.Find(id); db.Game_Sessions.Remove(game_Sessions); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Game_Session_ID,Session_Start,Session_End,Game_ID,User_ID")] Game_Sessions game_Sessions) { if (ModelState.IsValid) { db.Entry(game_Sessions).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Game_ID = new SelectList(db.Games, "Game_ID", "Game_Name", game_Sessions.Game_ID); ViewBag.User_ID = new SelectList(db.Users, "User_ID", "User_Name", game_Sessions.Session_Users); return(View(game_Sessions)); }
// GET: Game_Sessions/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Game_Sessions game_Sessions = db.Game_Sessions.Find(id); if (game_Sessions == null) { return(HttpNotFound()); } return(View(game_Sessions)); }
// GET: Game_Sessions/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Game_Sessions game_Sessions = db.Game_Sessions.Find(id); if (game_Sessions == null) { return(HttpNotFound()); } ViewBag.Game_ID = new SelectList(db.Games, "Game_ID", "Game_Name", game_Sessions.Game_ID); ViewBag.User_ID = new SelectList(db.Users, "User_ID", "User_Name", game_Sessions.Session_Users); return(View(game_Sessions)); }