Beispiel #1
0
        protected void PopulatePage(int pagenum = 1)
        {
            litBookSearchData.Text = String.Empty;
            strSearch = txtSearch.Text.ToString();
            bookSearch = IsbnApiClient.GetSearchResults(strSearch, pagenum);
            //litBookSearchData.Text += "http://isbndb.com/api/v2/json/T3GGKVH2/books?q=science<br/><br/>";
            int searchIteration = 0;

            litBookSearchData.Text += "Current Page: " + bookSearch.current_page + " of " + bookSearch.page_count + "<br/>";
            litBookSearchData.Text += "Results Count: " + bookSearch.result_count;
            /*
                          <table class="table table-striped table-hover ">
                <thead>
                  <tr>
                    <th>#</th>
                    <th>Column heading</th>
                    <th>Column heading</th>
                    <th>Column heading</th>
                  </tr>
                </thead>
                <tbody>
                  <tr>
                    <td>1</td>
                    <td>Column content</td>
                    <td>Column content</td>
                    <td>Column content</td>
                  </tr>
                </tbody>
              </table> 
              */
            foreach (SearchDatum b in bookSearch.data)

            {
                // b.author_data[0].name +
                /*
                litBookSearchData.Text += "<tr><td>" + searchIteration.ToString() + "</td><td>" +
                 b.awards_text + "</td><td>" + b.book_id + "</td><td>" +
                 b.dewey_decimal + "</td><td>" + b.dewey_normal + "</td><td>" + b.edition_info + "</td><td>" + b.isbn10 + "</td><td>" + b.isbn13 + "</td><td>" +
                 b.language + "</td><td>" + b.lcc_number + "</td><td>" + b.marc_enc_level + "</td><td>" + b.notes + "</td><td>" + b.physical_description_text + "</td><td>" + b.publisher_id + "</td><td>" + b.publisher_name +
                 b.publisher_text + "</td><td>" + b.summary + "</td><td>" + b.title + "</td><td>" + b.title_latin + "</td><td>" + b.title_long + "</td><td>" + b.urls_text + "</td></tr>";
                 */
                litBookSearchData.Text += "<tr><td>" + searchIteration.ToString() + "</td><td>" + b.isbn10 + "</td><td>" + b.isbn13 + "</td><td>" +
                b.publisher_name +
                "</td><td>" + b.title + "</td><td>" + b.title_long + "</td><td>" + "</td><td>" + b.summary + "</td><td>" + "<a href=''>Add to Collection</a>" + bookSearch.data.IndexOf(b) + "</td></tr>";
                
                searchIteration++;
            }
        }
Beispiel #2
0
        protected void CreateTable(int pagenum = 1)
        {
            pnlLowerButtons.Visible = true;
            pnlUpperButtons.Visible = true;
            litBookSearchData.Text = String.Empty;
            strSearch = txtSearch.Text.ToString();
            bookSearch = IsbnApiClient.GetSearchResults(strSearch, pagenum);
            int searchIteration = 0;
            litBookSearchData.Text += "Current Page: " + bookSearch.current_page + " of " + bookSearch.page_count + "<br/>";
            litBookSearchData.Text += "Results Count: " + bookSearch.result_count;

            row = new TableRow();
            cell = new TableCell();
            thcNumber = new TableHeaderCell();
            thcISBN13 = new TableHeaderCell();
            thcPublisher = new TableHeaderCell();
            thcTitle = new TableHeaderCell();
            thcAuthor = new TableHeaderCell();
            thcSummary = new TableHeaderCell();

            thcNumber.Text = "#";
            thcISBN13.Text = "ISBN-13";
            thcPublisher.Text = "Publisher";
            thcTitle.Text = "Title";
            thcAuthor.Text = "Author";
            thcSummary.Text = "Summary";

            row.Cells.Add(thcNumber);
            row.Cells.Add(thcISBN13);
            row.Cells.Add(thcPublisher);
            row.Cells.Add(thcTitle);
            row.Cells.Add(thcAuthor);
            row.Cells.Add(thcSummary);
            
            tblSearch.Rows.Add(row);

            foreach (SearchDatum b in bookSearch.data)

            {
                tRow = new TableRow();
                tCell = new TableCell();
                isbn13Cell = new TableCell();
                publisherCell = new TableCell();
                titleCell = new TableCell();
                authorCell = new TableCell();
                summaryCell = new TableCell();
                collectionCell = new TableCell();
                tCell.Text = searchIteration.ToString();
                isbn13Cell.Text = b.isbn13;
                publisherCell.Text = b.publisher_name;
                titleCell.Text = b.title;
                if (b.author_data.Count > 0)
                {
                    authorCell.Text = b.author_data[0].name;
                }
                else
                {
                    authorCell.Text = string.Empty;
                }
                summaryCell.Text = b.summary;
                collectionCell.Controls.Add(lnkButton = new HyperLink());
                lnkButton.Text = "Select";
                lnkButton.NavigateUrl = addBookUrl + b.isbn13;
                tRow.Cells.Add(tCell);
                tRow.Cells.Add(isbn13Cell);
                tRow.Cells.Add(publisherCell);
                tRow.Cells.Add(titleCell);
                tRow.Cells.Add(authorCell);
                tRow.Cells.Add(summaryCell);
                tRow.Cells.Add(collectionCell);
                tblSearch.Rows.Add(tRow);
               searchIteration++;
            }
        }
Beispiel #3
0
        public void AddToCollection(BookSearchResults bsr)
        {

        }