Ejemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            string oldpwd  = textBox1.Text;
            string newpwd1 = textBox2.Text;
            string newpwd  = textBox3.Text;

            if (newpwd == newpwd1)
            {
                if (oldpwd == CommonTool.LogUser.pwd)
                {
                    userinfoBLL bLL = new userinfoBLL();
                    if (bLL.ChangePWD(CommonTool.LogUser.pkid, newpwd))
                    {
                        MessageBox.Show("密码修改成功");
                        //修改成功,关闭修改密码窗口,修改密码enable=false,清空loguser,重新登录
                    }
                }
                else
                {
                    MessageBox.Show("旧密码输入错误");
                }
            }
            else
            {
                MessageBox.Show("新密码不一致");
            }
        }
Ejemplo n.º 2
0
        private void button4_Click(object sender, EventArgs e)
        {
            string      user = textBox1.Text.Trim();
            string      pwd  = textBox2.Text;
            userinfoBLL bLL  = new userinfoBLL();

            if (bLL.AddUser(user, pwd))
            {
                MessageBox.Show("注册成功");
            }
            else
            {
                MessageBox.Show("注册失败,用户名已存在");
            }
        }
Ejemplo n.º 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            string      user = textBox1.Text.Trim();
            string      pwd  = textBox2.Text;
            userinfoBLL bLL  = new userinfoBLL();

            if (bLL.UserLogin(user, pwd))
            {
                MessageBox.Show("登录成功!");
            }
            else
            {
                MessageBox.Show("登录失败");
            }
        }
Ejemplo n.º 4
0
        private void button2_Click(object sender, EventArgs e)
        {
            string      user = textBox1.Text.Trim();
            string      pwd  = textBox2.Text;
            userinfoBLL bLL  = new userinfoBLL();

            if (bLL.UserLogin(user, pwd))
            {
                MessageBox.Show("登录成功!");
                CommonTool.LogUser.pkid   = bLL.SelectPKid(user);
                CommonTool.LogUser.userid = user;
                CommonTool.LogUser.pwd    = pwd;
                button3.Enabled           = true;
            }
            else
            {
                MessageBox.Show("登录失败");
            }
        }