Пример #1
0
        private void searchHocVien(string textSearch)
        {
            DataTable tbHocVien = new DataTable();

            //1. Lastname
            if (int.Parse(lookSearchBy.GetColumnValue("ID").ToString()) == 1)
            {
                //tbHocVien = boHv.searchHocVienByLastName(textSearch);
                tbHocVien = boHv.searchHocVienByFullName(textSearch);
            }
            //2. Firstname
            if (int.Parse(lookSearchBy.GetColumnValue("ID").ToString()) == 2)
            {
                tbHocVien = boHv.searchHocVienByFirstName(textSearch);
            }
            //3.Ngay sinh
            if (int.Parse(lookSearchBy.GetColumnValue("ID").ToString()) == 3)
            {
                tbHocVien = boHv.searchHocVienByBirthday(textSearch);
            }
            //4. Noi sinh
            if (int.Parse(lookSearchBy.GetColumnValue("ID").ToString()) == 4)
            {
                tbHocVien = boHv.searchHocVienByNoiSinh(textSearch);
            }
            //Dien thoai
            if (int.Parse(lookSearchBy.GetColumnValue("ID").ToString()) == 5)
            {
                tbHocVien = boHv.searchHocVienByDienThoai(textSearch);
            }

            gridTrainee.DataSource = tbHocVien;
        }
Пример #2
0
        private void sResultSearchByFirstName()
        {
            boHv = new BO_HOCVIEN();
            string fullName = string.Empty;

            if (txtFirstName.Text != "")
            {
                fullName = txtFirstName.Text + " " + txtLastName.Text;
                hvTable  = boHv.searchHocVienByFullName(fullName);
                gridStudents.DataSource = hvTable;
            }
            else
            {
                return;
            }
        }
Пример #3
0
        private bool vCheckHocVienTonTai(string vString)
        {
            DataTable tbl = new DataTable();

            boHocVien = new BO_HOCVIEN();
            tbl       = boHocVien.searchHocVienByFullName(vString);
            if (tbl.Rows.Count > 0)
            {
                gridStudents.DataSource = tbl.DefaultView;
                btnDangKiHvMoi.Enabled  = false;
                flagExitse = true;
            }
            else
            {
                gridStudents.DataSource = null;
                btnDangKiHvMoi.Enabled  = true;
                flagExitse = false;
            }
            return(flagExitse);
        }
Пример #4
0
        private void searchHocVien(string textSearch)
        {
            DataTable tbHocVien = new DataTable();

            //1. Full name
            if (int.Parse(lookSearchBy.GetColumnValue("ID").ToString()) == 1)
            {
                tbHocVien = boHv.searchHocVienByFullName(textSearch);
            }
            //2. Last name
            else if (int.Parse(lookSearchBy.GetColumnValue("ID").ToString()) == 2)
            {
                tbHocVien = boHv.searchHocVienByLastName(textSearch);
            }
            //3. Firstname
            else if (int.Parse(lookSearchBy.GetColumnValue("ID").ToString()) == 3)
            {
                tbHocVien = boHv.searchHocVienByFirstName(textSearch);
            }
            //4.Ngay sinh
            else if (int.Parse(lookSearchBy.GetColumnValue("ID").ToString()) == 4)
            {
                tbHocVien = boHv.searchHocVienByBirthday(textSearch);
            }
            //5. Noi sinh
            else if (int.Parse(lookSearchBy.GetColumnValue("ID").ToString()) == 5)
            {
                tbHocVien = boHv.searchHocVienByNoiSinh(textSearch);
            }
            //6. Dien thoai
            else if (int.Parse(lookSearchBy.GetColumnValue("ID").ToString()) == 6)
            {
                tbHocVien = boHv.searchHocVienByDienThoai(textSearch);
            }
            //7.Theo số chứng chỉ
            else if (int.Parse(lookSearchBy.GetColumnValue("ID").ToString()) == 7)
            {
                tbHocVien = boHv.searchHocVienBySoCC(textSearch + " GTVT");
            }
            gridStudentsList.DataSource = tbHocVien;
        }