Esempio n. 1
0
        protected void draw_table()
        {
            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);

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

            tableContent.Rows.Add(row);



            List <resultsModel> results = conn.get2018Results();

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

                cell.Text = x.ToString();
                row.Cells.Add(cell);
                //cell.InnerText = "Vote!";
                //row.Cells.Add(txtBox);

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

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

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

                tableContent.Rows.Add(row);
            }
        }