protected void Page_Load(object sender, EventArgs e) { for (int i = 0; i < NumGames; i++) { ZGSSController controller = (ZGSSController)Application["Domain"]; PlayedGame game = controller.getGame(_listGameIDs[i]); TableRow tempRow = new TableRow(); TableCell tempCell1 = new TableCell(); tempCell1.Text = game.PlayedOn.ToShortDateString(); tempRow.Cells.Add(tempCell1); TableCell tempCell2 = new TableCell(); tempCell2.Text = game.Duration.ToString(); tempRow.Cells.Add(tempCell2); TableCell tempCell3 = new TableCell(); tempCell3.Text = game.GameType.GameName; tempRow.Cells.Add(tempCell3); TableCell tempCell4 = new TableCell(); tempCell4.Text = game.Map.Name; tempRow.Cells.Add(tempCell4); string players = game.getPlayers(); TableCell tempCell5 = new TableCell(); tempCell5.Text = players; tempRow.Cells.Add(tempCell5); TeamParticipatingInGame winner = game.getWinner(); TableCell tempCell6 = new TableCell(); tempCell6.Text = winner.TeamInGame.getTeamName(); tempRow.Cells.Add(tempCell6); TableCell tempCell7 = new TableCell(); tempCell7.Text = "<a href=\"frmPlayedGame.aspx?GameID=" + game.GameID.ToString() + "\">detalji </a>"; // tempCell7.Text = "<asp:HyperLink ID=\"HyperLink1\" runat=\"server\" NavigateUrl=\"~/frmPlayedGame.aspx?GameID=0\">detalji</asp:HyperLink> </p>"; tempRow.Cells.Add(tempCell7); tblGameList.Rows.Add(tempRow); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { _gameID = Convert.ToInt32(Request.Params["GameID"]); ZGSSController controller = (ZGSSController)Application["Domain"]; PlayedGame game = controller.getGame(_gameID); tblData.Rows[0].Cells[1].Text = game.PlayedOn.ToString(); if (game.GameType.GameName == "Company of Heroes") { ASP.webcontrols_ctrlcohdetailedgamedata_ascx newCtrl = (ASP.webcontrols_ctrlcohdetailedgamedata_ascx)LoadControl("~/WebControls/ctrlCoHDetailedGameData.ascx"); GameDataPlaceHolder.Controls.Add(newCtrl); } else if (game.GameType.GameName == "Warcraft III") { ASP.webcontrols_ctrlwarcraftdetailedgamedata_ascx newCtrl = (ASP.webcontrols_ctrlwarcraftdetailedgamedata_ascx)LoadControl("~/WebControls/ctrlWarcraftDetailedGameData.ascx"); GameDataPlaceHolder.Controls.Add(newCtrl); } } }