// 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); }
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); }