Ejemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            string id   = this.textBox2.Text;
            string name = this.textBox1.Text;

            if (name != null && !"".Equals(name))
            {
                if (name == "admin")
                {
                    MessageBox.Show("管理员账号不能被修改!");
                }
                else
                {
                    bean.UserInfo ui = new bean.UserInfo();
                    ui.Id       = id;
                    ui.UserName = name;
                    service.UserService us = new service.UserService();
                    bool istrue            = us.updateUser(ui);
                    if (istrue)
                    {
                        this.Hide();
                        this.DialogResult = DialogResult.OK;
                    }
                }
            }
        }
Ejemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            string userName = this.textBox1.Text;
            string pwd      = this.textBox2.Text;
            string pwd1     = this.textBox3.Text;

            if (userName != null && !"".Equals(userName) && pwd.Equals(pwd1))
            {
                bean.UserInfo ui = new bean.UserInfo();
                ui.UserName = userName;
                ui.Password = pwd;

                service.UserService us = new service.UserService();
                bool istrue            = us.addUser(ui);
                if (istrue)
                {
                    this.Hide();
                    this.DialogResult = DialogResult.OK;
                }
                else
                {
                    MessageBox.Show("用户名已重复,请重新输入!");
                }
            }
            else
            {
                MessageBox.Show("用户名或密码不能为空或两次密码输入不一致!");
            }
        }
Ejemplo n.º 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            string userName = this.textBox1.Text;
            string pwd      = this.textBox2.Text;
            string pwd1     = this.textBox3.Text;

            string lasttime    = DateTime.Now.ToString();
            string loginnumber = "1";
            string depaid      = "1";
            string name        = "1";
            string type        = "1";


            if (name != null && !"".Equals(name) && pwd.Equals(pwd1))
            {
                bean.UserInfo ui = new bean.UserInfo();
                ui.UserName    = userName;
                ui.Password    = pwd;
                ui.Lasttime    = lasttime;
                ui.Loginnumber = loginnumber;
                ui.Depaid      = depaid;
                ui.Name        = name;
                ui.Type        = type;


                service.UserService us = new service.UserService();
                bool istrue            = us.addUser(ui);
                if (istrue)
                {
                    this.Hide();
                    this.DialogResult = DialogResult.OK;
                }
                else
                {
                    MessageBox.Show("用户名已重复,请重新输入!");
                }
            }
            else
            {
                MessageBox.Show("用户名或密码不能为空或两次密码输入不一致!");
            }
        }