Exemple #1
0
 private void txtSourceClient_TextChanged(object sender, EventArgs e)
 {
     if (cmbSourceClient.Text == "Nome")
     {
         searchObject.SearchName = txtSourceClient.Text;
         dgvClient.DataSource    = clientBLL.GetAllClientsByName(searchObject).Data;
     }
     else if (cmbSourceClient.Text == "CPF")
     {
         searchObject.SearchCPF = txtSourceClient.Text;
         dgvClient.DataSource   = clientBLL.GetAllClientsByCPF(searchObject).Data;
     }
     else
     {
         if (txtSourceClient.Text == "")
         {
             dgvClient.DataSource = clientBLL.GetAllClientsByActive().Data;
             return;
         }
         else
         {
             searchObject.SearchID = Convert.ToInt32(txtSourceClient.Text);
             dgvClient.DataSource  = clientBLL.GetClientsByID(searchObject.SearchID).Data;
         }
     }
 }