Example #1
0
 private void btnChange_Click(object sender, RoutedEventArgs e)
 {
     WPFMessageBox msgBox = new WPFMessageBox();
     msgBox.lblMsg.Text = "是否切换用户!";
     msgBox.lblTitle.Text = "提示信息";
     msgBox.ShowDialog();
     if (msgBox.IsFlag)
     //if (MessageBox.Show("是否切换用户!", "提示信息", MessageBoxButton.OKCancel, MessageBoxImage.Error) == MessageBoxResult.OK)
     {
         Syspatient patient = null;
         SelectPatientEvent.Instance.Publish(patient);
         Login login = new Login();
         login.IsLogin = true;
         login.Show();
     }
 }
Example #2
0
 private void btnExit_Click(object sender, RoutedEventArgs e)
 {
     WPFMessageBox msgBox = new WPFMessageBox();
     msgBox.lblMsg.Text = "是否退出!";
     msgBox.lblTitle.Text = "提示信息";
     msgBox.Topmost = true;
     msgBox.ShowDialog();
     if (msgBox.IsFlag)
     //if (MessageBox.Show("是否退出!", "提示信息", MessageBoxButton.OKCancel, MessageBoxImage.Error) == MessageBoxResult.OK)
     {
         Syspatient patient = null;
         SelectPatientEvent.Instance.Publish(patient);
         //ModuleConstant.PatientId = null;
         //ModuleConstant.PatientName = null;
         //ModuleConstant.UserName = null;
         Application.Current.Shutdown();
     }
 }
 private void btnShutDown_Click(object sender, RoutedEventArgs e)
 {
    
     WPFMessageBox msgBox = new WPFMessageBox();
     msgBox.lblMsg.Text = "是否关机!";
     msgBox.lblTitle.Text = "提示信息";
     msgBox.Topmost = true;
     msgBox.ShowDialog();
     if (msgBox.IsFlag)
     {
         Application.Current.Shutdown();
         System.Threading.Thread.Sleep(1000);
         WindowsAPI.DoExitWin(WindowsAPI.EWX_SHUTDOWN);
     }
     else
     {
     }
 }
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            WPFMessageBox msgBox = new WPFMessageBox();
            msgBox.lblMsg.Text = "是否删除!";
            msgBox.lblTitle.Text = "提示信息";
            msgBox.ShowDialog();
            if (msgBox.IsFlag)
            {
                Button btn = sender as Button;

                foreach (var item in PrescriptionList)
                {
                    if (item.Id == btn.Tag.ToString())
                    {
                        PrescriptionList.Remove(item);
                        break;
                    }
                }
                BindData();
            }
        }
 private void btnClear_Click(object sender, RoutedEventArgs e)
 {
     WPFMessageBox msgBox = new WPFMessageBox();
     msgBox.lblMsg.Text = "是否清空动作列表!";
     msgBox.lblTitle.Text = "提示信息";
     msgBox.ShowDialog();
     if (msgBox.IsFlag)
     //if (MessageBox.Show("是否清空动作列表!", "提示信息", MessageBoxButton.OKCancel, MessageBoxImage.Error) == MessageBoxResult.OK)
     {
         listResult.Clear();
         CboAction.SelectedIndex = 0;
         CboMode.SelectedIndex = 0;
         this.setControlSpeed.Value = 2;
         this.setControlForce.Value = 3;
         this.setControlMinAngle.Value = -20;
         this.setControlMaxAngle.Value = 20;
         this.setControlTimes.Value = 5;
         this.setControlPosition.Value = 0;
         this.setControlGroup.Value = 1;
     }
 }
        private void btnMyAction_Click(object sender, RoutedEventArgs e)
        {
            WPFMessageBox msgBox = new WPFMessageBox();
            msgBox.lblMsg.Text = "是否删除!";
            msgBox.lblTitle.Text = "提示信息";
            msgBox.ShowDialog();
            if (msgBox.IsFlag)
            //if (MessageBox.Show("是否删除!", "提示信息", MessageBoxButton.OKCancel, MessageBoxImage.Error) == MessageBoxResult.OK)
            {
                ItemDemo item = MyActionListBox.SelectedItem as ItemDemo;
                listResult.Remove(item);

                if (listResult.Count == 0)
                {
                    CboAction.SelectedIndex = 0;
                    CboMode.SelectedIndex = 0;
                    this.setControlSpeed.Value = 2;
                    this.setControlForce.Value = 3;
                    this.setControlMinAngle.Value = -20;
                    this.setControlMaxAngle.Value = 20;
                    this.setControlTimes.Value = 5;
                    this.setControlPosition.Value = 0;
                    this.setControlGroup.Value = 1;
                }
                else
                {
                    MyActionListBox.SelectedIndex = 0;
                }
            }
        }
        private void btnDelAction_Click(object sender, RoutedEventArgs e)
        {
            Prescription Prescription = CourseListBox.SelectedItem as Prescription;
            if (Prescription != null)
            {
                WPFMessageBox IfMsgBox = new WPFMessageBox();
                IfMsgBox.lblMsg.Text = "是否删除!";
                IfMsgBox.lblTitle.Text = "提示信息";
                IfMsgBox.Topmost = true;
                IfMsgBox.ShowDialog();                                                                                                                             
                if (IfMsgBox.IsFlag)
                {
                    if (Prescription.PatientId != "" && Prescription.PatientId != null)
                    {

                        var list = (from od in MySession.Query<Prescriptiondetails>()
                                    where od.PrescriptionId == Prescription.Id
                                    select od).OrderBy(x => x.LastTime).ToList();

                        if (list.Count > 0)
                        {
                            foreach (var item in list)
                            {
                                MySession.Session.Delete(item);
                                MySession.Session.Flush();
                            }
                        }

                        MySession.Session.Delete(Prescription);
                        MySession.Session.Flush();

                        tabChoose.SelectedIndex = 0;
                        BindPrescription(ModuleConstant.PatientId);
                    }
                    else
                    {
                        AlarmDialog msgBox = new AlarmDialog();
                        msgBox.lblMsg.Text = "内置疗程,不能删除!";
                        msgBox.lblTitle.Text = "提示信息";
                        msgBox.Show();
                    }
                }
                else
                {
                    AlarmDialog msgBox = new AlarmDialog();
                    msgBox.lblMsg.Text = "请选择疗程!";
                    msgBox.lblTitle.Text = "提示信息";
                    msgBox.Show();
                }
            }
               

        }
        private void btnChange_Click(object sender, RoutedEventArgs e)
        {
            WPFMessageBox msgBox = new WPFMessageBox();
            msgBox.lblMsg.Text = "是否修改!";
            msgBox.lblTitle.Text = "提示信息";
            msgBox.Topmost = true;
            msgBox.ShowDialog();
            if (msgBox.IsFlag)
            {
                ComboBoxItem cbi = (ComboBoxItem)this.CboAction.SelectedItem;
                ComboBoxItem cbiMode = (ComboBoxItem)this.CboMode.SelectedItem;
                if (MyActionListBox.SelectedIndex != -1)
                {
                    if (listResult.Count > 0)
                    {
                        new Thread(() =>
                        {
                            this.Dispatcher.Invoke(new Action(() =>
                            {
                                int testIndex = MyActionListBox.SelectedIndex;
                                ItemDemo item = listResult[MyActionListBox.SelectedIndex] as ItemDemo;
                                item.ActionName = cbi.Content.ToString();
                                item.ActionId = CboAction.SelectedIndex;
                                item.Mode = CboMode.SelectedIndex;
                                item.ModeName = cbiMode.Content.ToString();
                                item.Force = setControlForce.Value;
                                item.Speed = setControlSpeed.Value;
                                item.MinAngle = setControlMinAngle.Value;
                                item.MaxAngle = setControlMaxAngle.Value;
                                item.GroupTimes = item.GroupTimes;
                                item.Times = setControlTimes.Value;
                                item.Position = setControlPosition.Value;
                                item.GroupTimes = setControlGroup.Value;
                                ItemDemo changeItem = new ItemDemo();
                                SetItem(item, changeItem);
                                listResult.RemoveAt(MyActionListBox.SelectedIndex);
                                listResult.Insert(testIndex, changeItem);
                                MyActionListBox.DataContext = listResult;
                                MyActionListBox.SelectedIndex = testIndex;

                            }));
                        }).Start();
                    }
                }
            }
        }
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     WPFMessageBox msgBox = new WPFMessageBox();
     msgBox.lblMsg.Text = "是否删除!";
     msgBox.lblTitle.Text = "提示信息";
     msgBox.ShowDialog();
     if (msgBox.IsFlag)
     {
         Button btn = sender as Button;
         EvaluteDetail item = MySession.Session.Get<EvaluteDetail>(Convert.ToInt32(btn.Tag));
         MySession.Session.Delete(item);
         MySession.Session.Flush();
         BindDayReport(ModuleConstant.PatientId,true);
     }
 }
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     this.main = ((LumbarRobot.MyUserControl.WPFMessageBox)(target));
     return;
     case 2:
     this.sbOpShow = ((System.Windows.Media.Animation.Storyboard)(target));
     return;
     case 3:
     this.lblTitle = ((System.Windows.Controls.TextBlock)(target));
     return;
     case 4:
     this.btnClosed = ((System.Windows.Controls.Button)(target));
     return;
     case 5:
     this.lblMsg = ((System.Windows.Controls.TextBlock)(target));
     return;
     case 6:
     this.ButtonsGrid = ((System.Windows.Controls.Grid)(target));
     return;
     case 7:
     this.btnYes = ((System.Windows.Controls.Button)(target));
     return;
     case 8:
     this.btnOk = ((System.Windows.Controls.Button)(target));
     
     #line 205 "..\..\..\..\MyUserControl\WPFMessageBox.xaml"
     this.btnOk.Click += new System.Windows.RoutedEventHandler(this.btnOk_Click);
     
     #line default
     #line hidden
     return;
     case 9:
     this.btnNo = ((System.Windows.Controls.Button)(target));
     return;
     case 10:
     this.btnCancel = ((System.Windows.Controls.Button)(target));
     
     #line 207 "..\..\..\..\MyUserControl\WPFMessageBox.xaml"
     this.btnCancel.Click += new System.Windows.RoutedEventHandler(this.btnCancel_Click);
     
     #line default
     #line hidden
     return;
     }
     this._contentLoaded = true;
 }