Example #1
0
 private void Search_Click(object sender, EventArgs e)
 {
     try
     {
         if (waysToFind.SelectedItem == null)
         {
             return;
         }
         if (waysToFind.SelectedItem.ToString() == "订单号")
         {
             orderBindingSource.DataSource = orderService.SearchByOrdNum(KeyWord);
         }
         if (waysToFind.SelectedItem.ToString() == "买者")
         {
             orderBindingSource.DataSource = orderService.SearchByBuyerName(KeyWord);
         }
         if (waysToFind.SelectedItem.ToString() == "货物")
         {
             orderBindingSource.DataSource = orderService.SearchByGoodsName(KeyWord);
         }
         if (waysToFind.SelectedItem.ToString() == "所有订单")
         {
             orderBindingSource.DataSource = orderService.orders;
         }
     }
     catch (Exception ev)
     {
         MessageBox.Show(ev.Message);
     }
 }