Ejemplo n.º 1
0
        /// <summary>
        /// 刷新计算汇总信息
        /// </summary>
        private void OnRefreshTotalScore(object sender, SYRMGridViewCellValueChangeEventArgs e)
        {
            if (MTB_TotalRecord == null)
            {
                List <MTextBox> list = base.GetControls <MTextBox>();
                if (list != null)
                {
                    foreach (MTextBox textBox in list)
                    {
                        if (textBox.Name.ToUpper().Equals("MTB_TotalRecord".ToUpper()))
                        {
                            //如果找到
                            MTB_TotalRecord = textBox;
                            break;
                        }
                    }
                }
            }

            // MTB_TotalRecord 不为null
            if (MTB_TotalRecord != null)
            {
                MTB_TotalRecord.Text = "0";
                MTB_TotalRecord.Text = e.ValueTatol.ToString();

                foreach (IUIElementHandler handler in _UIElementHandlers)
                {
                    if (handler is TextBoxHandler)
                    {
                        handler.HasDirty = false;
                        break;
                    }
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 重写方法:保存数据前判断
        /// </summary>
        /// <returns></returns>
        public override bool OnCustomCheckBeforeSave()
        {
            bool bl = base.OnCustomCheckBeforeSave();

            if (bl)
            {
                foreach (IUIElementHandler handler in _UIElementHandlers)
                {
                    if (handler.GetControlType == typeof(MTextBox) && handler.GetAllControls != null)
                    {
                        foreach (Control ctl in handler.GetAllControls)
                        {
                            if (ctl is MTextBox)
                            {
                                MTextBox textbox = ctl as MTextBox;
                                if (!string.IsNullOrEmpty(textbox.InputNeededMessage) && string.IsNullOrEmpty(textbox.Text.Trim()))
                                {
                                    MessageBox.Show(textbox.InputNeededMessage, "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly);
                                    return(false);
                                }
                            }
                        }
                    }
                }
            }

            return(bl);
        }
Ejemplo n.º 3
0
        public static MTextBox CloneMTextBox(MTextBox source)
        {
            MTextBox target = new MTextBox();

            CloneMTextBox(source, target);
            return(target);
        }
Ejemplo n.º 4
0
 /// <summary>
 /// 控件属性事件设置
 /// </summary>
 /// <param name="element"></param>
 public override void ControlSetting(MTextBox control)
 {
     base.ControlSetting(control);
     if (!string.IsNullOrEmpty(control.SummaryName) && control.SummaryName.Trim() != string.Empty)
     {
         control.DoubleClick += new EventHandler(control_DoubleClick);
         if (control.SummaryName == "总出量")
         {
             txtZhongChuLiang = control;
         }
         else if (control.SummaryName == "失血量")
         {
             txtShiXueLiang              = control;
             txtShiXueLiang.TextChanged += new EventHandler(controlOut_TextChanged);
         }
         else if (control.SummaryName == "尿量")
         {
             txtNiaoLiang              = control;
             txtNiaoLiang.TextChanged += new EventHandler(controlOut_TextChanged);
         }
         else if (control.SummaryName == "其它出量")
         {
             txtQiTaChuLiang              = control;
             txtQiTaChuLiang.TextChanged += new EventHandler(controlOut_TextChanged);
         }
         else if (control.SummaryName == "总入量")
         {
             txtZhongRuLiang = control;
         }
         else if (control.SummaryName == "胶体")
         {
             txtJiaoTi              = control;
             txtJiaoTi.TextChanged += new EventHandler(controlIn_TextChanged);
         }
         else if (control.SummaryName == "晶体")
         {
             txtJingTi              = control;
             txtJingTi.TextChanged += new EventHandler(controlIn_TextChanged);
         }
         else if (control.SummaryName == "红细胞")
         {
             txtXuanFuHongXiBao              = control;
             txtXuanFuHongXiBao.TextChanged += new EventHandler(controlIn_TextChanged);
         }
         else if (control.SummaryName == "血浆")
         {
             txtXueJiang              = control;
             txtXueJiang.TextChanged += new EventHandler(controlIn_TextChanged);
         }
         else if (control.SummaryName == "其它入量")
         {
             txtQiTaRuLiang              = control;
             txtQiTaRuLiang.TextChanged += new EventHandler(controlIn_TextChanged);
         }
     }
 }
Ejemplo n.º 5
0
        private MTextBox CreateMTextBox(string text, MPoint p1)
        {
            MTextBox molText = new MTextBox();

            molText.setText(text);
            molText.setHorizontalAlignment(MTextBox.ALIGN_LEFT);
            molText.setCorners(p1, p1);
            molText.setAutoSize(true);
            return(molText);
        }
Ejemplo n.º 6
0
 public static void CloneMTextBox(MTextBox source, MTextBox target)
 {
     CloneControl(source, target);
     target.BorderStyle        = source.BorderStyle;
     target.SourceFieldName    = source.SourceFieldName;
     target.SourceTableName    = source.SourceTableName;
     target.DictTableName      = source.DictTableName;
     target.DictValueFieldName = source.DictValueFieldName;
     target.DictWhereString    = source.DictWhereString;
     target.DisplayFieldName   = source.DisplayFieldName;
 }
Ejemplo n.º 7
0
        /// <summary>
        /// 绑定数据源数据到控件
        /// </summary>
        public override void BindDataToUI(MTextBox control, Dictionary <string, DataTable> dataSources)
        {
            base.BindDataToUI(control, dataSources);
            if (!string.IsNullOrEmpty(control.SummaryName) &&
                control.SummaryName.Trim() != string.Empty &&
                string.IsNullOrEmpty(control.Text.Trim()))
            {
                DataContext.GetCurrent().CalTextValue(control, dataSources);
            }

            this.HasDirty = false;
        }
Ejemplo n.º 8
0
        public bool CalTextValue(MTextBox textbox, Dictionary <string, System.Data.DataTable> dataSources)
        {
            bool isChanged = true;                      // 用于判断自动计算的值和原值是否有变化

            if (textbox.SummaryName.Trim() == "病人在室时间") // 移植一体机的计算方式
            {
                double d = this.CalRoomStayedTime(dataSources);
                if (d.ToString("f0").Equals(textbox.Text))
                {
                    isChanged = false;
                }
                else
                {
                    textbox.Text = d > 0 ? d.ToString("f0") : string.Empty;
                    textbox.Data = textbox.Text;
                }
            }
            else if (textbox.SummaryName.Trim() == "病人手术时长")
            {
                double d = this.CalOperTime(dataSources);
                if (d.ToString("f0").Equals(textbox.Text))
                {
                    isChanged = false;
                }
                else
                {
                    textbox.Text = d > 0 ? d.ToString("f0") : string.Empty;
                    textbox.Data = textbox.Text;
                }
            }
            else
            {
                double d = CalLiquiedSum(textbox.SummaryName, dataSources);
                if (d.ToString("f0").Equals(textbox.Text))
                {
                    isChanged = false;
                }
                else
                {
                    textbox.Text = d > 0 ? d.ToString("f0") : string.Empty;
                }
            }


            if (string.IsNullOrEmpty(textbox.Text))
            {
                return(false);
            }
            else
            {
                return(isChanged);// isChanged的值为true则说明值改变了
            }
        }
Ejemplo n.º 9
0
        /// <summary>
        /// 重写保存数据前判断逻辑:必填项提示和时间节点的判断
        /// </summary>
        public override bool OnCustomCheckBeforeSave()
        {
            bool bl = base.OnCustomCheckBeforeSave();

            foreach (IUIElementHandler handler in _UIElementHandlers)
            {
                if (handler.GetControlType == typeof(MTextBox) && handler.GetAllControls != null)
                {
                    foreach (Control ctl in handler.GetAllControls)
                    {
                        if (ctl is MTextBox)
                        {
                            MTextBox textbox = ctl as MTextBox;
                            if (!string.IsNullOrEmpty(textbox.InputNeededMessage) && string.IsNullOrEmpty(textbox.Text.Trim()))
                            {
                                MessageBoxFormPC.Show(textbox.InputNeededMessage);
                                return(false);
                            }
                        }
                    }
                    foreach (Control ctl in handler.GetAllControls)
                    {
                        if (ctl is MTextBox)
                        {
                            if (ctl.Name == "txtInRoomTime")
                            {
                                txtInRoomTime = ctl as MTextBox;
                            }
                            else if (ctl.Name == "txtOutRoomTime")
                            {
                                txtOutRoomTime = ctl as MTextBox;
                            }
                            else if (ctl.Name == "txtOperStart")
                            {
                                txtOperStart = ctl as MTextBox;
                            }
                            else if (ctl.Name == "txtOperEnd")
                            {
                                txtOperEnd = ctl as MTextBox;
                            }
                        }
                    }

                    bl = CheckTime();
                }
            }

            return(bl);
        }
Ejemplo n.º 10
0
        //public void ShowHide(object sender, KeyPressedEventArgs e)
        //{
        //	ShowHide();
        //}

        public void ShowHide()
        {
            if (MWindow.IsVisible)
            {
                MWindow.Hide();
                MTextBox.SelectAll();
            }
            else
            {
                MWindow.Show();
                MTextBox.SelectAll();
                MTextBox.Focus();
                MWindow.Activate();
            }
        }
Ejemplo n.º 11
0
 //<summary>
 //绑定数据源数据到控件
 //</summary>
 //<param name="control"></param>
 //<param name="dataSources"></param>
 public override void BindDataToUI(MTextBox control, Dictionary <string, DataTable> dataSources)
 {
     base.BindDataToUI(control, dataSources);
     //if (!string.IsNullOrEmpty(control.SummaryName) && control.SummaryName.Trim() != string.Empty && string.IsNullOrEmpty(control.Text.Trim()))
     if (!string.IsNullOrEmpty(control.SummaryName) &&
         control.SummaryName.Trim() != string.Empty)// TextBox有值也要重新计算
     {
         //DataContext.GetCurrent().CalTextValue(control, dataSources);
         if (DataContext.GetCurrent().CalTextValue(control, dataSources))
         {
             this.IsAutoInOutDirty = true;// 存在自动计算出入量
         }
     }
     //this.HasDirty = false;
 }
Ejemplo n.º 12
0
 /// <summary>
 /// 设置控件的值
 /// </summary>
 private void SetControlValue(List <CustomControl> customControls, MTextBox text)
 {
     foreach (CustomControl customControl in customControls)
     {
         if (customControl.SimpleValue != null)
         {
             int v;
             if (int.TryParse(customControl.SimpleValue.ToString(), out v))
             {
                 text.Text = v.ToString();
                 break;
             }
         }
     }
 }
Ejemplo n.º 13
0
        private void ctl_TextChanged(object sender, EventArgs e)
        {
            MTextBox txtBox = sender as MTextBox;

            if (!IsNaturalNumber(txtBox.Text) && txtBox.Text.Length > 0)
            {
                MessageBoxFormPC.Show("只允许输入字母和数字。");
                txtBox.Text           = txtBox.Text.Substring(0, txtBox.Text.Length - 1);
                txtBox.SelectionStart = txtBox.Text.Length;
            }
            else
            {
                bPatientID_Change = true;
            }
        }
Ejemplo n.º 14
0
        /// <summary>
        /// 设置同一组自定义控件的值
        /// </summary>
        private void SetGroupControlValue(List <CustomControl> customControls, MTextBox text)
        {
            int total = 0;

            foreach (CustomControl customControl in customControls)
            {
                if (customControl.SimpleValue != null)
                {
                    int v;
                    if (int.TryParse(customControl.SimpleValue.ToString(), out v))
                    {
                        total    += v;
                        text.Text = total.ToString();
                    }
                }
            }
        }
Ejemplo n.º 15
0
 /// <summary>
 /// 获取对应的时长
 /// </summary>
 public void CalTextValue(MTextBox textbox, Dictionary <string, System.Data.DataTable> dataSources)
 {
     if (textbox.SummaryName.Trim() == "病人在室时间")
     {
         double d = this.CalRoomStayedTime(dataSources);
         textbox.Text = d > 0 ? d.ToString("f0") : string.Empty;
         textbox.Data = textbox.Text;
     }
     else if (textbox.SummaryName.Trim() == "病人手术时长")
     {
         double d = this.CalOperTime(dataSources);
         textbox.Text = d > 0 ? d.ToString("f0") : string.Empty;
         textbox.Data = textbox.Text;
     }
     else
     {
         double d = CalLiquiedSum(textbox.SummaryName, dataSources);
         textbox.Text = d > 0 ? d.ToString("f0") : string.Empty;
     }
 }
Ejemplo n.º 16
0
        private void ctl_Leave(object sender, EventArgs e)
        {
            MTextBox txtBox = sender as MTextBox;

            if (txtBox.Name == "mtbInpNo")
            {
                if (!bPatientID_Change)
                {
                    return;
                }
                bPatientID_Change = false;
                SyncPatientByInpNo(txtBox.Text.Trim());
            }
            else if (txtBox.Name == "mtbPatID")
            {
                if (!bPatientID_Change)
                {
                    return;
                }
                bPatientID_Change = false;
                SyncPatientByPatientId(txtBox.Text.Trim());
            }
        }
Ejemplo n.º 17
0
        void control_DoubleClick(object sender, EventArgs e)
        {
            MTextBox textbox = sender as MTextBox;

            DataContext.GetCurrent().CalTextValue(textbox, base.DataSource);
        }
Ejemplo n.º 18
0
        /// <summary>
        /// 计算评分的方法
        /// </summary>
        public void CalculateRiskAssessmentData()
        {
            //获取相关控件
            if (_text1 == null || _text2 == null || _text3 == null || _text4 == null)
            {
                foreach (IUIElementHandler handler in base.MedicalPaperUIElementHandlers)
                {
                    if (handler is TextBoxHandler)
                    {
                        TextBoxHandler h = handler as TextBoxHandler;
                        foreach (MTextBox text in h.GetCurrentControls)
                        {
                            if (text.Name.Trim() == "MTextBox6")
                            {
                                _text1 = text;
                            }
                            else if (text.Name.Trim() == "MTextBox7")
                            {
                                _text2 = text;
                            }
                            else if (text.Name.Trim() == "MTextBox8")
                            {
                                _text3 = text;
                            }
                            else if (text.Name.Trim() == "MTextBox11")
                            {
                                _text4 = text;
                            }
                            else if (text.Name.Trim() == "MTxt_Steward")
                            {
                                _text5 = text;
                            }
                        }

                        break;
                    }
                }
            }

            // 计算手术切口清洁程度
            if (_text1 != null)
            {
                _text1.Text = string.Empty;
                this.SetControlValue(_groupCustomControls["手术切口清洁程度"], _text1);
            }

            // 计算麻醉ASA分级
            if (_text2 != null)
            {
                _text2.Text = string.Empty;
                this.SetControlValue(_groupCustomControls["ASA分级"], _text2);
            }

            // 计算手术持续时间
            if (_text3 != null)
            {
                _text3.Text = string.Empty;
                this.SetControlValue(_groupCustomControls["手术持续时间"], _text3);
            }

            // 恢复室Steward苏醒评分
            if (_text5 != null)
            {
                _text5.Text = string.Empty;
                this.SetGroupControlValue(_groupCustomControls["恢复室Steward苏醒评分"], _text5);
            }

            // 计算总分
            if (_text4 != null)
            {
                _text4.Text = "0";
                if (!string.IsNullOrEmpty(_text1.Text.Trim()))
                {
                    _text4.Text = (Convert.ToInt32(_text4.Text) + Convert.ToInt32(_text1.Text.Trim())).ToString();
                }
                if (!string.IsNullOrEmpty(_text2.Text.Trim()))
                {
                    _text4.Text = (Convert.ToInt32(_text4.Text) + Convert.ToInt32(_text2.Text.Trim())).ToString();
                }
                if (!string.IsNullOrEmpty(_text3.Text.Trim()))
                {
                    _text4.Text = (Convert.ToInt32(_text4.Text) + Convert.ToInt32(_text3.Text.Trim())).ToString();
                }

                _nnisControl.SimpleValue = Convert.ToInt32(_text4.Text.Trim());
            }
        }
Ejemplo n.º 19
0
        /// <summary>
        /// Text changed
        /// </summary>
        private void TbTextChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            MTextBox textBox = (MTextBox)sender;

            textBox.Tint = tintColor;
        }