//delete customer private void btnDelete_Click(object sender, RoutedEventArgs e) { Customer bCustomer = new Customer(); if (txtBoxfindID.Text != "") { int custID = Convert.ToInt16(txtBoxfindID.Text); bCustomer = dataLayerSingleton.findCustomer(custID); if (lstBoxBookings.Items.Count == 0) { dataLayerSingleton.deleteCustomer(custID); } else { MessageBox.Show("You can't delete a customer if it has bookings"); return; } //clear boxes txtBoxfindID.Clear(); lblShowName.Content = ""; lblShowAddress.Content = ""; //remove customer from listbox lstBoxCustomers.Items.Remove(custID); btnDelete.IsEnabled = false; btnModify.IsEnabled = false; MessageBox.Show("Don't forget to UPDATE INFORMATION before going to next page."); } else { MessageBox.Show("Nah nah"); } }