public void DisplayBookData(string cellclicked, Panel panelBookData, Button btnReturn) { try { bookDataControler.Visible = false; } catch { } IBookBorrowed selectedbook = null; foreach (var item in user.CurrentBooksBorrowed) { if (item.Book.ISBN.ToString().Equals(cellclicked)) { selectedbook = item; } } if (selectedbook != null) { book = selectedbook; bookDataControler = new BookDataControler(_libraryPresenter, selectedbook); panelBookData.Visible = true; btnReturn.Visible = true; btnReturn.BringToFront(); bookDataControler.Visible = true; panelBookData.Controls.Add(bookDataControler); } }
public BookDataControler(ILibraryPresenter libraryPresenter, IBookBorrowed bookdata) { _libraryPresenter = libraryPresenter; borrowedBook = bookdata; InitializeComponent(); Initialize(); }
public void Remove(IBookBorrowed book) { TotalBarrowedList.Remove(book); SaveForBinary(); }
public void Add(IBookBorrowed book) { TotalBarrowedList.Add(book); SaveForBinary(); BorrowedContainerChanged?.Invoke(this, null); }
public void Return(IUser selectedUser, IBookBorrowed borrowedBook) { selectedUser.ReturnBook(borrowedBook, DateTime.Now); borrowedBook.Book.BookCopies.Return(); _libraryPresente.Container.Save(); }
public void ReturnBook(IBookBorrowed book, DateTime returnDate) { currentBooksBorrowed.Remove(book); book.AddReturnDate(returnDate); booksReturned.Add(book); }
public void BarrowBook(IBookBorrowed book) { currentBooksBorrowed.Add(book); }