示例#1
0
        /// <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
        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
        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
        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);
        }
示例#5
0
        public ActionResult ShowGameInfo(int? type, int? link, int? gameDate, int? occasionNo, int? teamID, int? gameID, string lstGameID, int? leagueType = 0, int? round = 0, bool withScoreDetails = false, int seasonId = 0)
        {
            IEnumerable<JlgGameInfos> lstGame = default(IEnumerable<JlgGameInfos>);
            ViewBag.Type = type;
            ViewBag.Link = link;
            var lstgId = new List<int>();

            long memberId = this.GetMemberId();

            if (type == 5)
            {
                int? gDate = jlg.ScheduleInfo.Where(m => m.GameDate > gameDate.Value).Min(m => m.GameDate);
                lstGame = GetGameInfo(gDate, occasionNo, teamID, null, null, 0, 0, withScoreDetails, memberId, seasonId);
            }
            else
            {
                //Convert string to list
                if (type == 6 && !string.IsNullOrEmpty(lstGameID))
                {
                    List<string> listofIDs = lstGameID.Split(',').ToList();
                    lstgId = listofIDs.Select(int.Parse).ToList();
                    lstGame = GetGameInfo(gameDate, occasionNo, teamID, gameID, lstgId, 0, 0, withScoreDetails, memberId, seasonId);
                }
                else
                {
                    lstGame = GetGameInfo(gameDate, occasionNo, teamID, gameID, null, leagueType, round, withScoreDetails, memberId, seasonId);
                }
            }

            if (lstGame != null && lstGame.Any())
            {
                lstGame.ForEach(x => x.ParameterInfo = new JlgGameInfos.ParameterInfoModel
                {
                    ParameterType = type,
                    Link = link,
                    GameDate = gameDate,
                    OccasionNo = occasionNo,
                    TeamId = teamID,
                    GameId = gameID,
                    LstGameId = lstGameID,
                    LeagueType = leagueType,
                    Round = round,
                    WithScoreDetail = withScoreDetails
                });

                var jlsService = new JlgService();
                foreach (var game in lstGame)
                {
                    occasionNo = jlsService.GetOccasionNo(game.GameDate, game.GameKindID);
                    game.OccasionNo = occasionNo ?? 0;

                    //Phase3#2000~2002 試合情報パネル対応
                    //スコア情報を読み込む
                    if (withScoreDetails)
                        game.ScoreDetails = this.GetScoreDetails(game.GameID);
                }
            }

            if (type == 5)  // 次節の試合情報
            {
                return PartialView("_JlgNextGames", lstGame);
            }

            if (withScoreDetails)
                return PartialView("_JlgGameCard", lstGame);
            else
                return PartialView("_JlgGameInfo", lstGame);
        }
        public ActionResult Index()
        {
            var jlgService = new JlgService();

            var jType = jlgService.GetJlgType(Request.Url.AbsoluteUri);

            //Jリーグ初期表示用viewModel
            var jlgScheduleResultViewModel = new JlgScheduleResultViewModel();

            jlgScheduleResultViewModel.JType = jType;

            var gameKindDictionary = GetGameKind(jType);

            var pageSettingsDictionary = GetPageSettings(jType);

            jlgScheduleResultViewModel.JLeagueMenu = Convert.ToInt32(pageSettingsDictionary[JLeagueMenuKey]);

            jlgScheduleResultViewModel.JLeagueSubMenu = 2;

            jlgScheduleResultViewModel.PageName = Convert.ToString(pageSettingsDictionary[PageNameKey]);

            jlgScheduleResultViewModel.PageTitle = Convert.ToString(pageSettingsDictionary[PageTitleKey]);

            jlgScheduleResultViewModel.GameKind = Convert.ToInt32(gameKindDictionary[GameKindKey]);

            jlgScheduleResultViewModel.GameKindName = Convert.ToString(gameKindDictionary[GameKindNameKey]);

            jlgScheduleResultViewModel.OccasionNo = jlgService.GetOccasionNo(DateTime.Now.ParseToInt(), jlgScheduleResultViewModel.GameKind);

            jlgScheduleResultViewModel.MaxOccasionNo = GetMaxOccasionNoByGameKind(jlgScheduleResultViewModel.GameKind);

            jlgScheduleResultViewModel.SeasonId = jlgService.GetSeasonId(DateTime.Now.ParseToInt(), jlgScheduleResultViewModel.GameKind);

            if (jType == JlgConst.JType.Jleaguecup)
            {
                //Todo:決勝ラウンド開放までの一時対応
                jlgScheduleResultViewModel.SeasonId = 4;
                jlgScheduleResultViewModel.OccasionNo = 1;

                //最終ラウンド用
                var queryNb = (from si in jlgEntities.ScheduleInfo
                               join gcat in jlgEntities.GameCategory on si.GameCategoryId equals gcat.GameCategoryId
                               join gs in jlgEntities.GameSchedule on gcat.GameScheduleId equals gs.GameScheduleId
                               where gs.GameKindID == JlgConstants.JLG_GAMEKIND_NABISCO
                               where si.GameCategoryId == JlgConstants.JLG_GAMECATEGORY_NABISCO_FINAL
                               select new JlgScheduleResultNabiscoInfoModel
                               {
                                   finalRoundName = si.RoundName,
                                   finalRound = (int)si.Round,
                                   finalOccasion = (int)si.OccasionNo
                               }).ToList();
                List<JlgScheduleResultNabiscoInfoModel> ScheduleInfoNb = queryNb;
                var FinalCnt = GetFinalOcasionCnt();
                jlgScheduleResultViewModel.finalCnt = (int)FinalCnt;
            }

            return View(jlgScheduleResultViewModel);
        }