private void BtnCheckOut_Click(object sender, EventArgs e) { if (lstSelectBook.SelectedIndex != -1) { var selectedItems = lstSelectBook.SelectedItems; List <Book> uncheckedBooks = LibraryHelper.GetAllUncheckedBooks(); List <Book> selectedBooks = GetSelectedItems( selectedItems); if (LibraryHelper.CheckoutBooks(selectedBooks)) { MessageBox.Show("Check-Out Successful."); LoadBoxes(); } else { MessageBox.Show("Check-Out Unsuccessful."); } } else { MessageBox.Show("Nothing selected."); } }