private void btnSuaNhom_Click(object sender, EventArgs e) { if (this.txtNhom.Text.Trim().Length <= 0) { this.errorProvider1.SetError(this.txtNhom, "nhap ten ma nhom"); return; } else { this.errorProvider1.Clear(); } if (this.txtTenNhom.Text.Trim().Length <= 0) { this.errorProvider1.SetError(this.txtTenNhom, "nhap ten nhom"); return; } else { this.errorProvider1.Clear(); } if (this.txtNhomTruong.Text.Trim().Length <= 0) { this.errorProvider1.SetError(this.txtNhomTruong, "nhap ma nhan vien nhom truong"); return; } else { this.errorProvider1.Clear(); } Nhom nh = new Nhom(); nh.MaNhom = txtNhom.Text.Trim(); nh.TenNhom = txtTenNhom.Text.Trim(); nh.NhomTruong = txtNhomTruong.Text.Trim(); NhomControllers.updateNhom(nh); BindingSource source = new BindingSource(); source.DataSource = NhomControllers.getListNhomfromDB(); this.dataGridView1.DataSource = source; }