Example #1
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);
        }
Example #2
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);
        }
Example #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);
        }
Example #4
0
        //补打条码列表
        public string GetOutBarCodeForPrint(string BarCode)
        {
            BaseMessage_Model <List <T_OutBarCodeInfo> > model = new BaseMessage_Model <List <T_OutBarCodeInfo> >();

            try
            {
                string                  strError  = string.Empty;
                T_OutBarcode_DB         _db       = new T_OutBarcode_DB();
                List <T_OutBarCodeInfo> modellist = new List <T_OutBarCodeInfo>();
                string                  SerialNo  = "";
                if (BarCode.Contains("@"))
                {
                    SerialNo = OutBarCode_DeCode.GetSerialNo(BarCode);
                }
                else
                {
                    SerialNo = BarCode;
                }

                modellist = _db.GetOutBarCodeForPrint(SerialNo);
                if (modellist == null || modellist.Count == 0)
                {
                    model.HeaderStatus = "E";
                    model.Message      = "您扫描的条码不存在!请确认是否已经打印!";
                    return(JSONHelper.ObjectToJson <BaseMessage_Model <List <T_OutBarCodeInfo> > >(model));
                }
                model.HeaderStatus = "S";
                model.ModelJson    = modellist;
                return(JSONHelper.ObjectToJson <BaseMessage_Model <List <T_OutBarCodeInfo> > >(model));
            }
            catch (Exception ex)
            {
                model.HeaderStatus = "E";
                model.Message      = ex.Message;
                return(JSONHelper.ObjectToJson <BaseMessage_Model <List <T_OutBarCodeInfo> > >(model));
            }
        }
Example #5
0
        public string GetErpVoucherNo(string BarCode)
        {
            BaseMessage_Model <string> model = new BaseMessage_Model <string>();

            try
            {
                string          strError = string.Empty;
                T_OutBarcode_DB _db      = new T_OutBarcode_DB();
                string          SerialNo = "";
                if (BarCode.Contains("@"))
                {
                    SerialNo = OutBarCode_DeCode.GetSerialNo(BarCode);
                }
                else
                {
                    SerialNo = BarCode;
                }

                string erpvoucherno = _db.GetErpVoucherNo(SerialNo);
                if (string.IsNullOrEmpty(erpvoucherno))
                {
                    model.HeaderStatus = "E";
                    model.Message      = "您扫描的条码没有单据号";
                    return(JSONHelper.ObjectToJson <BaseMessage_Model <string> >(model));
                }
                model.HeaderStatus = "S";
                model.ModelJson    = erpvoucherno;
                return(JSONHelper.ObjectToJson <BaseMessage_Model <string> >(model));
            }
            catch (Exception ex)
            {
                model.HeaderStatus = "E";
                model.Message      = ex.Message;
                return(JSONHelper.ObjectToJson <BaseMessage_Model <string> >(model));
            }
        }