public ActionResult Index(Guid gameId, string gender) { List<Player> playersList = new List<Player>(); List<Team> teamsList = new List<Team>(); Middleware.VolleyballService.VolleyballServiceClient client; client = new Middleware.VolleyballService.VolleyballServiceClient(); var playersInGameDict = client.ReadPlaeyrs_Game(gameId); var teamsDict = client.ReadTeams_Game(gameId); var gameDict = client.Read(gameId, Middleware.VolleyballService.TablesNames.Games); foreach (var item in playersInGameDict) { playersList.Add(new Player(item)); } foreach (var item in teamsDict) { teamsList.Add(new Team(item)); } Game game = new Game(gameDict); if (!string.IsNullOrEmpty(gender)) { ViewBag.gender = gender; } return View(new PreciseGameModel(playersList, game)); }
public ActionResult Index(Guid playerId, string gender) { Player player; Dictionary<string, string> playerDict; List<Dictionary<string, string>> gamesDict; List<Dictionary<string, string>> teamsDict; List<Game> gamesWithReward; List<Team> teamsList; Middleware.VolleyballService.VolleyballServiceClient client; gamesWithReward = new List<Game>(); teamsList = new List<Team>(); client = new Middleware.VolleyballService.VolleyballServiceClient(); playerDict = client.Read(playerId, Middleware.VolleyballService.TablesNames.Players); gamesDict = client.ReadPlayerStatisticsInGames(playerId, Middleware.VolleyballService.PlayersInfo.BestPlayer); teamsDict = client.ReadTeams_Player(playerId); player = new Player(playerDict); if (gamesDict != null) { foreach (var item in gamesDict) { gamesWithReward.Add(new Game(item)); } } foreach (var item in teamsDict) { teamsList.Add(new Team(item)); } if (!string.IsNullOrEmpty(gender)) { ViewBag.gender = gender; } return View(new PlayerInformationModel(player, teamsList, gamesWithReward)); }
public ActionResult Index(Guid teamId, string gender) { Team team; Dictionary<string, string> teamDict; List<Dictionary<string, string>> list; List<Player> playersList = new List<Player>(); Middleware.VolleyballService.VolleyballServiceClient client; client = new Middleware.VolleyballService.VolleyballServiceClient(); list = new List<Dictionary<string, string>>(client.ReadPlayers_Team(teamId)); teamDict = client.Read(teamId, Middleware.VolleyballService.TablesNames.Teams); team = new Team(teamDict); foreach (var item in list) { playersList.Add(new Player(item)); } if (!string.IsNullOrEmpty(gender)) { ViewBag.gender = gender; } return View(new TeamInformationModel(playersList, team)); }