コード例 #1
0
ファイル: AdminTabsVM.cs プロジェクト: yiiluz/DrConsole
        public async Task ExecuteAsyncAddDoctor(object parameter)
        {
            AddDoctorDialogV addDoctorDialogView = new AddDoctorDialogV();
            await addDoctorDialogView.ShowAsync();

            RefreshTableExecute(null);
        }
コード例 #2
0
        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;
        }
コード例 #3
0
        public object ExecuteCancel(object parameter)
        {
            AddDoctorDialogV addDoctorUC = (AddDoctorDialogV)parameter;

            addDoctorUC.Hide();
            return(null);
        }
コード例 #4
0
        // 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));
        }