예제 #1
0
        // GET: Matches/Edit/5
        public ActionResult Edit(int? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            Match match = db.Match.Find(id);
            if (match == null)
            {
                return HttpNotFound();
            }

            UserHandler UserHandler = new UserHandler();
            var UserProfileInfoID = UserHandler.GetUserLogged().UserProfileInfoID;
            GameHandler GameHandler = new GameHandler();
            ViewBag.GameID = GameHandler.SelectGames(UserProfileInfoID, match.GameID);
            return View(match);
        }
예제 #2
0
 public ActionResult Edit([Bind(Include = "MatchID,ScoreTeamA,ScoreTeamB,Notes,GameID")] Match match)
 {
     if (ModelState.IsValid)
     {
         db.Entry(match).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     UserHandler UserHandler = new UserHandler();
     var UserProfileInfoID = UserHandler.GetUserLogged().UserProfileInfoID;
     GameHandler GameHandler = new GameHandler();
     ViewBag.GameID = GameHandler.SelectGames(UserProfileInfoID, match.GameID);
     return View(match);
 }