public void Checkout(string isbn, CardHolder cardHolder)
 {
     foreach (Book book in _listBooks)
     {
         if (book.ISBN == isbn && book.IsAvailable)
         {
             cardHolder.CheckoutBook(book);
             book.IsAvailable = false;
         }
     }
 }
Ejemplo n.º 2
0
 // A Checkout book method
 public void Checkout(string isbn, CardHolder cardholder)
 {
     foreach (Book book in _bookList)
     {
         // iterates over the list of books and checks if a books ISBN matches and if it is available
         if (book.ISBN == isbn && book.IsAvailable)
         {
             // If both are true then add the book to the person's list of current books and change availability to false
             cardholder.CheckoutBook(book);
             book.IsAvailable = false;
         }
     }
 }
Ejemplo n.º 3
0
 public void Checkout(string isbn, CardHolder cardHolder)
 {
     // Book foundBook = new Book();
     // bool didFindBook = false;
     foreach (Book book in _BookList)
     {
         if (book.ISBN == isbn && book.IsAvailable)
         {
             cardHolder.CheckoutBook(book);
             book.IsAvailable = false;
         }
     }
 }
Ejemplo n.º 4
0
        public void Checkout(string isbn, CardHolder cardHolder)
        {
            Book foundBook = new Book();

            foreach (Book book in _bookList)
            {
                if (book.ISBN == isbn && book.IsAvailble)
                {
                    foundBook = book;
                    cardHolder.CheckoutBook(book);
                    book.IsAvailble = false;
                }
            }
        }