Пример #1
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;
     }
 }
Пример #2
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();
            }
        }