Example #1
0
 void tbBarcode_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.F5 || e.KeyCode == Keys.OemQuestion || e.KeyCode == Keys.Divide)
     {
         frmSearchForItemV2 fsfi = new frmSearchForItemV2(ref tEngine);
         fsfi.ShowDialog();
         if (fsfi.GetItemBarcode() != "NONE_SELECTED")
         {
             tbBarcode.Text = fsfi.GetItemBarcode();
             Barcode        = tbBarcode.Text;
             tEngine.AddOrderSuggestion(Barcode);
             this.Close();
         }
     }
     else if (e.KeyCode == Keys.Enter)
     {
         if (tEngine.GetItemRecordContents(Barcode).Length > 1)
         {
             tEngine.AddOrderSuggestion(Barcode);
         }
         this.Close();
     }
     else if (e.KeyCode == Keys.Escape)
     {
         this.Close();
     }
 }