Esempio n. 1
0
 void txtCode_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         cmbMaterial.Items.Clear();
         string barcode = this.txtCode.Text.Trim();
         LogBusiness.RecordLog(user, "扫码器读取条码为:" + barcode, "读取条码");
         DataTable table = test.GetInfomation(barcode);
         if (table.Rows.Count != 0)
         {
             foreach (DataRow item in table.Rows)
             {
                 if (!cmbMaterial.Items.Contains(item["MaterialNumber"]))
                 {
                     this.cmbMaterial.Items.Add(item["MaterialNumber"]);
                 }
             }
             cmbMaterial.SelectedIndex = 0;
         }
         else
         {
             MessageBox.Show("未查询到数据,请重试!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
 }
Esempio n. 2
0
 /// <summary>
 /// 查询
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnSearch_Click(object sender, EventArgs e)
 {
     this.grideMes.DataSource = test.GetInfomation(txtArriveBarcode.Text.Trim());
 }