private void btn_search_Click(object sender, EventArgs e) { lv_search.Items.Clear(); txt_search = text_search.Text; switch (Form_Search) { case "NhanVien_Form": break; case "HanhKhach_Form": IEnumerable <HanhKhach> list1 = _hkRepo.getWhere(txt_search); foreach (HanhKhach hk in list1) { ListViewItem newList = new ListViewItem(new[] { hk.KhachId.ToString(), hk.MaKhach, hk.Ten }); lv_search.Items.Add(newList); } break; case "ChiTieu_Form": IEnumerable <ChiTieu> list2 = _ctRepo.getWhere(txt_search); foreach (ChiTieu ct in list2) { ListViewItem newList = new ListViewItem(new[] { ct.CTId.ToString(), ct.Ten }); lv_radio.Items.Add(newList); } break; } }
private void tabCT_Search() { var searchStr = tabCT_SearchBox.Text; ChiTieuGridView.Rows.Clear(); var data = _chitieuRepo.getWhere(searchStr); foreach (ChiTieu item in data) { ChiTieuGridView.Rows.Add(item.CTId, item.Ten); } }
private void Search() { lv_search.Items.Clear(); lv_radio.Items.Clear(); txt_search = text_search.Text; switch (Form_Search) { case "NhanVien_Form": IEnumerable <NhanVien> list3 = _nvRepo.getWhere("", "", txt_search, "", 0); foreach (NhanVien nv in list3) { ListViewItem newList = new ListViewItem(new[] { nv.NVId.ToString(), nv.MaNV, nv.Ten }); lv_radio.Items.Add(newList); } break; case "HanhKhach_Form": IEnumerable <HanhKhach> list1 = _hkRepo.getWhere("", "", txt_search, "", "", "", "", "", "", 0); foreach (HanhKhach hk in list1) { ListViewItem newList = new ListViewItem(new[] { hk.KhachId.ToString(), hk.MaKhach, hk.Ten }); lv_search.Items.Add(newList); } break; case "ChiTieu_Form": IEnumerable <ChiTieu> list2 = _ctRepo.getWhere("", txt_search); foreach (ChiTieu ct in list2) { ListViewItem newList = new ListViewItem(new[] { ct.CTId.ToString(), ct.Ten }); lv_radio.Items.Add(newList); } break; } }