コード例 #1
0
        private void txtBarCodeID_TextChanged(object sender, EventArgs e)
        {
            string strBarCode = txtBarCodeID.Text.Trim();

            if (strBarCode.Length == barCodeType - 1)
            {
                if (BarCodeHelper.IsBarCodeValid("0" + strBarCode))
                {
                    strBarCode        = "0" + strBarCode;
                    txtBarCodeID.Text = strBarCode;
                    return;
                }
            }

            //Neu ma lay ve la 8 hoac 13 so thi thuc hien
            if (strBarCode.Length == barCodeType)
            {
                txtBarCodeID.Focus();

                if (barCodeType == 8)
                {
                    strBarCode = "00000" + strBarCode;
                }
                LoadEmployee(strBarCode);
            }
        }