コード例 #1
0
        private void mBc2_OnScan(Symbol.Barcode2.ScanDataCollection scanDataCollection)
        {
            ScanData sData = scanDataCollection.GetFirst;
            var      str   = sData.Text;
            var      sType = sData.Type.ToString();

            byte[] by    = Encoding.Default.GetBytes(str);
            string sText = Encoding.GetEncoding(65001).GetString(by, 0, by.Length);

            scan_OnDecodeEvent(sText);
        }
コード例 #2
0
        private void barcode_OnScan(Symbol.Barcode2.ScanDataCollection scanDataCollection)
        {
            ScanData scanData = scanDataCollection.GetFirst;

            if (scanData.Result == Results.SUCCESS)
            {
                Employee emp = null;
                try
                {
                    emp = data.GetEmployee(scanData.Text);
                    if (emp == null)
                    {
                        MessageBox.Show("Пользователь с ШК ." + scanData.Text, "Не найден!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
                        return;
                    }
                }
                catch (Exception e)
                {
                    MessageBox.Show("Пользователь с ШК ." + scanData.Text, "Не найден!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
                    return;
                }
                setPositionIn_cmbEmployees(emp);
            }
        }