public virtual ActionResult ContestantList(long tournamentId, ContestantListAndCreate model) { var tourney = TournamentService.GetTournamentGuarded(tournamentId); model.Contestant.Tournament = tourney; TournamentService.AddOrUpdateContestant(model.Contestant); Session[IdToHighlightKey] = model.Contestant.Id; return(this.RedirectToAction(MVC.Admin.TournamentAdmin.ContestantList(tournamentId, new long?()))); }
public virtual ActionResult ContestantList(long tournamentId, long?contestantId = null) { var tournament = TournamentService.GetTournamentGuarded(tournamentId); var mode = contestantId == null ? EntityMode.Create : EntityMode.Edit; var model = new ContestantListAndCreate(tournament, mode); if (contestantId != null) { model.Contestant = TournamentService.GetContestantGuarded(contestantId.Value); } model.IdToHighlight = (long?)Session[IdToHighlightKey]; Session[IdToHighlightKey] = null; //Reset for consecutive refreshes return(View(model)); }