private void Save_Customer_Details(object sender, RoutedEventArgs e) { if (!(String.IsNullOrEmpty(customerName.Text) || String.IsNullOrEmpty(customerPhone.Text))) // If customer name and phone are not empty { customerDetails.IsEnabled = false; // Disable the customer details groupbox Customer newCustomer = new Customer(customerName.Text, customerPhone.Text); if (newCustomer.Check()) { newCustomer.SaveCustomer(); customerPhone.ItemsSource = Customer.Phones; } vehiclePrice.Focus(); // Set focus } else { MessageBox.Show("Customer details must be filled in before saving"); // Prompt user to enter data if (String.IsNullOrEmpty(customerName.Text)) { customerName.Focus(); // Set focus to Customer Name } else { customerPhone.Focus(); // Set focus to Customer Phone } } }