Exemple #1
0
        /// <summary>
        /// barcodetype 1-批次 2-序列号
        /// </summary>
        /// <param name="BarCode"></param>
        /// <param name="BatchNo"></param>
        /// <param name="BarCodeType"></param>
        /// <param name="strError"></param>
        /// <returns></returns>
        public bool GetBatchNoByBarCode(string BarCode, ref string BatchNo, ref string BarCodeType, ref string strError)
        {
            bool deCodeResult = false;

            //如果没有@分隔符,就认为是厂内批次号
            if (OutBarCode_DeCode.InvalidBarcode(BarCode) == false)
            {
                BatchNo      = BarCode;
                BarCodeType  = "1";
                deCodeResult = true;
            }
            else
            {
                if (OutBarCode_DeCode.GetBarcodeType(BarCode) == "0")
                {
                    deCodeResult = false;
                    strError     = "您扫描的不是外箱条码,请确认!";
                }
                else
                {
                    deCodeResult = true;
                    BarCodeType  = "2";
                    BatchNo      = OutBarCode_DeCode.GetSerialNo(BarCode);
                }
            }

            return(deCodeResult);
        }
Exemple #2
0
        /// <summary>
        /// 验证是否是外箱条码或者内箱条码
        /// </summary>
        /// <param name="BarCode"></param>
        /// <param name="SerialNo"></param>
        /// <param name="strError"></param>
        /// <returns>返回序列号和条码类型</returns>
        public bool GetSerialNoByBarCodeQiTao(string BarCode, ref string SerialNo, ref string BarCodeType, ref string strError)
        {
            bool deCodeResult = false;

            //如果没有@分隔符,就认为是序列号
            if (OutBarCode_DeCode.InvalidBarcode(BarCode) == false)
            {
                if (BarCode.Contains("P"))
                {
                    BarCodeType = "2";
                }
                else
                {
                    BarCodeType = "1";
                }
                SerialNo     = BarCode;
                deCodeResult = true;
            }
            else
            {
                BarCodeType  = OutBarCode_DeCode.GetBarcodeType(BarCode);
                deCodeResult = true;
                SerialNo     = OutBarCode_DeCode.GetSerialNo(BarCode);
            }

            return(deCodeResult);
        }
Exemple #3
0
        /// <summary>
        /// 验证是否是外箱条码或者托盘条码
        /// </summary>
        /// <param name="BarCode"></param>
        /// <param name="SerialNo"></param>
        /// <param name="strError"></param>
        /// <returns>返回序列号和条码类型</returns>
        public bool GetSerialNoByBarCode(string BarCode, ref string SerialNo, ref string BarCodeType, ref string strError)
        {
            bool deCodeResult = false;

            //如果没有@分隔符,就认为是序列号
            if (OutBarCode_DeCode.InvalidBarcode(BarCode) == false)
            {
                BarCodeType = OutBarCode_DeCode.GetSubBarcodeType(BarCode);

                if (BarCodeType == "3")
                {
                    BarCodeType  = "1";
                    SerialNo     = OutBarCode_DeCode.GetSubBarcodeSerialNo(BarCode);
                    deCodeResult = true;
                }
                else if (BarCodeType == "4")
                {
                    BarCodeType  = "2";
                    SerialNo     = BarCode;
                    deCodeResult = true;
                }
                else
                {
                    deCodeResult = false;
                    strError     = "您扫描的不是外箱条码或者托盘条码,请确认!";
                }
                //if (BarCode.Contains("P"))
                //{
                //    BarCodeType = "2";
                //}
                //else
                //{
                //    BarCodeType = "1";
                //}
                //SerialNo = BarCode;
                //deCodeResult = true;
            }
            else
            {
                if (OutBarCode_DeCode.GetBarcodeType(BarCode) == "0")
                {
                    deCodeResult = false;
                    strError     = "您扫描的不是外箱条码或者托盘条码,请确认!";
                }
                else
                {
                    BarCodeType  = OutBarCode_DeCode.GetBarcodeType(BarCode);
                    deCodeResult = true;
                    SerialNo     = OutBarCode_DeCode.GetSerialNo(BarCode);
                }
            }

            return(deCodeResult);
        }
Exemple #4
0
        public bool GetEANByBarCode(string BarCode, ref string EAN, ref string strError)
        {
            bool deCodeResult = false;

            if (EAN.Contains("@"))
            {
                if (OutBarCode_DeCode.GetBarcodeType(BarCode) == "0")
                {
                    deCodeResult = false;
                    strError     = "您扫描的不是外箱条码,请确认!";
                }
                else
                {
                    deCodeResult = true;
                    EAN          = OutBarCode_DeCode.GeEAN(BarCode);
                }
            }
            else
            {
                deCodeResult = true;
                EAN          = BarCode;
            }
            return(deCodeResult);
        }