public void AddNewTBRBook(IAddNewTBRBookView inForm, ITBRRepository tbrRepository) { if (inForm.ShowViewModal() == true) { try { string title = inForm.Title; string author = inForm.Author; string publisher = inForm.Publisher; DateTime datePub = inForm.DatePublished; int numPages = inForm.NumberOfPages; string genre = inForm.Genre; string recommendedBy = inForm.RecommendedBy; BookTBR newTBR = BookFactory.CreateBookTBR(title, author, publisher, datePub, numPages, genre, recommendedBy); tbrRepository.AddBookTBR(newTBR); } catch (Exception ex) { MessageBox.Show("EXCEPTION: " + ex.Message); throw; } } }
public MainFormController(IWindowFormsFactory inFormFactory, IReadRepository inReadRepo, ITBRRepository inTBRRepo, IOwnedRepository inOwnedRepo, ILibraryRepository inLibraryRepo, IWishlistRepository inWishlistRepo) { _formsFactory = inFormFactory; _readRepository = inReadRepo; _tbrRepository = inTBRRepo; _ownedRepository = inOwnedRepo; _libraryRepository = inLibraryRepo; _wishlistRepository = inWishlistRepo; }
public void ViewTBRBooks(IShowTBRBookListView inForm, ITBRRepository tbrRepository, IMainController mainController) { List <BookTBR> listBooks = tbrRepository.getListBooksTBR(); inForm.ShowModaless(mainController, listBooks); }