//Preconditions: click Insert>Book //Postconditions: pops up a dialog box for user to enter book information. stores the information as a book in the library private void bookSubMenuItem_Click(object sender, EventArgs e) { BookDialogBox bookDBox = new BookDialogBox(); //create object for BookDialogBox bookDBox.ShowDialog(); //pulls up the BookDialogBox theLibrary.AddLibraryBook(bookDBox.AddTitle, bookDBox.AddPublisher, bookDBox.AddCopyrightYear, bookDBox.AddLoanPeriod, bookDBox.AddCallNumber, bookDBox.AddAuthor); }
//Preconditions: click Report>List Items //Postconditions: goes through a loop to display all items stored in the library private void itemListSubMenuItem_Click(object sender, EventArgs e) { BookDialogBox bookDBox = new BookDialogBox(); outputTextBox.Text = ""; //clears textbox outputTextBox.Text = "Count of items: " + theLibrary.GetItemCount() + System.Environment.NewLine + System.Environment.NewLine; for (int k = 0; k < theLibrary._items.Count; k++) //loops through the library and displaying items { outputTextBox.Text += theLibrary._items[k] + System.Environment.NewLine + System.Environment.NewLine; } }