public ActionResult Create() { CreateNewTournamentView tournaments = new CreateNewTournamentView(); TournamentAccessRepository rep = new TournamentAccessRepository(); tournaments.Tournaments = rep.GetAllTournaments(); return(View("Create", tournaments)); }
public ActionResult Planning(string id, string message) //id = Tournament ID { ViewData["Message"] = message; TournamentPlanningView view = new TournamentPlanningView(); if (id != null && id.Trim() != "") { view.SelectedTournamentID = Guid.Parse(id); } List <TeamApplication> teamApplications = null;; TournamentAccessRepository tourRep = new TournamentAccessRepository(); List <Tournament> tournaments = tourRep.GetAllTournaments(); if (view.SelectedTournamentID != Guid.Empty) { teamApplications = tourRep.GetAllApprovedTeamApplicationsByTournamentID(view.SelectedTournamentID); view.SelectedTournamentMatches = tourRep.GetTournamentMatches(view.SelectedTournamentID); } else { teamApplications = new List <TeamApplication>(); view.SelectedTournamentMatches = new List <Match>(); } view.SelectedTournamentTeamApplications = new List <SelectListItem>(); foreach (var item in teamApplications) { view.SelectedTournamentTeamApplications.Add(new SelectListItem { Value = item.ApplicationID.ToString(), Text = item.Organization.Name + " - " + item.TeamName + "(" + item.Category + ")" }); } view.Tournaments = new List <SelectListItem>(); foreach (var item in tournaments) { view.Tournaments.Add(new SelectListItem { Text = item.TournamentName, Value = item.TournamentID.ToString() }); } return(View(view)); }