private void LoadData() { try { PhieuThu pt = new PhieuThu(); dgv_DanhSachPhieuThu.DataSource = pt.GetPhieuThu(""); FormatGrid(); LoadMaKhachHang(); LoadMaNhanVien(); } catch (Exception ex) { throw ex; } }
//Tìm kiếm hoá đơn private void txt_ThongTinTimKiem_TextChanged(object sender, EventArgs e) { try { PhieuThu pt = new PhieuThu(); dgv_DanhSachPhieuThu.DataSource = pt.GetPhieuThu(" and (pt.MaPhieuThu like '%" + txt_ThongTinTimKiem.Text + "%' or pt.KhachHang like '%" + txt_ThongTinTimKiem.Text + "%' or pt.NhanVien like '%" + txt_ThongTinTimKiem.Text + "%' or CONVERT(VARCHAR(10),pt.NgayThu,103) like '%" + txt_ThongTinTimKiem.Text + "%' or kh.TenKhachHang like N'%" + txt_ThongTinTimKiem.Text + "%' or nv.TenNhanVien like N'%" + txt_ThongTinTimKiem.Text + "%')"); FormatGrid(); LoadMaKhachHang(); LoadMaNhanVien(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }