Пример #1
0
        /// <summary>
        /// 添加签名成员
        /// </summary>
        /// <param name="p_dcSignature"></param>
        public void AddSignEmp(EntitySignature p_dcSignature)
        {
            this.m_lstSignature.Add(p_dcSignature);
            this.ResetCaption();

            this.OnAfterValueChanged();
        }
Пример #2
0
        /// <summary>
        /// 签名
        /// </summary>
        /// <param name="Register">病人住院登记流水ID</param>
        /// <returns></returns>
        public bool Sign(string regNo)
        {
            bool blnPass = false;

            if (string.IsNullOrEmpty(regNo))
            {
                DialogBox.Msg("签名之前请选择病人。", MessageBoxIcon.Information, uiHelper.frmCurr);
                return(blnPass);
            }

            frmSignature frm = new frmSignature();

            frm.StartPosition = FormStartPosition.Manual;

            Point pt1        = new Point(this.lblDoctName.Location.X, this.lblDoctName.Location.Y);
            Point pt2        = this.lblDoctName.PointToScreen(pt1);
            int   intScreenW = Screen.PrimaryScreen.Bounds.Width;
            int   intScreeH  = Screen.PrimaryScreen.Bounds.Height;

            int intX = pt2.X;

            if (pt2.X + frm.Width > intScreenW)
            {
                intX = pt2.X - (pt2.X + frm.Width - intScreenW) - 30;
            }
            else if (intX < 0)
            {
                intX = 30;
            }
            int intY = pt2.Y - 10;

            if (intY < 0)
            {
                intY = 30;
            }
            else
            {
                if (pt2.Y + frm.Height > intScreeH)
                {
                    intY = intScreeH / 2 - 50;
                }
            }
            frm.Location = new Point(intX, intY);
            if (frm.ShowDialog(this.ParentForm) == DialogResult.OK)
            {
                //int intEmpID = int.Parse(frm.drDoct["empid_int"].ToString());
                string strEmpNo    = frm.EmpVO.operCode;
                string strEmpName  = frm.EmpVO.operName;
                string strTechCode = frm.EmpVO.TechnicalLevelNo;
                string strTechName = frm.EmpVO.TechnicalLevelName;
                string strPassWord = frm.EmpVO.pwd;
                //string strTeacherID = frm.drDoct["teacherid_int"].ToString();

                // 暂时屏蔽

                /*
                 * foreach (clsDCSignature obj in this.m_lstSignature)
                 * {
                 *  if (int.Parse(strTechCode) > int.Parse(obj.strTechLevelCode))
                 *  {
                 *      clsDialog.Msg("低职称不能给高职称医师签名。", MessageBoxIcon.Stop);
                 *      return blnPass;
                 *  }
                 * } */

                // 参数67 病历签名时,是否必须由导师权限审签病历。
                // 0 可以实习生本人签名保存;1 必须由导师签名保存。
                //if (GlobalParm.dicSysParameter[67] == "1")
                //{
                //    if (strTeacherID != string.Empty && strTeacherID != intEmpID.ToString())
                //    {
                //        DialogBox.Msg("系统当前设定:\r\n\r\n实习进修人员必须由导师权限审签病历。", MessageBoxIcon.Information, uiHelper.frmCurr);
                //        return false;
                //    }
                //}

                // 进修、实习医师(护士)采用密码签名
                bool blnTraineeFlag = false;
                //if (clsGlobalEmpRoleInfo.dicEmpRole.ContainsKey(intEmpID))
                //{
                //    string strP29 = clsGlobalSysParameter.dicSysParameter[29];
                //    int intP29 = 0;
                //    int.TryParse(strP29, out intP29);
                //    if (clsGlobalEmpRoleInfo.dicEmpRole[intEmpID].IndexOf(intP29) > 0)
                //    {
                //        blnTraineeFlag = true;

                //        if (clsGlobalHospitalCode.Code == "0001")
                //        {
                //            strEmpName += "(实习)";
                //        }
                //    }
                //}

                EntitySignature dcSign = null;
                //签名方式 0 密码; 1 KEY; 2 指纹
                string strSignType = "0";    // GlobalParm.dicSysParameter[3];
                if (strSignType == "0" || blnTraineeFlag)
                {
                    dcSign               = new EntitySignature();
                    dcSign.empId         = strEmpNo;
                    dcSign.empName       = strEmpName;
                    dcSign.signDate      = DateTime.Now;
                    dcSign.recordDate    = DateTime.Now;
                    dcSign.techLevelCode = strTechCode;
                    dcSign.techLevelName = strTechName;
                    dcSign.registerId    = regNo;
                    dcSign.caseCode      = GlobalCase.caseInfo.CaseCode;
                    dcSign.objectID      = this.ItemName;
                    this.AddSignEmp(dcSign);
                    blnPass = true;

                    this.ValueChangedFlag = true;
                    this.m_lstNoSaveSignature.Add(dcSign);

                    //frmDoctSignByPwd frmPwd = new frmDoctSignByPwd(strEmpNo, strEmpName, strTechName, strPassWord);
                    //frmPwd.StartPosition = FormStartPosition.Manual;
                    //intY = intY + (frm.Height - frmPwd.Height) / 2;
                    //frmPwd.Location = new Point(frm.Location.X, intY);
                    //if (frmPwd.ShowDialog(this.ParentForm) == DialogResult.OK)
                    //{
                    //    dcSign = new clsDCSignature();
                    //    dcSign.intEmpID = int.Parse(frm.drDoct["empid_int"].ToString());
                    //    dcSign.strEmpName = strEmpName;
                    //    dcSign.dtmSignDate = clsMidderTime.s_dtmMidderTime();
                    //    dcSign.dtmRecordDate = dcSign.dtmSignDate.Value;
                    //    dcSign.strTechLevelCode = strTechCode;
                    //    dcSign.strTechLevelName = strTechName;
                    //    dcSign.intRegisterID = regNo;
                    //    dcSign.strCaseCode = clsGlobalCase.objCaseInfo.strCaseCode;
                    //    dcSign.strObjectID = this.DBColName;
                    //    this.AddSignEmp(dcSign);
                    //    blnPass = true;

                    //    this.ValueChangedFlag = true;

                    //    this.m_lstNoSaveSignature.Add(dcSign);
                    //}
                }
                //else if (strSignType == "1")
                //{
                //    string strDBKeyID = frm.drDoct["signdigital_vchr"].ToString();
                //    if (clsCA.s_blnSignVerify(strDBKeyID))
                //    {
                //        dcSign = new clsDCSignature();
                //        dcSign.intEmpID = int.Parse(frm.drDoct["empid_int"].ToString());
                //        dcSign.strEmpName = strEmpName;
                //        dcSign.dtmSignDate = clsMidderTime.s_dtmMidderTime();
                //        dcSign.dtmRecordDate = dcSign.dtmSignDate.Value;
                //        dcSign.strTechLevelCode = strTechCode;
                //        dcSign.strTechLevelName = strTechName;
                //        dcSign.intRegisterID = regNo;
                //        dcSign.strCaseCode = clsGlobalCase.objCaseInfo.strCaseCode;
                //        dcSign.strObjectID = this.DBColName;
                //        dcSign.strSignKeyID = strDBKeyID;
                //        this.m_mthAddSignEmp(dcSign);
                //        blnPass = true;

                //        this.ValueChangedFlag = true;

                //        this.m_lstNoSaveSignature.Add(dcSign);

                //    }
                //    else
                //    {
                //        return false;
                //    }
                //}
                else
                {
                    DialogBox.Msg("签名失败。\r\n\r\n系统目前只支持:密码、电子KEY 两种签名模式。", MessageBoxIcon.Information, uiHelper.frmCurr);
                    return(false);
                }

                //if (dcSign != null && this.m_lstNoSaveSignature.Count == 1 && clsGlobalCase.objCaseInfo != null &&
                //    !string.IsNullOrEmpty(clsGlobalCase.objCaseInfo.strCaseName) && clsGlobalCase.objCaseInfo.strCaseName.Contains("术前准备"))
                //{
                //    Form frmParent = this.ParentForm;
                //    if (frmParent != null && frmParent.GetType().Name == "DefaultFormTemplate")
                //    {
                //        try
                //        {
                //            List<IDBColProperty> lstDBCol = ((frmBaseMdiCase)frmParent).lstDBCol;
                //            if (lstDBCol != null && lstDBCol.Count > 0)
                //            {
                //                string strPrefix = string.Empty;
                //                if (dcSign.strObjectID.ToLower().StartsWith("executor"))
                //                    strPrefix = dcSign.strObjectID.Substring(0, 8);
                //                else if (dcSign.strObjectID.ToLower().StartsWith("inspector"))
                //                    strPrefix = dcSign.strObjectID.Substring(0, 9);
                //                else
                //                    return blnPass;
                //                int intIndex = 0;
                //                int.TryParse(dcSign.strObjectID.Replace(strPrefix, ""), out intIndex);
                //                if (intIndex <= 3)
                //                    return blnPass;

                //                List<ctlSignature> lstTmpSign = new List<ctlSignature>();
                //                for (int i = intIndex - 1; i >= 1; i--)
                //                {
                //                    if (lstDBCol.Exists(t => t.DBColName == strPrefix + i.ToString()))
                //                    {
                //                        IDBColProperty data = lstDBCol.Single(t => t.DBColName == strPrefix + i.ToString());
                //                        if (data is ctlSignature)
                //                        {
                //                            ctlSignature sign = data as ctlSignature;
                //                            lstTmpSign.Add(sign);
                //                            if (i + 1 < intIndex && sign.m_lstNoSaveSignature.Count == 1 && sign.m_lstNoSaveSignature[0].intEmpID == dcSign.intEmpID)
                //                            {
                //                                if (DialogBox.Msg("是否对第 " + Convert.ToString(i + 1) + " 至 " + Convert.ToString(intIndex - 1) + " 条信息进行批量签名?", MessageBoxIcon.Question, uiHelper.frmCurr) == DialogResult.Yes)
                //                                {
                //                                    foreach (ctlSignature item in lstTmpSign)
                //                                    {
                //                                        if (item.m_lstNoSaveSignature.Count == 0)
                //                                        {
                //                                            clsDCSignature dcS = new clsDCSignature();
                //                                            dcS.intEmpID = dcSign.intEmpID;
                //                                            dcS.strEmpName = dcSign.strEmpName;
                //                                            dcS.dtmSignDate = dcSign.dtmSignDate;
                //                                            dcS.dtmRecordDate = dcSign.dtmRecordDate;
                //                                            dcS.strTechLevelCode = dcSign.strTechLevelCode;
                //                                            dcS.strTechLevelName = dcSign.strTechLevelName;
                //                                            dcS.intRegisterID = dcSign.intRegisterID;
                //                                            dcS.strCaseCode = dcSign.strCaseCode;
                //                                            dcS.strObjectID = item.DBColName;
                //                                            dcS.strSignKeyID = dcSign.strSignKeyID;
                //                                            item.AddSignEmp(dcS);
                //                                            item.m_lstNoSaveSignature.Add(dcS);
                //                                            item.ValueChangedFlag = true;
                //                                            dcS = null;
                //                                        }
                //                                    }
                //                                    return blnPass;
                //                                }
                //                            }
                //                        }
                //                    }
                //                }
                //            }
                //        }
                //        catch { }
                //    }
                //}
            }
            return(blnPass);
        }
Пример #3
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            int    intMinRowNo = 0;
            string strMinRowNo = this.txtFromRowNo.Text.Trim();

            if (strMinRowNo == string.Empty)
            {
                DialogBox.Msg("请输入起始行号.");
                txtFromRowNo.Focus();
                return;
            }
            try
            {
                intMinRowNo = int.Parse(strMinRowNo);
                if (intMinRowNo < 0)
                {
                    DialogBox.Msg("起始行号不能小于0,请重新输入.");
                    txtFromRowNo.Focus();
                    return;
                }
            }
            catch
            {
                DialogBox.Msg("起始行号输入不正确,请重新输入.");
                txtFromRowNo.Focus();
                return;
            }
            int    intMaxRowNo = 0;
            string strMaxRowNo = this.txtToRowNo.Text.Trim();

            if (strMaxRowNo == string.Empty)
            {
                DialogBox.Msg("请输入结束行号.");
                txtToRowNo.Focus();
                return;
            }
            try
            {
                intMaxRowNo = int.Parse(strMaxRowNo);
                if (intMaxRowNo < intMinRowNo)
                {
                    DialogBox.Msg("结束行号不能小于开始行号,请重新输入.");
                    txtToRowNo.Focus();
                    return;
                }
                if (intMaxRowNo > MaxRowNo)
                {
                    DialogBox.Msg("结束行号不能允许的最大行号 " + MaxRowNo.ToString() + ",请重新输入.");
                    txtToRowNo.Focus();
                    return;
                }
            }
            catch
            {
                DialogBox.Msg("结束行号输入不正确,请重新输入.");
                txtToRowNo.Focus();
                return;
            }

            if (ctlSignature.m_lstNoSaveSignature != null && ctlSignature.m_lstNoSaveSignature.Count > 0)
            {
                FromRowNo         = intMinRowNo;
                ToRowNo           = intMaxRowNo;
                SignColNameOut    = cboSignColName.Text;
                SignEmpInfo       = ctlSignature.m_lstNoSaveSignature;
                this.DialogResult = DialogResult.OK;
            }
            else
            {
                if (ctlSignature.IsAutoSignature == 1)
                {
                    EntitySignature dcSign = new EntitySignature();
                    dcSign.empId         = GlobalLogin.objLogin.EmpNo;
                    dcSign.empName       = GlobalLogin.objLogin.EmpName;
                    dcSign.signDate      = DateTime.Now;
                    dcSign.recordDate    = DateTime.Now;
                    dcSign.techLevelCode = GlobalLogin.objLogin.TechLevelCode;
                    dcSign.techLevelName = GlobalLogin.objLogin.TechLevelName;
                    dcSign.registerId    = GlobalPatient.currPatient.RegisterID;
                    dcSign.caseCode      = GlobalCase.caseInfo.CaseCode;
                    dcSign.objectID      = ctlSignature.ItemName;
                    ctlSignature.AddSignEmp(dcSign);
                }
                else
                {
                    DialogBox.Msg("请签名.");
                }
            }
        }