private void btnSavePrescription_Click(object sender, RoutedEventArgs e)
        {
            SetPrescriptionItems();
            ThreadPool.QueueUserWorkItem(new WaitCallback((obj) =>
            {
                lock (objLock)
                {
                    Application.Current.Dispatcher.Invoke(new Action(() =>
                    {
                        if (listResult.Count > 0)
                        {
                            if (SaveCourseDialog == null)
                            {
                                SaveCourseDialog = new SaveCourseDialog();
                                SaveCourseDialog.Parent = this;
                                SaveCourseView child = new SaveCourseView(listResult);
                                child.Close += new EventHandler(child_Close);
                                SaveCourseDialog.Content = child;
                                SaveCourseDialog.Show();
                            }
                        }

                    }));
                }
            }));
        }
Exemplo n.º 2
0
        private void btnSaveCourse_Click(object sender, RoutedEventArgs e)
        {
               ThreadPool.QueueUserWorkItem(new WaitCallback((obj) =>
         {
             lock (objLock)
             {
                 Application.Current.Dispatcher.Invoke(new Action(() =>
                 {
                     if (patientInfo == null)
                     {
                         AlarmDialog dialog = new AlarmDialog();
                         dialog.lblTitle.Text = "提示信息";
                         dialog.lblMsg.Text = "请选择病人!";
                         dialog.ShowDialog();
                     }
                     else
                     {
                         if (listResult.Count > 0)
                         {

                             if (SaveCourseDialog == null)
                             {
                                 SaveCourseDialog = new SaveCourseDialog();
                                 SaveCourseDialog.Parent = this;
                                 
                                 SaveCourseView child = new SaveCourseView(listResult);
                                 child.Close += new EventHandler(child_Close);
                                 SaveCourseDialog.Content = child;
                                 SaveCourseDialog.Show();
                             }
                         }
                         else
                         {
                             AlarmDialog dialog = new AlarmDialog();
                             dialog.lblTitle.Text = "提示信息";
                             dialog.lblMsg.Text = "请选择训练动作及模式!";
                             dialog.ShowDialog();
                         }
                     }
                 }));
             }
         }));
        }