Exemplo n.º 1
0
 private void txtSearch_TextChanged(object sender, EventArgs e)
 {
     if (txtSearch.Text != "")
     {
         if (cLogin.search == 0)
         {
             dataGridView1.DataSource = db.SearchDGMaThe(txtSearch.Text);
         }
         else if (cLogin.search == 1)
         {
             dataGridView1.DataSource = db.SearchDGHoTen(txtSearch.Text);
         }
         else if (cLogin.search == 2)
         {
             dataGridView1.DataSource = db.SearchDGNgaySinh(txtSearch.Text);
         }
         else if (cLogin.search == 3)
         {
             dataGridView1.DataSource = db.SearchDGNgayCap(txtSearch.Text);
         }
         else if (cLogin.search == 4)
         {
             dataGridView1.DataSource = db.SearchDGHanDung(txtSearch.Text);
         }
         else
         {
             dataGridView1.DataSource = db.SearchDGDiaChi(txtSearch.Text);
         }
     }
     else
     {
         LoadData();
     }
 }