public void SaveExecute() { if (String.IsNullOrEmpty(Clinic.Owner) || String.IsNullOrEmpty(Clinic.NumberOfAccessPointsForAmbulanceCars.ToString()) || String.IsNullOrEmpty(Clinic.NumberOfAccessPointsForInvalids.ToString())) { MessageBox.Show("Please fill all fields.", "Notification"); } else { try { MessageBoxResult result = MessageBox.Show("Are you sure you want to save changes?", "Confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question); if (result == MessageBoxResult.Yes) { bool isEdited = clinics.EditClinic(Clinic); if (isEdited == true) { MessageBox.Show("Clinic is edited.", "Notification", MessageBoxButton.OK); } else { MessageBox.Show("Clinic cannot be edited.", "Notification", MessageBoxButton.OK); } } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } } }