//delete booking private void btnDeleteBooking_Click(object sender, RoutedEventArgs e) { Booking bBooking = new Booking(); if (lblhello.Content != null) { int bookingid = Convert.ToInt16(lblhello.Content); //find which booking has to be deleted foreach (Booking b in aCustomer.BookingsList) { if (bookingid == b.BookingID) { bBooking = b; } } aCustomer.BookingsList.Remove(bBooking); dataLayerSingleton.deleteBooking(bookingid); MessageBox.Show("Don't forget to UPDATE INFORMATION before going to next page."); //clear boxes lblBookingStartDate.Content = ""; lblBookingEndDate.Content = ""; lblhello.Content = ""; //remove booking from listbox lstBoxBookings.Items.Remove(bookingid); btnDeleteBooking.IsEnabled = false; } else { MessageBox.Show("Nah nah"); } }