Exemple #1
0
        /// <summary>
        /// 登录名失去焦点时,进行登录名验证判断,只传入一个参数,判断非空、存在
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void TxtUName_Leave(object sender, EventArgs e)
        {
            string msg;

            lbUName.Visible = !VerifierFactory.GetVerifier(VerifierKinds.LoginVerify).Verify(out msg, txtUName.Text.Trim());
            lbUName.Text    = "*" + msg;
        }
Exemple #2
0
        /// <summary>
        /// 登录按钮按下时,进行登录验证,传入两个参数,若登录成功则关闭连接和cmd对象
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtnLogin_Click(object sender, EventArgs e)
        {
            string msg;
            bool   b = VerifierFactory.GetVerifier(VerifierKinds.LoginVerify).Verify(out msg, txtUName.Text.Trim(), txtUPwd.Text);

            MessageBox.Show(msg);

            if (b)
            {
                SqlUtils.CloseAll();
            }
        }