// // 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()); }
// // 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()); }