Esempio n. 1
0
        private void btnCapNhat_Click(object sender, EventArgs e)
        {
            HocSinh hs = new HocSinh()
            {
                TenHS = this.txtTenHocSinh.Text, DiaChi = this.txtDiaChi.Text, MaHS = this.txtMaHocSinh.Text
            };

            if (hocSinhBUS.Update(hs))
            {
                MessageBox.Show("Cập nhật thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                ClearAllTextbox();
                this.dgvHocSinh.DataSource = hocSinhBUS.LoadData().Tables[0].DefaultView;
            }
            else
            {
                MessageBox.Show("Cập nhật thất bại!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }