コード例 #1
0
        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"));
        }
コード例 #2
0
 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));
 }
コード例 #3
0
        // 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));
        }
コード例 #4
0
        // 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));
        }