Ejemplo n.º 1
0
        private void frmOPSConfirm_Load(object sender, EventArgs e)
        {
            empid   = this.LoginInfo.m_strEmpID;
            empno   = this.LoginInfo.m_strEmpNo;
            empname = this.LoginInfo.m_strEmpName;

            DataTable dt = new DataTable();
            clsDcl_DoctorWorkstation objSvc = new clsDcl_DoctorWorkstation();
            long ret = objSvc.m_lngGetempinfo(out dt, empno);

            if (dt.Rows.Count == 1)
            {
                //emppwd = dt.Rows[0]["psw_chr"].ToString().Trim();
                clsSymmetricAlgorithm obj = new clsSymmetricAlgorithm();
                this.emppwd = obj.m_strDecrypt(dt.Rows[0]["psw_chr"].ToString().Trim(), clsSymmetricAlgorithm.enmSymmetricAlgorithmType.DES);
                pass        = true;
            }

            this.txtGh.Text   = empno;
            this.lblName.Text = "(姓名: " + empname + ")";
        }
Ejemplo n.º 2
0
        private void txtGh_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                string strempno = this.txtGh.Text.Trim();

                if (strempno == "")
                {
                    return;
                }

                DataTable dt = new DataTable();
                clsDcl_DoctorWorkstation objSvc = new clsDcl_DoctorWorkstation();
                long ret = objSvc.m_lngGetempinfo(out dt, strempno);
                if (dt.Rows.Count == 1)
                {
                    empid   = dt.Rows[0]["empid_chr"].ToString();
                    empname = dt.Rows[0]["lastname_vchr"].ToString();
                    //emppwd = dt.Rows[0]["psw_chr"].ToString().Trim();
                    clsSymmetricAlgorithm obj = new clsSymmetricAlgorithm();
                    this.emppwd = obj.m_strDecrypt(dt.Rows[0]["psw_chr"].ToString().Trim(), clsSymmetricAlgorithm.enmSymmetricAlgorithmType.DES);

                    pass = true;
                    this.lblName.Text = "(姓名: " + empname + ")";
                    this.txtPwd.Focus();
                }
                else
                {
                    pass = false;
                    this.lblName.Text = "";
                    this.txtPwd.Text  = "";
                    MessageBox.Show("工号输入错误,请重新输入。", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                    this.txtGh.Focus();
                }
            }
        }