public void GetSearchResult() { ClearLastResult(); foreach (var book in result) { BookUserControler bookUserControler = new BookUserControler(book, _libraryPresenter); _panelSearchResult.Controls.Add(bookUserControler); bookUserControlers.Add(bookUserControler); } }
public void Search(FlowLayoutPanel panel, string Search) { IList <IBook> books = helper.SearchBookByAuthorAndBookTitle(Search); ClearLastResult(panel, bookUserControlersMain); foreach (var book in books) { BookUserControler bookUserControler = new BookUserControler(book, _libraryPresenter); panel.Controls.Add(bookUserControler); bookUserControlersMain.Add(bookUserControler); } }
public void GetMostReadBooks(FlowLayoutPanel panel, int numberOfBooks) { var mostRead = borrowedbooks.GroupBy(q => q.Book) .OrderByDescending(gp => gp.Count()) .Take(numberOfBooks) .Select(g => g.Key).ToList(); ClearLastResult(panel, bookUserControlersMostRead); foreach (var book in mostRead) { BookUserControler bookUserControler = new BookUserControler(book, _libraryPresenter); panel.Controls.Add(bookUserControler); bookUserControlersMostRead.Add(bookUserControler); } }
public void displayAllBooks(FlowLayoutPanel flowLayoutPanelAllBooks) { try { ClearLastResult(flowLayoutPanelAllBooks); } catch { } foreach (var item in _libraryPresenter.GetBooks()) { BookUserControler bookcontroler = new BookUserControler(item, _libraryPresenter); flowLayoutPanelAllBooks.Controls.Add(bookcontroler); } }
public void SearchCategory(FlowLayoutPanel flowLayoutPanelCategory, string text) { try { ClearLastResult(flowLayoutPanelCategory); } catch { } foreach (var item in searchHelper.SearchBookByCategory(text)) { BookUserControler bookcontroler = new BookUserControler(item, _libraryPresenter); flowLayoutPanelCategory.Controls.Add(bookcontroler); } }
public void Search(string text, FlowLayoutPanel flowLayoutPanelBooks) { ClearLastResult(flowLayoutPanelBooks); foreach (var item in helper.SearchByBookTitle(text)) { BookUserControler bookUserControler = new BookUserControler(item, _libraryPresenter); if (item.BookCopies.NumberOfBookLeft > 0) { CheckBox checkbox = new CheckBox(); //to DO // checkbox.CheckedChanged += Checkbox_CheckedChanged; bookUserControler.Controls.Add(checkbox); } flowLayoutPanelBooks.Controls.Add(bookUserControler); controlerList.Add(bookUserControler); } }