예제 #1
0
        public async Task ExecuteAsyncAdd(object parameter)
        {
            AddPatientDialogV addPatientUC = (AddPatientDialogV)parameter;

            addPatientUC.addNewPatientProggressBar.IsIndeterminate = true;
            String errorMessage = null;
            await Task.Run(() =>
            {
                try
                {
                    ExecuteSyncAdd();
                }
                catch (Exception e)
                {
                    errorMessage = e.Message;
                }
            });

            if (errorMessage == null)
            {
                addPatientUC.Hide();
            }
            else
            {
                MessageBox.Show("Error: " + errorMessage, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
            }
            addPatientUC.addNewPatientProggressBar.IsIndeterminate = false;
        }
예제 #2
0
        public object ExecuteCancel(object parameter)
        {
            AddPatientDialogV addPatientUC = (AddPatientDialogV)parameter;

            addPatientUC.Hide();
            return(null);
        }
예제 #3
0
        // Add Patient
        public bool CanExecuteAdd(object parameter)
        {
            AddPatientDialogV addPatientUC = (AddPatientDialogV)parameter;

            if (addPatientUC == null)
            {
                return(false);
            }
            return(!string.IsNullOrEmpty(addPatientUC.FirstName.Text) &&
                   !string.IsNullOrEmpty(addPatientUC.LastName.Text) &&
                   !string.IsNullOrEmpty(addPatientUC.ID.Text) &&
                   !string.IsNullOrEmpty(addPatientUC.Address.Text) &&
                   !string.IsNullOrEmpty(addPatientUC.BirthDate.Text));
        }