Пример #1
0
        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);
            }
        }
Пример #2
0
 public BookDataControler(ILibraryPresenter libraryPresenter, IBookBorrowed bookdata)
 {
     _libraryPresenter = libraryPresenter;
     borrowedBook      = bookdata;
     InitializeComponent();
     Initialize();
 }
Пример #3
0
 public void Remove(IBookBorrowed book)
 {
     TotalBarrowedList.Remove(book);
     SaveForBinary();
 }
Пример #4
0
 public void Add(IBookBorrowed book)
 {
     TotalBarrowedList.Add(book);
     SaveForBinary();
     BorrowedContainerChanged?.Invoke(this, null);
 }
Пример #5
0
 public void Return(IUser selectedUser, IBookBorrowed borrowedBook)
 {
     selectedUser.ReturnBook(borrowedBook, DateTime.Now);
     borrowedBook.Book.BookCopies.Return();
     _libraryPresente.Container.Save();
 }
Пример #6
0
 public void ReturnBook(IBookBorrowed book, DateTime returnDate)
 {
     currentBooksBorrowed.Remove(book);
     book.AddReturnDate(returnDate);
     booksReturned.Add(book);
 }
Пример #7
0
 public void BarrowBook(IBookBorrowed book)
 {
     currentBooksBorrowed.Add(book);
 }