コード例 #1
0
ファイル: JlgChartService.cs プロジェクト: kin0428/Splg
        /// <summary>
        /// チーム傾向@円グラフビューモデル取得
        /// </summary>
        public JlgTeamTrendsAtPieViewModel GetjlgTeamTrendsAtPieViewModel(int homeTeamId, int awayTeamId)
        {
            var jlgTeamTrendsAtPieViewModel = new JlgTeamTrendsAtPieViewModel();

            var jlgService = new JlgService();

            jlgTeamTrendsAtPieViewModel.TargetHomeTeamId = homeTeamId;
            jlgTeamTrendsAtPieViewModel.TargetAwayTeamId = awayTeamId;
            jlgTeamTrendsAtPieViewModel.HomeTeamSpec = jlgService.GetTeamSpecByTeamId(homeTeamId);
            jlgTeamTrendsAtPieViewModel.AwayTeamSpec = jlgService.GetTeamSpecByTeamId(awayTeamId);

            var homeTeamStats = GetTeamStats(homeTeamId);
            var awayTeamStats = GetTeamStats(awayTeamId);

            jlgTeamTrendsAtPieViewModel.HomeChartAtGoalPattern = PickChartAtGoalPattern(homeTeamStats, "HomePieChartAtGoalPattern", "LoadHomePieChartAtGoalPattern");
            jlgTeamTrendsAtPieViewModel.HomeChartAtLostPattern = PickChartAtLostPattern(homeTeamStats, "HomePieChartAtLostPattern", "LoadHomePieChartAtLostPattern");

            jlgTeamTrendsAtPieViewModel.AwayChartAtGoalPattern = PickChartAtGoalPattern(awayTeamStats, "AwayPieChartAtGoalPattern", "LoadAwayPieChartAtGoalPattern");
            jlgTeamTrendsAtPieViewModel.AwayChartAtLostPattern = PickChartAtLostPattern(awayTeamStats, "AwayPieChartAtLostPattern", "LoadAwayPieChartAtLostPattern");

            var homeGoalTimeZoneList = GetGoalTimeZoneList(homeTeamId);
            var homeGoalTimeZoneFirst = homeGoalTimeZoneList.Where(m => m.TimeZoneDivision == (int)JlgChartConst.TimeZoneDivision.First).FirstOrDefault();
            var homeGoalTimeZoneSecond = homeGoalTimeZoneList.Where(m => m.TimeZoneDivision == (int)JlgChartConst.TimeZoneDivision.Second).FirstOrDefault();

            var awayGoalTimeZoneList = GetGoalTimeZoneList(awayTeamId);
            var awayGoalTimeZoneFirst = awayGoalTimeZoneList.Where(m => m.TimeZoneDivision == (int)JlgChartConst.TimeZoneDivision.First).FirstOrDefault();
            var awayGoalTimeZoneSecond = awayGoalTimeZoneList.Where(m => m.TimeZoneDivision == (int)JlgChartConst.TimeZoneDivision.Second).FirstOrDefault();

            jlgTeamTrendsAtPieViewModel.HomeChartAtGoalGroupByTimeZone = PickChartAtGoalTimeZone(homeGoalTimeZoneFirst, homeGoalTimeZoneSecond, "HomePieChartAtGoalTimeZone", "LoadHomePieChartAtGoalTimeZone");
            jlgTeamTrendsAtPieViewModel.HomeChartAtLostGroupByTimeZone = PickChartAtLostTimeZone(homeGoalTimeZoneFirst, homeGoalTimeZoneSecond, "HomePieChartAtLostTimeZone", "LoadHomePieChartAtLostTimeZone");

            jlgTeamTrendsAtPieViewModel.AwayChartAtGoalGroupByTimeZone = PickChartAtGoalTimeZone(awayGoalTimeZoneFirst, awayGoalTimeZoneSecond, "AwayPieChartAtGoalTimeZone", "LoadAwayPieChartAtGoalTimeZone");
            jlgTeamTrendsAtPieViewModel.AwayChartAtLostGroupByTimeZone = PickChartAtLostTimeZone(awayGoalTimeZoneFirst, awayGoalTimeZoneSecond, "AwayPieChartAtLostTimeZone", "LoadAwayPieChartAtLostTimeZone");

            jlgTeamTrendsAtPieViewModel.HomeChartAtPassSucceedAverage = PickChartAtPassSucceedAverage(homeTeamStats, "HomePieChartAtPassSucceedAverage", "LoadHomePieChartAtPassSucceedAverage");
            jlgTeamTrendsAtPieViewModel.HomeChartAtPassPattern = PickChartAtPassPattern(homeTeamStats, "HomePieChartAtPassPattern", "LoadHomePieChartAtPassPattern");

            jlgTeamTrendsAtPieViewModel.AwayChartAtPassSucceedAverage = PickChartAtPassSucceedAverage(awayTeamStats, "AwayPieChartAtPassSucceedAverage", "LoadAwayPieChartAtPassSucceedAverage");
            jlgTeamTrendsAtPieViewModel.AwayChartAtPassPattern = PickChartAtPassPattern(awayTeamStats, "AwayPieChartAtPassPattern", "LoadAwayPieChartAtPassPattern");

            return jlgTeamTrendsAtPieViewModel;
        }
コード例 #2
0
ファイル: JlgTeamInfoController.cs プロジェクト: kin0428/Splg
        public ActionResult GetJlgRecentMatches(int homeTeamId, int awayTeamId,int gameDate)
        {
            var jlgRecentMatchesViewModel = new JlgRecentMatchesViewModel();

            var jlgService = new JlgService();

            jlgRecentMatchesViewModel.TargetHomeTeamId = homeTeamId;

            jlgRecentMatchesViewModel.TargetAwayTeamId = awayTeamId;

            jlgRecentMatchesViewModel.HomeTeamSpec = jlgService.GetTeamSpecByTeamId(homeTeamId);

            jlgRecentMatchesViewModel.AwayTeamSpec = jlgService.GetTeamSpecByTeamId(awayTeamId);

            jlgRecentMatchesViewModel.RecentMatches = jlgService.GetRecentMatches(homeTeamId, awayTeamId, gameDate);

            jlgRecentMatchesViewModel.RecentMatchesCounts = jlgService.CalculateJlgRecentGameResultCounts(homeTeamId, jlgRecentMatchesViewModel.RecentMatches);

            return PartialView("_JlgRecentMatches", jlgRecentMatchesViewModel);
        }
コード例 #3
0
ファイル: JlgTeamInfoController.cs プロジェクト: kin0428/Splg
        public ActionResult GetTeamTrendsAtBar(int homeTeamId, int awayTeamId, int gameDate)
        {
            var jlgService = new JlgService();

            var jlgTeamTrendsAtBarViewModel = new JlgTeamTrendsAtBarViewModel()
            {
                TargetHomeTeamId = homeTeamId,
                TargetAwayTeamId = awayTeamId,
                HomeTeamSpec = jlgService.GetTeamSpecByTeamId(homeTeamId),
                AwayTeamSpec = jlgService.GetTeamSpecByTeamId(awayTeamId),
                HomeTeamTrendsAtBar = jlgService.GetTeamTrendsAtBar(homeTeamId, gameDate),
                AwayTeamTrendsAtBar = jlgService.GetTeamTrendsAtBar(awayTeamId, gameDate),
            };

            return PartialView("_JlgTeamTrendsAtBar", jlgTeamTrendsAtBarViewModel);
        }
コード例 #4
0
ファイル: JlgTeamInfoController.cs プロジェクト: kin0428/Splg
        public ActionResult GetRelatedArticles(int homeTeamId, int awayTeamId)
        {
            var jlgService = new JlgService();

            var jlgRelatedArticlesViewModel = new JlgRelatedArticlesViewModel()
            {
                TargetHomeTeamId = homeTeamId,
                TargetAwayTeamId = awayTeamId,
                HomeTeamSpec = jlgService.GetTeamSpecByTeamId(homeTeamId),
                AwayTeamSpec = jlgService.GetTeamSpecByTeamId(awayTeamId),
                HomeRelatedArticles = new RelatedArticles() { Items = jlgService.GetRelatedArticles(homeTeamId), JLeagueType = jlgService.GetJlgType(Request.Url.AbsoluteUri) },
                AwayRelatedArticles = new RelatedArticles() { Items = jlgService.GetRelatedArticles(awayTeamId), JLeagueType = jlgService.GetJlgType(Request.Url.AbsoluteUri) },
            };

            return PartialView("_JlgRelatedArticles", jlgRelatedArticlesViewModel);
        }