Esempio n. 1
0
        protected void draw_table(int userID)
        {
            SQLFunctions conn = new SQLFunctions();
            TableRow     row;
            TableCell    cell;
            int          x = 0;

            tableContent.Rows.Clear();

            row  = new TableRow();
            cell = new TableCell();

            cell.Text = "Ranking";
            row.Cells.Add(cell);

            cell      = new TableCell();
            cell.Text = "Author";
            row.Cells.Add(cell);

            cell      = new TableCell();
            cell.Text = "Title";
            row.Cells.Add(cell);

            tableContent.Rows.Add(row);

            List <resultsModel> results = conn.get2018PersonalizedRankings(userID);

            foreach (resultsModel rs in results)
            {
                x++;
                row  = new TableRow();
                cell = new TableCell();

                cell.Text = x.ToString();
                row.Cells.Add(cell);

                cell      = new TableCell();
                cell.Text = rs.bookAuthor;
                row.Cells.Add(cell);

                cell      = new TableCell();
                cell.Text = rs.bookTitle;
                row.Cells.Add(cell);

                tableContent.Rows.Add(row);
            }
        }