Beispiel #1
0
        private void btnTimKiem_Click(object sender, EventArgs e)
        {
            DataTable dtTimKiemNhanVien = new DataTable();

            if (cboTimKiem.EditValue as string == "Mã nhân viên")
            {
                string timkiem = string.Format("(MANV LIKE '%{0}%')", txtTimKiem.EditValue);
                dtTimKiemNhanVien            = nvControl.getDataSearch(timkiem);
                gcTimKiemNhanVien.DataSource = dtTimKiemNhanVien;
            }
            else if (cboTimKiem.EditValue as string == "Tên nhân viên")
            {
                string timkiem = string.Format("(TENNV LIKE N'%{0}%')", txtTimKiem.EditValue);
                dtTimKiemNhanVien            = nvControl.getDataSearch(timkiem);
                gcTimKiemNhanVien.DataSource = dtTimKiemNhanVien;
            }
            else if (cboTimKiem.EditValue as string == "Giới tính")
            {
                string timkiem = string.Format("(GIOITINH LIKE N'%{0}%')", txtTimKiem.EditValue);
                dtTimKiemNhanVien            = nvControl.getDataSearch(timkiem);
                gcTimKiemNhanVien.DataSource = dtTimKiemNhanVien;
            }
            else if (cboTimKiem.EditValue as string == "Chức vụ")
            {
                MessageBox.Show(txtTimKiem.EditValue as string);
                string timkiem = string.Format("(CHUCVU LIKE N'%{0}%')", txtTimKiem.EditValue);
                dtTimKiemNhanVien            = nvControl.getDataSearch(timkiem);
                gcTimKiemNhanVien.DataSource = dtTimKiemNhanVien;
            }
        }