public void CreateViewOfStatistic(Guid userId, Table tbl) { StatisticDAL statDAL = new StatisticDAL(); SubThemeDAL subThDAL = new SubThemeDAL(); List <ResultABC> statList = new List <ResultABC>(); statList = statDAL.GetAllResultsByUserID(userId); TableRow tRow = new TableRow(); TableCell tCell = new TableCell(); Label lblSubThemeName = new Label(); Label lblTestDate = new Label(); Label lblResult = new Label(); const string headerTextDate = "Date"; const string headerTextSuBTheme = "SubTheme Name"; const string headerTextResult = "Result"; ConfigureLable(lblTestDate, headerTextDate); ConfigureCell(tCell, lblTestDate); lblTestDate = new Label(); tRow.Cells.Add(tCell); tCell = new TableCell(); ConfigureLable(lblSubThemeName, headerTextSuBTheme); ConfigureCell(tCell, lblSubThemeName); lblSubThemeName = new Label(); tRow.Cells.Add(tCell); tCell = new TableCell(); ConfigureLable(lblResult, headerTextResult); ConfigureCell(tCell, lblResult); lblResult = new Label(); tRow.Cells.Add(tCell); tCell = new TableCell(); tbl.Rows.Add(tRow); tRow = new TableRow(); foreach (ResultABC result in statList) { string testDate = result.TestDate.ToString(); ConfigureLable(lblTestDate, testDate); tCell.Controls.Add(lblTestDate); lblTestDate = new Label(); tRow.Cells.Add(tCell); tCell = new TableCell(); //Get subTHeme name from resultABC.SubThemeID string subTheme = subThDAL.GetSubThemeBySubThemeId(result.SubThemeID); ConfigureLable(lblSubThemeName, subTheme); tCell.Controls.Add(lblSubThemeName); lblSubThemeName = new Label(); tRow.Cells.Add(tCell); tCell = new TableCell(); lblResult.Text = result.Result.ToString(); tCell.Controls.Add(lblResult); double testResult = result.Result; ConfigureCellColor(testResult, tCell); lblResult = new Label(); tRow.Cells.Add(tCell); tCell = new TableCell(); tbl.Rows.Add(tRow); tRow = new TableRow(); } }
public StatictisBLL() { statisticDAL = new StatisticDAL(); }