protected void uxGamesRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e) { UserMeanGameScore mgs = (UserMeanGameScore)e.Item.DataItem; //e.Item.FindControl("uxIndividualCharge"); if (Session["SessionId"] != null) { Guid sessionId = new Guid(Session["SessionId"].ToString()); GamesScoreWS.GameScoreService gsClient = new GamesScoreWS.GameScoreService(); IndividualGameResults igResults = gsClient.FetchIndividualGames(sessionId, mgs.GameId); if (igResults.Success) { Chart createChart = (Chart)e.Item.FindControl("uxIndividualCharge"); createChart.Titles.Add(mgs.Game); Series resultsSeries = createChart.Series["GameScores"]; foreach (t_GameResults gr in igResults.GameResultList) { DataPoint dp = new DataPoint(); decimal indexical = ((decimal)gr.Score / (decimal)gr.Total) * 100; dp.SetValueXY(gr.Created.ToShortDateString(), indexical); dp.ToolTip = string.Format("{0} out of {1} in {2} seconds", gr.Score, gr.Total, gr.TestDuration); resultsSeries.Points.Add(dp); } } } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { if (Session["SessionId"] != null) { uxLoggedIn.Visible = true; Guid sessionId = new Guid(Session["SessionId"].ToString()); GamesScoreWS.GameScoreService gsClient = new GamesScoreWS.GameScoreService(); UserGameResults userTotalResults = gsClient.FetchUserGameResults(sessionId); if (userTotalResults.Success) { UserTotal = userTotalResults.UserScore.ToString("#.000"); uxGamesRepeater.DataSource = userTotalResults.MeanGameScores; uxGamesRepeater.DataBind(); } } } }