public ActionResult Show(int? playerID) { NpbTeamInfoPitcherDetailViewModel pitcherInfo = new NpbTeamInfoPitcherDetailViewModel(); if (playerID != null) { ViewBag.TeamInfoMenuTabActive = (int)NpbConstants.TeamInfoMenu.TabActive_4; ViewBag.PlayerID = playerID; int? teamID = (from tis in npb.TeamInfoST join pis in npb.PlayerInfoST on tis.TeamInfoSTId equals pis.TeamInfoSTId where pis.PlayerID == playerID select tis.TeamID).FirstOrDefault(); ViewBag.TeamID = teamID; if (teamID != null) { ViewBag.LeagueName = Constants.LEAGUENAME_FIRST + GetLeagueNameByTeamID(teamID.Value) + " " + Constants.LEAGUENAME_AFTER; ViewBag.TeamName = npb.TeamInfoMST.Where(x => x.TeamCD == teamID).Select(x => x.Team).FirstOrDefault(); pitcherInfo.PitchingStats = GetPitchingStatsByPlayerID(teamID.Value, playerID.Value); pitcherInfo.ListPitchingStats6thGameInfo = GetPitchingStats6thByPlayerID(teamID.Value, playerID.Value); pitcherInfo.ListPitchingStatsTeamOpponentInfo = GetPitchingStatsTeamsOpponentInfoByPlayerID(teamID.Value, playerID.Value); pitcherInfo.ListPitchingStats3YearInfo = GetPitchingStats3YearsInfoByPlayerID(teamID.Value, playerID.Value); pitcherInfo.TeamPostedInfoList = PostedController.GetRecentPosts(Constants.NPB_POST_TEAM_TYPE, Constants.NPB_SPORT_ID, teamID.Value, Constants.TEAM_TOPIC_CLASSIFICATION); } } return View(@"Index", pitcherInfo); }
// GET: Npb/NpbTeamInfoPitcherDetail public ActionResult Index(int? teamID, int? playerID) { //#1297対応 //return RedirectToActionPermanent("Show", "NpbTeamInfoPitcherDetail", new { area = "Npb", playerID = playerID }); NpbTeamInfoPitcherDetailViewModel pitcherInfo = new NpbTeamInfoPitcherDetailViewModel(); if(playerID != null && teamID != null) { ViewBag.TeamInfoMenuTabActive = (int)NpbConstants.TeamInfoMenu.TabActive_4; ViewBag.PlayerID = playerID; ViewBag.TeamID = teamID; ViewBag.LeagueName = Constants.LEAGUENAME_FIRST + GetLeagueNameByTeamID(teamID.Value) + " " + Constants.LEAGUENAME_AFTER; ViewBag.TeamName = npb.TeamInfoMST.Where(x => x.TeamCD == teamID).Select(x => x.Team).FirstOrDefault(); pitcherInfo.PitchingStats = GetPitchingStatsByPlayerID(teamID.Value, playerID.Value); pitcherInfo.ListPitchingStats6thGameInfo = GetPitchingStats6thByPlayerID(teamID.Value, playerID.Value); pitcherInfo.ListPitchingStatsTeamOpponentInfo = GetPitchingStatsTeamsOpponentInfoByPlayerID(teamID.Value, playerID.Value); pitcherInfo.ListPitchingStats3YearInfo = GetPitchingStats3YearsInfoByPlayerID(teamID.Value, playerID.Value); pitcherInfo.TeamPostedInfoList = PostedController.GetRecentPosts(Constants.NPB_POST_TEAM_TYPE, Constants.NPB_SPORT_ID, teamID.Value, Constants.TEAM_TOPIC_CLASSIFICATION); } return View(pitcherInfo); }