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.Floor.ToString()) || String.IsNullOrEmpty(ClinicManager.MaximumNumberOfSupervisedDoctors.ToString()) || String.IsNullOrEmpty(ClinicManager.MinimumNumberOfSupervisedRooms.ToString())) { MessageBox.Show("Please fill all fields.", "Notification"); } else { try { MessageBoxResult result = MessageBox.Show("Are you sure you want to save the manager?", "Confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question); if (result == MessageBoxResult.Yes) { bool isCreated = managers.CreateManager(ClinicManager); if (isCreated) { MessageBox.Show("Manager is created.", "Notification", MessageBoxButton.OK); managerView.Close(); } else { MessageBox.Show("Manager cannot be created.", "Notification", MessageBoxButton.OK); } } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } } }