protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack)
            {
                return;
            }

            int fixtureId = int.Parse(this.Page.RouteData.Values["FixtureId"].ToString());

            var fixture = Singleton.Get <RedisCacheManager>()
                          .Get <WebFormModel.FootballFixture>
                          (
                () => RequestLoader.FootballFixtureById(fixtureId),
                RequestLoader.Locker_FootballFixtureById,
                DateTime.Now.AddHours(1),
                RedisKeyMaker.FootballFixtureById(fixtureId)
                          );

            var curLeague = Singleton.Get <RedisCacheManager>()
                            .Get <WebFormModel.FootballLeague>
                            (
                () => RequestLoader.FootballSeasonsByLeagueId(fixture.LeagueId),
                RequestLoader.Locker_FootballSeasonsByLeagueId,
                DateTime.Now.AddDays(1),
                RedisKeyMaker.FootballSeasonsByLeagueId(fixture.LeagueId)
                            );

            // Standing
            ctrl_footballStanding.SetSearchTeamID(fixture.HomeTeam.TeamId, fixture.AwayTeam.TeamId);
            ctrl_footballStanding.SetSearchLeagueID(fixture.LeagueId);

            // H2H
            ctrl_FootballH2HFixtureList.SetSearchTeamID(fixture.HomeTeam.TeamId, fixture.AwayTeam.TeamId);

            // FixturesResult
            ctrl_footballTeamFixtureResults.SetSearchTeamID(fixture.HomeTeam.TeamId, fixture.AwayTeam.TeamId);
            ctrl_footballTeamFixtureResults.SetSearchTeamName(fixture.HomeTeam.TeamName, fixture.AwayTeam.TeamName);
            ctrl_footballTeamFixtureResults.SetSearchLeagueID(fixture.LeagueId);

            // Player
            //ctrl_footballPlayerList.SetSearchTeamID(fixture.HomeTeam.TeamID, fixture.AwayTeam.TeamID);
            //ctrl_footballPlayerList.SetSearchTeamName(fixture.HomeTeam.TeamName, fixture.AwayTeam.TeamName);
            //ctrl_footballPlayerList.SetSearchLeagueID(curLeague.LeagueID);

            //int startYear = curLeague.SeasonStart.Year;
            //int endYear = curLeague.SeasonEnd.Year;
            //if (startYear != endYear)
            //	ctrl_footballPlayerList.SetSearchSeason($"{startYear}-{endYear}");
            //else
            //	ctrl_footballPlayerList.SetSearchSeason($"{startYear}");
        }
        public WebFormModel.FootballFixture GetFootballFixture([RouteData] int fixtureId)
        {
            var fixture = Singleton.Get <RedisCacheManager>()
                          .Get <WebFormModel.FootballFixture>
                          (
                () => RequestLoader.FootballFixtureById(fixtureId),
                RequestLoader.Locker_FootballFixtureById,
                DateTime.Now.AddHours(1),
                RedisKeyMaker.FootballFixtureById(fixtureId)
                          );

            var homefixtures = Singleton.Get <RedisCacheManager>()
                               .Get <IList <WebFormModel.FootballFixture> >
                               (
                () => RequestLoader.FootballFixtureByTeamId(fixture.HomeTeam.TeamId),
                RequestLoader.Locker_FootballFixtureByTeamId,
                DateTime.Now.AddHours(12),
                RedisKeyMaker.FootballFixtureByTeamId(fixture.HomeTeam.TeamId)
                               ).Where(elem => elem.MatchTime < DateTime.Now)
                               .OrderByDescending(elem => elem.MatchTime);

            var awayfixtures = Singleton.Get <RedisCacheManager>()
                               .Get <IList <WebFormModel.FootballFixture> >
                               (
                () => RequestLoader.FootballFixtureByTeamId(fixture.AwayTeam.TeamId),
                RequestLoader.Locker_FootballFixtureByTeamId,
                DateTime.Now.AddHours(12),
                RedisKeyMaker.FootballFixtureByTeamId(fixture.AwayTeam.TeamId)
                               ).Where(elem => elem.MatchTime < DateTime.Now)
                               .OrderByDescending(elem => elem.MatchTime);

            // 홈팀 최근 6경기 득실점
            int fixtureCnt  = 0;
            int goalCnt     = 0;
            int goalAgainst = 0;

            foreach (var selectedfixture in homefixtures)
            {
                if (string.IsNullOrEmpty(selectedfixture.Score.FullTime) ||
                    selectedfixture.LeagueId != fixture.LeagueId)
                {
                    continue;
                }

                // 최근 5경기만..
                if (fixtureCnt >= 6)
                {
                    break;
                }

                bool     isHomeTeam = selectedfixture.HomeTeam.TeamId == fixture.HomeTeam.TeamId;
                string[] scoreSplit = selectedfixture.Score.FullTime.Split('-');

                goalCnt     += int.Parse(scoreSplit[isHomeTeam ? 0 : 1]);
                goalAgainst += int.Parse(scoreSplit[isHomeTeam ? 1 : 0]);

                fixtureCnt++;
            }
            fixture.HomeLateSixGoalPoints = $"{goalCnt} : {goalAgainst}";

            // 홈팀 최근 홈3경기 득실점
            fixtureCnt  = 0;
            goalCnt     = 0;
            goalAgainst = 0;
            foreach (var selectedfixture in homefixtures)
            {
                bool isHomeTeam = selectedfixture.HomeTeam.TeamId == fixture.HomeTeam.TeamId;
                if (string.IsNullOrEmpty(selectedfixture.Score.FullTime) ||
                    selectedfixture.LeagueId != fixture.LeagueId ||
                    !isHomeTeam)
                {
                    continue;
                }

                // 최근 3경기만..
                if (fixtureCnt >= 3)
                {
                    break;
                }

                string[] scoreSplit = selectedfixture.Score.FullTime.Split('-');

                goalCnt     += int.Parse(scoreSplit[0]);
                goalAgainst += int.Parse(scoreSplit[1]);

                fixtureCnt++;
            }
            fixture.HomeLateThreeGoalPoints = $"{goalCnt} : {goalAgainst}";

            // 어웨이팀 최근 6경기 득실점
            fixtureCnt  = 0;
            goalCnt     = 0;
            goalAgainst = 0;
            foreach (var selectedfixture in awayfixtures)
            {
                if (string.IsNullOrEmpty(selectedfixture.Score.FullTime) ||
                    selectedfixture.LeagueId != fixture.LeagueId)
                {
                    continue;
                }

                // 최근 6경기만..
                if (fixtureCnt >= 6)
                {
                    break;
                }

                bool     isHomeTeam = selectedfixture.HomeTeam.TeamId == fixture.AwayTeam.TeamId;
                string[] scoreSplit = selectedfixture.Score.FullTime.Split('-');

                goalCnt     += int.Parse(scoreSplit[isHomeTeam ? 0 : 1]);
                goalAgainst += int.Parse(scoreSplit[isHomeTeam ? 1 : 0]);

                fixtureCnt++;
            }
            fixture.AwayLateSixGoalPoints = $"{goalCnt} : {goalAgainst}";

            // 어웨이팀 최근 어웨이3경기 득실점
            fixtureCnt  = 0;
            goalCnt     = 0;
            goalAgainst = 0;
            foreach (var selectedfixture in awayfixtures)
            {
                bool isAwayTeam = selectedfixture.AwayTeam.TeamId == fixture.AwayTeam.TeamId;
                if (string.IsNullOrEmpty(selectedfixture.Score.FullTime) ||
                    selectedfixture.LeagueId != fixture.LeagueId ||
                    !isAwayTeam)
                {
                    continue;
                }

                // 최근 3경기만..
                if (fixtureCnt >= 3)
                {
                    break;
                }

                string[] scoreSplit = selectedfixture.Score.FullTime.Split('-');

                goalCnt     += int.Parse(scoreSplit[1]);
                goalAgainst += int.Parse(scoreSplit[0]);

                fixtureCnt++;
            }
            fixture.AwayLateThreeGoalPoints = $"{goalCnt} : {goalAgainst}";

            // 홈팀 회복기간
            var homeLastFixtures = homefixtures.FirstOrDefault();

            if (homeLastFixtures != null)
            {
                fixture.HomeRecoveryDays = $"{(fixture.MatchTime - homeLastFixtures.MatchTime).Days}일";
            }

            // 원정팀 회복기간
            var awayLastFixtures = awayfixtures.FirstOrDefault();

            if (awayLastFixtures != null)
            {
                fixture.AwayRecoveryDays = $"{(fixture.MatchTime - awayLastFixtures.MatchTime).Days}일";
            }

            return(fixture);
        }