示例#1
0
        private void searchHocVien(string textSearch)
        {
            DataTable tbHocVien = new DataTable();

            if (grpChungChi.SelectedIndex == 0)
            {
                //1. Full name
                if (int.Parse(lookSearchBy.GetColumnValue("ID").ToString()) == 1)
                {
                    tbHocVien = boHv.searchHocVienByFullName_1(textSearch);
                }
                //2. Last name
                else if (int.Parse(lookSearchBy.GetColumnValue("ID").ToString()) == 2)
                {
                    tbHocVien = boHv.searchHocVienByLastName_1(textSearch);
                }
                //3. Firstname
                else if (int.Parse(lookSearchBy.GetColumnValue("ID").ToString()) == 3)
                {
                    tbHocVien = boHv.searchHocVienByFirstName_1(textSearch);
                }
                //7.Theo số chứng chỉ
                else if (int.Parse(lookSearchBy.GetColumnValue("ID").ToString()) == 7)
                {
                    tbHocVien = boHv.searchHocVienBySoCC_1(textSearch + " GTVT");
                }
            }
            else if (grpChungChi.SelectedIndex == 1)
            {
                //1. Full name
                if (int.Parse(lookSearchBy.GetColumnValue("ID").ToString()) == 1)
                {
                    tbHocVien = boHv.searchHocVienByFullName_1_Doi(textSearch);
                }
                //2. Last name
                else if (int.Parse(lookSearchBy.GetColumnValue("ID").ToString()) == 2)
                {
                    tbHocVien = boHv.searchHocVienByLastName_1_Doi(textSearch);
                }
                //3. Firstname
                else if (int.Parse(lookSearchBy.GetColumnValue("ID").ToString()) == 3)
                {
                    tbHocVien = boHv.searchHocVienByFirstName_1_Doi(textSearch);
                }
                //7.Theo số chứng chỉ
                else if (int.Parse(lookSearchBy.GetColumnValue("ID").ToString()) == 7)
                {
                    tbHocVien = boHv.searchHocVienBySoCC_1_Doi(textSearch + " GTVT");
                }
            }

            gridStudentsList.DataSource = tbHocVien;
        }