Ejemplo n.º 1
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            //登录
            if (tbPwd.Text == "" || txtusername.Text == "")
            {
                MessageBoxEx.Show("请输入账号密码!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            string username = txtusername.Text;
            string password = tbPwd.Text;


            Dong.BLL.OperInfo bOper = new Dong.BLL.OperInfo();
            if (bOper.CheckUser(username, password))
            {
                SaveUserProfile(username, password);

                Dong.Model.GlobalsInfo.UserName = txtusername.Text;

                frmMain frm = new frmMain();

                frm.Show();
                this.Visible = false;
            }
            else
            {
                MessageBoxEx.Show("您输入的账号密码不正确!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 2
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            //登录
            if (tbPwd.Text == "" || cbUserid.Text == "")
            {
                MessageBoxEx.Show("请输入登录口令!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            Dong.BLL.OperInfo bOper = new Dong.BLL.OperInfo();
            if (bOper.CheckUser(cbUserid.Text, tbPwd.Text))
            {
                Dong.Model.GlobalsInfo.UserName = cbUserid.Text;
                frmMain frm = new frmMain();

                frm.Show();
                this.Visible = false;
            }
            else
            {
                MessageBoxEx.Show("您输入的口令不正确!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }