private void frmQuanLyKhachHang_Load(object sender, EventArgs e) { try { SetGridViewStyle(dgvQuanLyKhachHang); BindGrid(KhachHang.GetAll()); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btnTimKiem_Click(object sender, EventArgs e) { List <KhachHang> listKQTK = KhachHang.GetAll(); var listKhacHang = listKQTK.Where(p => (p is KhachHang) && (p as KhachHang).TenKH.ToLower().Contains(txtTimKiem.Text.ToLower())).ToList(); if (listKhacHang.Count > 0) { BindGrid(listKhacHang); } else { MessageBox.Show("Không tìm thấy khách hàng nào!"); } }
private void btnHuyCapNhatLoaiPhong_Click(object sender, EventArgs e) { BindGrid(KhachHang.GetAll()); }