Ejemplo n.º 1
0
        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;
            }
        }
Ejemplo n.º 2
0
        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);
            }
        }
Ejemplo n.º 3
0
        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;
            }
        }