private void btnTimKiem_Click(object sender, EventArgs e) { if (txtTimKiem.Text.Trim() != "") { if (cbbTimKiem.SelectedIndex == 0) { int number = 0; if (int.TryParse(txtTimKiem.Text, out number)) { dgvDanhSachHoaDon.DataSource = hoadonController.SearchMaHoaDon(number); } } else { dgvDanhSachHoaDon.DataSource = hoadonController.SearchTenKhachHang(txtTimKiem.Text); } } else { dgvDanhSachHoaDon.DataSource = hoadonController.GetAllHoaDon(); } }
void load() { dgvDanhSachHoaDon.DataSource = hoadonController.GetAllHoaDon(); }