private void btnPXem_Click(object sender, EventArgs e) { dgvPhong.Rows.Clear(); if (cbPKieuThongKe.SelectedIndex == 0) { dtPhong = PBLL.DanhSachPConTrong(); } if (cbPKieuThongKe.SelectedIndex == 1) { dtPhong = PBLL.DanhSachPDaDay(); } if (cbPKieuThongKe.SelectedIndex == 2) { dtPhong = PBLL.DanhSachPKhongCoSVO(); } if (cbPKieuThongKe.SelectedIndex == 3) { dtPhong = PBLL.DanhSachPDangHD(); } if (cbPKieuThongKe.SelectedIndex == 4) { dtPhong = PBLL.DanhSachPDangBT(); } if (cbPKieuThongKe.SelectedIndex == 5) { dtPhong = PBLL.DanhSachPChuaNopTien(); } if (dtPhong.Rows.Count > 0) { dgvPhong.Rows.Clear(); for (int i = 0; i < dtPhong.Rows.Count; i++) { string[] a = { dtPhong.Rows[i][0].ToString(), dtPhong.Rows[i][1].ToString(), dtPhong.Rows[i][2].ToString(), dtPhong.Rows[i][3].ToString(), dtPhong.Rows[i][4].ToString() }; dgvPhong.Rows.Add(a); } } }