Пример #1
0
        DataSet Bind()
        {
            UserInfoData data = new UserInfoData();

            data.Userid    = txtUserid.Text;
            data.Userlevel = txtUserlevel.Text;
            Classes.UserInfoOperation op = new Classes.UserInfoOperation();
            ds = op.GetUserInfo(data);
            return(ds);
        }
Пример #2
0
        //删除
        private void button3_Click(object sender, EventArgs e)
        {
            string sno = txtUserid1.Text;

            Classes.UserInfoOperation op = new Classes.UserInfoOperation();
            if (op.DeleteUser(sno))
            {
                MessageBox.Show("成功");
            }
            else
            {
                MessageBox.Show("失败了");
            }
            dataGridView1.DataSource = Bind().Tables[0];
        }
Пример #3
0
        //修改
        private void button2_Click(object sender, EventArgs e)
        {
            UserInfoData data = new UserInfoData();

            data.Userid    = txtUserid1.Text;
            data.Userpwd   = txtUserpwd1.Text;
            data.Userlevel = txtUserlevel1.Text;
            Classes.UserInfoOperation op = new Classes.UserInfoOperation();
            if (op.UpdateUser(data))
            {
                MessageBox.Show("成功");
            }
            else
            {
                MessageBox.Show("失败了");
            }
            dataGridView1.DataSource = Bind().Tables[0];
        }
Пример #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            UserInfoData data = new UserInfoData();

            data.Userid    = txtUserid.Text;
            data.Userpwd   = txtUserpwd.Text;
            data.Userlevel = txtUserlevel.Text;
            if (txtUserid.Text == "" || txtUserid.Text == null)
            {
                MessageBox.Show("用户名不能为空");
                txtUserid.Focus();
                return;
            }
            Classes.UserInfoOperation op = new Classes.UserInfoOperation();

            if (op.InsertUserInfo(data))
            {
                MessageBox.Show("插入成功");
            }
            else
            {
                MessageBox.Show("失败");
            }
        }