Пример #1
0
 private void txtSearch_TextChanged(object sender, EventArgs e)
 {
     if (txtSearch.Text != "")
     {
         if (cLogin.search == 0)
         {
             dataGridView1.DataSource = db.SearchNVMaNV(txtSearch.Text);
         }
         else if (cLogin.search == 1)
         {
             dataGridView1.DataSource = db.SearchNVHoTen(txtSearch.Text);
         }
         else if (cLogin.search == 2)
         {
             dataGridView1.DataSource = db.SearchNVNu(txtSearch.Text);
         }
         else if (cLogin.search == 3)
         {
             dataGridView1.DataSource = db.SearchNVDiaChi(txtSearch.Text);
         }
         else if (cLogin.search == 4)
         {
             dataGridView1.DataSource = db.SearchNVSoDT(txtSearch.Text);
         }
         else if (cLogin.search == 5)
         {
             dataGridView1.DataSource = db.SearchNVNgaySinh(txtSearch.Text);
         }
         else
         {
             dataGridView1.DataSource = db.SearchNVLuong(txtSearch.Text);
         }
     }
     else
     {
         LoadData();
     }
 }