Ejemplo n.º 1
0
            public void fillWithRecommendations(LinkedList <BookWithCategoriesAuthorsAndScore> books)
            {
                dgv.Rows.Clear();
                dgv.Columns[1].Visible = false;
                dgv.Columns[2].Visible = true;

                /*
                 * for(int i=0; i< books.Count; i++)
                 * {
                 *  Book toDisplayBook = books.ElementAt(i);
                 *  int score = scores.ElementAt(i);
                 *  BookInfoContainer bookTitle = new BookContainerTitle(toDisplayBook);
                 *  BookInfoContainer bookAuthor = new BookContainerAuthors(toDisplayBook);
                 *
                 *  BookInfoContainer bookScore = new BookContainerScore(score, toDisplayBook);
                 *  dgv.Rows.Add(bookTitle, bookAuthor, bookScore);
                 * }
                 */
                foreach (BookWithCategoriesAuthorsAndScore b in books)
                {
                    int score = b.Score;
                    BookInfoContainer bookTitle  = new BookContainerTitle(b);
                    BookInfoContainer bookAuthor = new BookContainerAuthors(b);

                    BookInfoContainer bookScore = new BookContainerScore(score, b);
                    dgv.Rows.Add(bookTitle, bookAuthor, bookScore);
                }
            }
Ejemplo n.º 2
0
 public void fillWithSearchResults(LinkedList <BookWithAuthorsAndCategories> books)
 {
     dgv.Rows.Clear();
     dgv.Columns[1].Visible = true;
     dgv.Columns[2].Visible = false;
     foreach (Book book in books)
     {
         BookInfoContainer bookAuthor = new BookContainerAuthors(book);
         BookInfoContainer bookTitle  = new BookContainerTitle(book);
         dgv.Rows.Add(bookTitle, bookAuthor);
     }
 }