private void FNhanVien_Load(object sender, EventArgs e) { DAO_NhanVien dao = new DAO_NhanVien(); List <DTO_NhanVien> list = new List <DTO_NhanVien>(); list = dao.List(); foreach (var item in list) { string NgayKetThuc = ""; ListViewItem it = new ListViewItem(item.ID.ToString()); it.SubItems.Add(item.Hoten); it.SubItems.Add(item.Diachi); it.SubItems.Add(item.SDT.ToString()); it.SubItems.Add(item.Ngaybatdaulam.ToString()); if (item.Ngayketthuc.ToString() == "1/1/0001 12:00:00 AM") { it.SubItems.Add(NgayKetThuc); } else { it.SubItems.Add(item.Ngayketthuc.ToString()); } string TenQuyen = dao.TenQuyen(item.PhanQuyenID).ToString(); it.SubItems.Add(TenQuyen); listView1.Items.Add(it); } }