public void SaveExecute() { if (String.IsNullOrEmpty(ClinicManager.NameAndSurname) || String.IsNullOrEmpty(ClinicManager.IdentityCardNumber) || String.IsNullOrEmpty(ClinicManager.DateOfBirth.ToString()) || String.IsNullOrEmpty(ClinicManager.Gender) || String.IsNullOrEmpty(ClinicManager.Citizenship) || String.IsNullOrEmpty(ClinicManager.Username) || String.IsNullOrEmpty(ClinicManager.Password) || String.IsNullOrEmpty(ClinicManager.NumberOfOmissions.ToString()) || String.IsNullOrEmpty(ClinicManager.MaximumNumberOfSupervisedDoctors.ToString()) || String.IsNullOrEmpty(ClinicManager.MinimumNumberOfSupervisedRooms.ToString()) || String.IsNullOrEmpty(ClinicManager.Floor.ToString())) { MessageBox.Show("Please fill all fields.", "Notification"); } else { try { MessageBoxResult result = MessageBox.Show("Are you sure you want to edit the manager?", "Confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question); if (result == MessageBoxResult.Yes) { bool isEdited = managers.EditManager(ClinicManager); if (isEdited) { MessageBox.Show("Manager is edited.", "Notification", MessageBoxButton.OK); managerView.Close(); } else { MessageBox.Show("Manager cannot be edited.", "Notification", MessageBoxButton.OK); } } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } } }