private void btnTimKiem_Click(object sender, EventArgs e) { try { ValidateSearch(); gridGV.DataSource = GiangVien.SelectAll(chkMaGV.Checked ? txtMaGV.Text : null, chkTenGV.Checked ? txtTenGV.Text : null, chkGioiTinh.Checked ? cboGioiTinh.Text : null); } catch (ArgumentException ex) { MessageBox.Show(ex.Message, "Cảnh báo", MessageBoxButtons.OK, MessageBoxIcon.Warning); } catch (Exception ex) { MessageBox.Show(ex.Message, "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnHienTatCa_Click(object sender, EventArgs e) { gridGV.AutoGenerateColumns = false; gridGV.DataSource = GiangVien.SelectAll(); }