示例#1
0
 private void buttonFind_Click(object sender, EventArgs e)
 {
     if (!String.IsNullOrEmpty(SearchtextBox.Text))
     {
         if (listBoxSearchType.Enabled == true)
         {
             if (listBoxSearchType.GetSelected(0) == true)
             {
                 table = bd.GetUserbyName(bd, FirstUpper(SearchtextBox.Text.ToLower()));
                 dataGridView1.DataSource = table;
             }
             else
             {
                 table = bd.GetUserbyID(bd, SearchtextBox.Text);
                 dataGridView1.DataSource = table;
             }
         }
         else
         {
             table = bd.GetLoanbyID(bd, SearchtextBox.Text);
             dataGridView1.DataSource = table;
         }
     }
     else
     {
         MessageBox.Show("Строка поиска пуста!", "Пустая строка", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
     SetTableName(dataGridView1);
 }