Exemplo n.º 1
0
 //pmId文本框改变时
 private void txtPMId_TextChanged(object sender, EventArgs e)
 {
     txtPMId.Tag = null;
     listBoxEmpData.Items.Clear();
     if (txtPMId.Text != string.Empty)
     {
         listBoxEmpData.Visible       = true;
         this.listBoxEmpData.Location = new Point(txtPMId.Location.X, txtPMId.Location.Y + 22);
         EmployeeBll empBll = new EmployeeBll();
         var         data   = empBll.QueryLikeThis(txtPMId.Text);
         if (data != null)
         {
             foreach (var item in data)
             {
                 listBoxEmpData.Items.Add(item.Id + "_" + item.Name);
             }
         }
         else
         {
             listBoxEmpData.Visible = false;
         }
     }
     else
     {
         listBoxEmpData.Visible = false;
     }
 }
Exemplo n.º 2
0
        private void txtQueryCondition_TextChanged(object sender, EventArgs e)
        {
            // dataGridView1.DataSource = null;
            var a = empBll.QueryLikeThis(txtQueryCondition.Text);

            dataGridView1.DataSource = a;
        }