public async Task ExecuteAsyncAddDoctor(object parameter) { AddDoctorDialogV addDoctorDialogView = new AddDoctorDialogV(); await addDoctorDialogView.ShowAsync(); RefreshTableExecute(null); }
public async Task ExecuteAsyncAdd(object parameter) { AddDoctorDialogV addDoctorUC = (AddDoctorDialogV)parameter; addDoctorUC.addNewDoctorProggressBar.IsIndeterminate = true; String errorMessage = null; await Task.Run(() => { try { ExecuteSyncAdd(); } catch (Exception e) { errorMessage = e.Message; } }); if (errorMessage == null) { addDoctorUC.Hide(); } else { MessageBox.Show("Error: " + errorMessage, "Error", MessageBoxButton.OK, MessageBoxImage.Error); } addDoctorUC.addNewDoctorProggressBar.IsIndeterminate = false; }
public object ExecuteCancel(object parameter) { AddDoctorDialogV addDoctorUC = (AddDoctorDialogV)parameter; addDoctorUC.Hide(); return(null); }
// Add Doctor public bool CanExecuteAdd(object parameter) { AddDoctorDialogV addDoctorUC = (AddDoctorDialogV)parameter; if (addDoctorUC == null) { return(false); } return(!string.IsNullOrEmpty(addDoctorUC.FirstName.Text) && !string.IsNullOrEmpty(addDoctorUC.LastName.Text) && !string.IsNullOrEmpty(addDoctorUC.ID.Text) && !string.IsNullOrEmpty(addDoctorUC.Address.Text) && !string.IsNullOrEmpty(addDoctorUC.BirthDate.Text) && !string.IsNullOrEmpty(addDoctorUC.UserName.Text) && !string.IsNullOrEmpty(addDoctorUC.GraduationDate.Text) && !string.IsNullOrEmpty(addDoctorUC.License.Text) && !string.IsNullOrEmpty(addDoctorUC.Expertize.Text)); }