Example #1
0
 /// <summary>
 /// 设置控键的显示内容
 /// </summary>
 /// <param name="p_strInputString"></param>
 protected virtual void m_mthSetControlText(clsDeptDoctorTechnicalPost p_objDoctor)
 {
     if (p_objDoctor == null)
     {
         return;
     }
     if (m_objSelectedControl is ListView)
     {
         for (int i1 = 0; i1 < ((ListView)m_objSelectedControl).Items.Count; i1++)
         {
             if (((ListView)m_objSelectedControl).Items[i1].Tag.ToString().Trim() == p_objDoctor.m_strEmployeeID.ToString().Trim())
             {
                 clsPublicFunction.ShowInformationMessageBox("请勿重复添加!");
                 return;
             }
         }
         ListViewItem lviTemp = new ListViewItem(p_objDoctor.m_strEmployeeName);
         lviTemp.Tag = p_objDoctor.m_strEmployeeID;
         ((ListView)m_objSelectedControl).Items.Add(lviTemp);
     }
     else if (m_objSelectedControl is ctlBorderTextBox)
     {
         ctlBorderTextBox txtFocusTextBox = (ctlBorderTextBox)m_objSelectedControl;
         txtFocusTextBox.Text = p_objDoctor.m_strEmployeeName;
         txtFocusTextBox.Tag  = p_objDoctor.m_strEmployeeID;
     }
     else if (m_objSelectedControl is ctlRichTextBox)
     {
         ctlRichTextBox txtFocusTextBox = (ctlRichTextBox)m_objSelectedControl;
         txtFocusTextBox.Text = p_objDoctor.m_strEmployeeName;
         txtFocusTextBox.Tag  = p_objDoctor.m_strEmployeeID;
     }
 }
Example #2
0
        private Range GetFragment(string searchPattern)
        {
            var tb = TargetControlWrapper;

            //if (tb.SelectionLength > 0)
            //    return new Range(tb);

            string text = tb.Text;

            var regex  = new Regex(searchPattern);
            var result = new Range(tb);

            int startPos = tb.SelectionStart;
            //go forward
            int i = startPos;

            while (i >= 0 && i < text.Length)
            {
                if (!regex.IsMatch(text[i].ToString()))
                {
                    break;
                }
                i++;
            }
            result.End = i;

            int            intTemp        = 0;
            ctlRichTextBox objRichTextBox = (ctlRichTextBox)tb.TargetControl;
            string         strCaption     = string.Empty;// objRichTextBox.FirstlineCaption;

            if (strCaption != null)
            {
                intTemp = strCaption.Length;
            }

            List <EntityDstInfo> lstDSTInfo = null;// objRichTextBox.m_lstDoubleStrikeThrough.FindAll(t => t.m_intEndIndex < startPos);

            if (lstDSTInfo != null && lstDSTInfo.Count > 0)
            {
                intTemp = Math.Max(intTemp, lstDSTInfo.Max((obj) => { return(obj.EndIndex + 1); }));
            }

            //go backward
            i = startPos;
            while (i > intTemp && (i - 1) < text.Length)
            {
                if (!regex.IsMatch(text[i - 1].ToString()))
                {
                    break;
                }
                i--;
            }
            result.Start = i;

            return(result);
        }
Example #3
0
        /// <summary>
        /// 从界面取值
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void m_mthGetControlValues()
        {
            ArrayList arlItems = new ArrayList();

            foreach (Control obj in this.m_pnlControl.Controls)
            {
                clsTemplateControlValue objValue = new clsTemplateControlValue();
                objValue.m_strGUI_ID = m_objTextTemplate.m_strGUI_ID;
                switch (obj.GetType().Name)
                {
                case "ctlCheckBox":
                    ctlCheckBox chk = obj as ctlCheckBox;
                    objValue.m_strCONTROL_ID    = chk.Name;
                    objValue.m_strCONTROL_DESC  = chk.称;
                    objValue.m_strCONTROL_VALUE = (chk.Checked == true?"true":"false");
                    break;

                case "ctlDateTimePicker":
                    ctlDateTimePicker dtp = obj as ctlDateTimePicker;
                    objValue.m_strCONTROL_ID    = dtp.Name;
                    objValue.m_strCONTROL_DESC  = dtp.称;
                    objValue.m_strCONTROL_VALUE = dtp.Value.ToString("yyyy-MM-dd HH:mm:ss");
                    break;

                case "ctlComboBox":
                    ctlComboBox cbo = obj as ctlComboBox;
                    objValue.m_strCONTROL_ID    = cbo.Name;
                    objValue.m_strCONTROL_DESC  = cbo.称;
                    objValue.m_strCONTROL_VALUE = cbo.Text.Trim();;
                    break;

                case "ctlRichTextBox":
                    ctlRichTextBox txt = obj as ctlRichTextBox;
                    objValue.m_strCONTROL_ID    = txt.Name;
                    objValue.m_strCONTROL_DESC  = txt.称;
                    objValue.m_strCONTROL_VALUE = txt.Text.Trim();;
                    break;

                default:
                    objValue = null;
                    break;
                }
                if (objValue != null)
                {
                    arlItems.Add(objValue);
                }
            }
            if (arlItems.Count > 0)
            {
                m_objTextTemplate.m_objTmpCtlValueArr = (clsTemplateControlValue[])arlItems.ToArray(typeof(clsTemplateControlValue));
            }
        }
Example #4
0
        /// <summary>
        /// 设置RichTextBox属性。(右键菜单、用户姓名、用户ID、颜色等)。
        /// </summary>
        /// <param name="p_objRichTextBox"></param>
        protected void m_mthSetRichTextBoxAttrib(ctlRichTextBox p_objRichTextBox)
        {
            m_objBorderTool.m_mthChangedControlsArrayBorder(new Control[] { p_objRichTextBox });
            //设置右键菜单
//			p_objRichTextBox.ContextMenu=m_cmuRichTextBoxMenu;
//			p_objRichTextBox.GotFocus += new EventHandler(m_txtRichTextBox_GotFocus);
//
//			//设置其他属性
//			p_objRichTextBox.m_StrUserID = MDIParent.OperatorID;
//			p_objRichTextBox.m_StrUserName = MDIParent.strOperatorName;
//			p_objRichTextBox.m_ClrOldPartInsertText = Color.White;
//			p_objRichTextBox.m_ClrDST = Color.Red;
        }
Example #5
0
        private void m_mthCreateControls(int intIndex, out clsControlGroup ctlGroup)
        {
            System.Windows.Forms.TextBox txtTitle = new System.Windows.Forms.TextBox();
            ctlRichTextBox txtContent             = new ctlRichTextBox();

            // txtTitle
            txtTitle.BackColor   = System.Drawing.SystemColors.Info;
            txtTitle.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
//			txtTitle.Dock = System.Windows.Forms.DockStyle.Top;
//			txtTitle.Location = new System.Drawing.Point(0, 0);
            txtTitle.Size     = new System.Drawing.Size(296, 23);
            txtTitle.Name     = "textBox_" + intIndex.ToString();
            txtTitle.TabIndex = 30 + 5 * intIndex;
            txtTitle.Text     = "";
            //txtContent
            txtContent.BackColor   = System.Drawing.Color.FromArgb(((System.Byte)(225)), ((System.Byte)(225)), ((System.Byte)(192)));
            txtContent.BorderStyle = System.Windows.Forms.BorderStyle.None;
//			txtContent.Dock = System.Windows.Forms.DockStyle.Top;
            txtContent.ForeColor = System.Drawing.SystemColors.WindowText;
//			txtContent.Location = new System.Drawing.Point(0, 30);
            txtContent.m_BlnPartControl           = false;
            txtContent.m_BlnUnderLineDST          = false;
            txtContent.m_ClrDST                   = System.Drawing.Color.Red;
            txtContent.m_ClrOldPartInsertText     = System.Drawing.Color.Black;
            txtContent.m_IntCanModifyTime         = 6;
            txtContent.m_IntPartControlLength     = 0;
            txtContent.m_IntPartControlStartIndex = 0;
            txtContent.m_BlnCanModifyLast         = true;
            txtContent.m_StrUserID                = "";
            txtContent.m_StrUserName              = "";
            txtContent.Name = "txtContent_" + intIndex.ToString();
//			txtContent.Size = new System.Drawing.Size(296, 125);
            txtContent.TabIndex = 30 + 5 * intIndex + 1;
            txtContent.Text     = "";

            //
            txtContent.MouseDown += new System.Windows.Forms.MouseEventHandler(m_txtTemplate_MouseDown);
            txtTitle.MouseDown   += new System.Windows.Forms.MouseEventHandler(m_txtTemplate_MouseDown);

            //
            clsControlGroup objGroup = new clsControlGroup();

            objGroup.m_txtTitle   = txtTitle;
            objGroup.m_txtContent = txtContent;

            ctlGroup = objGroup;
        }
Example #6
0
 /// <summary>
 /// 设置控键的显示内容
 /// </summary>
 /// <param name="p_strInputString"></param>
 protected virtual void m_mthSetControlText(string p_strInputString)
 {
     if (p_strInputString == null || p_strInputString == "")
     {
         return;
     }
     if (m_objSelectedControl.GetType().Name == "ctlRichTextBox")
     {
         ctlRichTextBox txtFocusTextBox = (ctlRichTextBox)m_objSelectedControl;
         txtFocusTextBox.m_mthInsertText(p_strInputString, txtFocusTextBox.Text.Length);
     }
     else if (m_objSelectedControl.GetType().Name == "TextBox")
     {
         TextBox txtFocusTextBox = (TextBox)m_objSelectedControl;
         txtFocusTextBox.Text = p_strInputString;
     }
 }
Example #7
0
        public clsRichTextListView(ctlRichTextBox dtxtText, ListView lsvShow, EventHandler evhBeforeListViewShow)
        {
            m_dtxtText = dtxtText;

            m_lsvShow = lsvShow;

            m_evhBeforeListViewShow = evhBeforeListViewShow;

            m_dtxtText              = (ctlRichTextBox)dtxtText;
            m_dtxtText.KeyDown     += new KeyEventHandler(ShowListView);
            m_dtxtText.TextChanged += new EventHandler(BeforeListViewShow);

            m_dtxtText.LostFocus += new EventHandler(HideListView);
            m_dtxtText.GotFocus  += new EventHandler(TxtGotFocus);
            m_lsvShow.LostFocus  += new EventHandler(HideListView);

            m_intCheck = 0;
        }
Example #8
0
        /// <summary>
        /// 选中双击事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void m_lsvItemList_DoubleClick(object sender, System.EventArgs e)
        {
            if (m_lsvItemList.Items.Count > 0 && m_lsvItemList.SelectedItems.Count > 0)
            {
//				if(m_BlnNeedVerify)
//				{
//					//					if(!m_blnCheckEmployeeSign(m_lsvItemList.SelectedItems[0].SubItems[0].Text,m_lsvItemList.SelectedItems[0].SubItems[1].Text))
//					//						return;
//				}

                #region 添加验证功能 modify by tfzhang at 2005-12-6 13:11
                if (m_BlnNeedVerify)
                {
                    string strReturnSetting = com.digitalwave.Emr.StaticObject.clsEMR_StaticObject.s_intGetEmrSettingValue("3002").ToString();
                    if (strReturnSetting != null)
                    {
                        //无需验证
                        if (strReturnSetting == "0")
                        {
                            //continue;
                        }
                        //密码验证
                        else if (strReturnSetting == "1")
                        {
                            if (!m_blnCheckEmployeeSign(m_lsvItemList.SelectedItems[0].SubItems[0].Text, m_lsvItemList.SelectedItems[0].SubItems[1].Text))
                            {
                                return;
                            }
                        }
                        //key盘验证
                        else if (strReturnSetting == "2")
                        {
                            if (!m_blnCheckEmployeeSignByKey(m_lsvItemList.SelectedItems[0].SubItems[0].Text, m_lsvItemList.SelectedItems[0].SubItems[1].Text))
                            {
                                return;
                            }
                        }
                    }
                }
                #endregion

                switch (m_objSelectedControl.GetType().FullName)
                {
                case "com.digitalwave.Utility.Controls.ctlRichTextBox":
                    ctlRichTextBox txtFocusTextBox = (ctlRichTextBox)m_objSelectedControl;
                    //						txtFocusTextBox.m_mthInsertText(m_lsvItemList.SelectedItems[0].SubItems[1].Text,txtFocusTextBox.Text.Length);
                    if (m_intType == (int)enmCommonUseValue.Anaesthesia_Plane || txtFocusTextBox.Name == "m_txtAttendPeople")
                    {
                        try
                        {
                            if (txtFocusTextBox.Name == "m_txtAttendPeople")
                            {
                                string strPanle = m_lsvItemList.SelectedItems[0].SubItems[1].Text;
                                if (txtFocusTextBox.Text.Trim() != "")
                                {
                                    strPanle = " " + strPanle;
                                }
                                txtFocusTextBox.m_mthInsertText(strPanle, txtFocusTextBox.Text.Length);
                            }
                            else
                            {
                                string strPanle = m_lsvItemList.SelectedItems[0].SubItems[1].Text;
                                if (txtFocusTextBox.Text.Trim() != "")
                                {
                                    strPanle = "~" + strPanle;
                                }
                                txtFocusTextBox.m_mthInsertText(strPanle, txtFocusTextBox.Text.Length);
                            }
                        }
                        catch (Exception)
                        {}
                    }
                    else
                    {
                        txtFocusTextBox.m_mthClearText();
                        txtFocusTextBox.m_mthInsertText(m_lsvItemList.SelectedItems[0].SubItems[1].Text, 0);
                    }
                    break;

                case "com.digitalwave.controls.ctlRichTextBox":
                    com.digitalwave.controls.ctlRichTextBox txtFocusTextBox1 = (com.digitalwave.controls.ctlRichTextBox)m_objSelectedControl;

                    if (m_intType == (int)enmCommonUseValue.Anaesthesia_Plane || txtFocusTextBox1.Name == "m_txtAttendPeople")
                    {
                        try
                        {
                            if (txtFocusTextBox1.Name == "m_txtAttendPeople")
                            {
                                string strPanle = m_lsvItemList.SelectedItems[0].SubItems[1].Text;
                                if (txtFocusTextBox1.Text.Trim() != "")
                                {
                                    strPanle = " " + strPanle;
                                }
                                txtFocusTextBox1.m_mthInsertText(strPanle, txtFocusTextBox1.Text.Length);
                            }
                            else
                            {
                                string strPanle = m_lsvItemList.SelectedItems[0].SubItems[1].Text;
                                if (txtFocusTextBox1.Text.Trim() != "")
                                {
                                    strPanle = "~" + strPanle;
                                }
                                txtFocusTextBox1.m_mthInsertText(strPanle, txtFocusTextBox1.Text.Length);
                            }
                        }
                        catch (Exception)
                        {}
                    }
                    else
                    {
                        txtFocusTextBox1.m_mthClearText();
                        txtFocusTextBox1.m_mthInsertText(m_lsvItemList.SelectedItems[0].SubItems[1].Text, 0);
                    }
                    break;

                case "System.Windows.Forms.TextBox":
                    TextBox txt = (TextBox)m_objSelectedControl;
                    txt.Text = m_lsvItemList.SelectedItems[0].SubItems[1].Text;
                    break;

                case "com.digitalwave.Utility.Controls.ctlBorderTextBox":
                    ctlBorderTextBox txt2 = (ctlBorderTextBox)m_objSelectedControl;
                    txt2.Text = m_lsvItemList.SelectedItems[0].SubItems[1].Text;
                    break;

                case "System.Windows.Forms.ListView":
                    ListView lsv = (ListView)m_objSelectedControl;
                    for (int i = 0; i < lsv.Items.Count; i++)
                    {
                        if (m_lsvItemList.SelectedItems[0].SubItems[1].Text == lsv.Items[i].SubItems[0].Text)                             //将对比名称重复改为对比名字而不是ID,因为手术记录单的护士可能没有ID
                        {
                            clsPublicFunction.ShowInformationMessageBox("对不起,员工不能重复,请重新选择!");
                            return;
                        }
                    }
                    ListViewItem lviNewItem = lsv.Items.Add(m_lsvItemList.SelectedItems[0].SubItems[1].Text);
                    lviNewItem.SubItems.Add(m_lsvItemList.SelectedItems[0].SubItems[0].Text);
                    break;
                }
                if (m_intType < 0 && m_objSelectedControl.GetType().Name != "ListView")
                {
                    string strFormName = m_objParentForm.Name;
                    if (strFormName != "frmInHospitalMainRecord" && strFormName != "frmConsultation" &&
                        strFormName != "frmCaseDiscuss" && strFormName != "frmDeadCaseDiscuss" &&
                        strFormName != "frmSaveRecord" && strFormName != "frmOutHospital" &&
                        strFormName != "frmBeforeOperationDiscuss" && strFormName != "frmCheckRoom" &&
                        strFormName != "frmConvey" && strFormName != "frmDeathRecord")
                    {
                        m_objSelectedControl.Tag = new clsEmployee(m_lsvItemList.SelectedItems[0].SubItems[0].Text);
                    }
                    else
                    {
                        m_objSelectedControl.Tag = m_lsvItemList.SelectedItems[0].SubItems[0].Text;
                    }
                }

                this.Close();
            }
        }
Example #9
0
 /// <summary>
 /// RichTextBox 获得焦点时的事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void m_txtRichTextBox_GotFocus(object sender, System.EventArgs e)
 {
     m_txtFocusedRichTextBox = ((ctlRichTextBox)(sender));
 }
Example #10
0
 protected void m_mthAddRichTextInfo(ctlRichTextBox p_ctlTextBox)
 {
     p_ctlTextBox.m_evtMouseEnterDeleteText += new EventHandler(m_mthHandleMouseEnterDeleteText);
     p_ctlTextBox.m_evtMouseEnterInsertText += new EventHandler(m_mthHandleMouseEnterInsertText);
     p_ctlTextBox.MouseLeave += new EventHandler(m_mthHandleMouseLeaveControl);
 }