private void txtEmpNo_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { string empno = this.txtEmpNo.Text.Trim(); if (empno == "") { return; } DataTable dt; clsDcl_PrePay objPre = new clsDcl_PrePay(); long l = objPre.m_lngGetempinfo(out dt, empno); if (l > 0 && dt.Rows.Count == 1) { Empid = dt.Rows[0]["empid_chr"].ToString(); Empname = dt.Rows[0]["lastname_vchr"].ToString(); this.lblName.Text = Empname; string userpwd = dt.Rows[0]["psw_chr"].ToString().Trim(); clsSymmetricAlgorithm objAlgorithm = new clsSymmetricAlgorithm(); this.txtPwd.Tag = objAlgorithm.m_strDecrypt(userpwd, clsSymmetricAlgorithm.enmSymmetricAlgorithmType.DES); objAlgorithm = null; this.txtPwd.Focus(); } else { MessageBox.Show("工号输入错误,请重新输入。", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); this.txtEmpNo.Select(); } } }
private void frmAuditing_Load(object sender, EventArgs e) { //if (this.intDefault == 2) if (this.txtEmpNo.Text.Trim() != "") { string empno = this.txtEmpNo.Text.Trim(); if (empno == "") { return; } DataTable dt; clsDcl_PrePay objPre = new clsDcl_PrePay(); long l = objPre.m_lngGetempinfo(out dt, empno); if (l > 0 && dt.Rows.Count == 1) { Empid = dt.Rows[0]["empid_chr"].ToString(); Empname = dt.Rows[0]["lastname_vchr"].ToString(); this.lblName.Text = Empname; string userpwd = dt.Rows[0]["psw_chr"].ToString().Trim(); clsSymmetricAlgorithm objAlgorithm = new clsSymmetricAlgorithm(); this.txtPwd.Tag = objAlgorithm.m_strDecrypt(userpwd, clsSymmetricAlgorithm.enmSymmetricAlgorithmType.DES); objAlgorithm = null; this.txtPwd.Focus(); } else { MessageBox.Show("工号输入错误,请重新输入。", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); this.DialogResult = DialogResult.No; this.Close(); } if (this.intDefault == 2) { this.txtEmpNo.Enabled = false; } } this.txtPwd.Focus(); this.txtPwd.Select(); //this.txtPwd.Focus(); }