예제 #1
0
        public ActionResult Player(PlayerStatsFilterViewModel model)
        {
            ViewBag.PlayerItems = listItems.Players();
            ViewBag.SeasonItems = listItems.Seasons();

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

            ViewBag.CompetitionItems = listItems.CompetitionsOfPlayer(model.Player);

            IList <PlayerStats> stats = psdao.GetByFilter(model);

            PlayerStatsManager gsm = new PlayerStatsManager(stats);

            ViewBag.Stats      = gsm.OverAllStats();
            ViewBag.RadarStats = gsm.StatsForRadarChart();
            return(View());
        }