예제 #1
0
        public ActionResult AddMatch()
        {
            SelectList sports = new SelectList(betListProvider.GetSports(), "SportId", "Name");

            if (sports == null)
            {
                log.Error("Controller: Match, Action: AddMatch Don't GetSports");
                return(RedirectToAction("InfoError", "Error"));
            }
            ViewBag.Sports = sports;
            SelectList tournaments = new SelectList(betListProvider.GetTournamentes(), "TournamentId", "Name");

            if (tournaments == null)
            {
                log.Error("Controller: Match, Action: AddMatch Don't GetTournamentes");
                return(RedirectToAction("InfoError", "Error"));
            }
            ViewBag.Tournaments = tournaments;
            SelectList teams = new SelectList(teamProvider.GetTeamsAll(), "TeamId", "Name");

            if (teams == null)
            {
                log.Error("Controller: Match, Action: AddMatch Don't GetTeamsAll");
                return(RedirectToAction("InfoError", "Error"));
            }
            ViewBag.Teams = teams;

            return(View());
        }
예제 #2
0
        public ActionResult ShowTeams()
        {
            IReadOnlyList <Team> teams = teamProvider.GetTeamsAll();

            if (teams == null)
            {
                log.Error("Controller: Team, Action: ShowTeams Don't GetTeamsAll");
                return(RedirectToAction("InfoError", "Error"));
            }
            return(PartialView(teams));
        }