예제 #1
0
 /*
  * Adds a book obj to students book list
  * Assumes max number of books have not been reached
  */
 private void AddToBookCollection(Book book)
 {
     if (NumOfBooks < MAX_NUM_OF_BOOKS) {
         BookCollection.AddLast(book);
         NumOfBooks++;
     }
 }
예제 #2
0
 private void RemoveFromBookCollection(Book book)
 {
     try {
         BookCollection.Remove(book);
     }
     catch (Exception e) {
         Console.WriteLine("Student does not have a book with ID: {0}", book.Id);
         Console.WriteLine(e.Message);
     }
 }