Ejemplo n.º 1
0
        //
        // GET: /Match/

        public ActionResult Index(GameFilterViewModel model)
        {
            ViewBag.TeamItems   = listItems.TeamsOnly();
            ViewBag.SeasonItems = listItems.Seasons();

            if (model.Team == 0 && model.Season == 0)
            {
                model.Season = Convert.ToInt64(ViewBag.SeasonItems[0].Value);
                model.Team   = Convert.ToInt64(ViewBag.TeamItems[0].Value);
            }

            ViewBag.CompetitionItems = listItems.CompetitionsOfTeam(model.Team);

            IList <Game> games = gamedao.GetByFilter(model);

            ViewBag.Games = games;

            return(View());
        }
Ejemplo n.º 2
0
        //
        // GET: /Stats/

        public ActionResult Index(GameFilterViewModel model)
        {
            ViewBag.TeamItems   = listItems.TeamsOnly();
            ViewBag.SeasonItems = listItems.Seasons();

            if (model.Team == 0 && model.Season == 0)
            {
                model.Season = Convert.ToInt64(ViewBag.SeasonItems[0].Value);
                model.Team   = Convert.ToInt64(ViewBag.TeamItems[0].Value);
            }

            ViewBag.CompetitionItems = listItems.CompetitionsOfTeam(model.Team);

            IList <Game> games = gamedao.GetByFilter(model);

            GameStatsManager gsm = new GameStatsManager(games);

            ViewBag.Results         = gsm.Results();
            ViewBag.Stats           = gsm.OverAllStats();
            ViewBag.ResultsShooters = gsm.Shooters();
            ViewBag.ResultsGoals    = gsm.Goals();
            return(View());
        }