public bool GetBarCodeInfoForQueryStock(string strBarCode, ref Barcode_Model Barcode_Model) { try { string strSerialNo = string.Empty; if (MaterialBarcodeDecode.InvalidBarcode(strBarCode) == false) { strSerialNo = strBarCode; } else { strSerialNo = MaterialBarcodeDecode.GetSerialNo(strBarCode); } ReceiveGoods_DB RGD = new ReceiveGoods_DB(); Barcode_Model = RGD.GetBarCodeInfo(strSerialNo); if (Barcode_Model == null || string.IsNullOrEmpty(Barcode_Model.SERIALNO)) { return(false); } return(true); } catch (Exception ex) { throw ex; } }
public string GetStockInfoBySerialNo(string strBarCode, string strUserJson) { StockHead_Model stockHeadModel = new StockHead_Model(); try { if (string.IsNullOrEmpty(strBarCode)) { stockHeadModel.Status = "E"; stockHeadModel.Message = "请先扫描条码!"; return(JSONUtil.JSONHelper.ObjectToJson <StockHead_Model>(stockHeadModel)); } UserInfo userModel = JSONUtil.JSONHelper.JsonToObject <UserInfo>(strUserJson); if (userModel == null || string.IsNullOrEmpty(userModel.UserNo)) { stockHeadModel.Status = "E"; stockHeadModel.Message = "没有获取用户信息!"; return(JSONUtil.JSONHelper.ObjectToJson <StockHead_Model>(stockHeadModel)); } string strSerialNo = string.Empty; if (MaterialBarcodeDecode.InvalidBarcode(strBarCode) == false) { if (strBarCode.ToLower().StartsWith("http")) { strSerialNo = strBarCode.Substring(strBarCode.LastIndexOf("?") + 4); } else { strSerialNo = strBarCode; } } else { strSerialNo = MaterialBarcodeDecode.GetSerialNo(strBarCode); } stockHeadModel.lstStockInfo = GetStockBySerialNo(strSerialNo); if (stockHeadModel.lstStockInfo == null || stockHeadModel.lstStockInfo.Count == 0) { stockHeadModel.Status = "E"; stockHeadModel.Message = "您扫描的物料或条码没有库存!"; return(JSONUtil.JSONHelper.ObjectToJson <StockHead_Model>(stockHeadModel)); } stockHeadModel.Status = "S"; return(JSONUtil.JSONHelper.ObjectToJson <StockHead_Model>(stockHeadModel)); } catch (Exception ex) { stockHeadModel.Status = "E"; stockHeadModel.Message = "Web异常:" + ex.Message; return(JSONUtil.JSONHelper.ObjectToJson <StockHead_Model>(stockHeadModel)); } }
public string GetBarCodeInfoForRefuseArrival(string strBarCode) { Barcode_Model barcodeMdl = new Barcode_Model(); try { string strSerialNo = string.Empty; if (MaterialBarcodeDecode.InvalidBarcode(strBarCode) == false) { if (strBarCode.ToLower().StartsWith("http")) { strSerialNo = strBarCode.Substring(strBarCode.LastIndexOf("?") + 4); } else { strSerialNo = strBarCode; } barcodeMdl.Status = "S"; } else { if (MaterialBarcodeDecode.GetBarcodeType(strBarCode).EndsWith("1") || MaterialBarcodeDecode.GetBarcodeType(strBarCode).EndsWith("5") || MaterialBarcodeDecode.GetBarcodeType(strBarCode).StartsWith("0")) { barcodeMdl.Status = "S"; strSerialNo = MaterialBarcodeDecode.GetSerialNo(strBarCode); } else { barcodeMdl.Status = "E"; barcodeMdl.Message = "您扫描的不是外箱条码,请确认!"; } } if (barcodeMdl.Status == "E") { return(JSONUtil.JSONHelper.ObjectToJson <Barcode_Model>(barcodeMdl)); } ReceiveGoods_DB RGD = new ReceiveGoods_DB(); barcodeMdl = RGD.GetBarCodeInfo(strSerialNo); if (barcodeMdl == null || string.IsNullOrEmpty(barcodeMdl.SERIALNO)) { barcodeMdl.Status = "E"; barcodeMdl.Message = "您扫描的条码不存在,请确认!"; return(JSONUtil.JSONHelper.ObjectToJson <Barcode_Model>(barcodeMdl)); } string strErrorMsg = ""; if (RGD.IsChecking(barcodeMdl, ref strErrorMsg)) { barcodeMdl.Status = "E"; barcodeMdl.Message = strErrorMsg; return(JSONUtil.JSONHelper.ObjectToJson <Barcode_Model>(barcodeMdl)); } barcodeMdl.ArrivalRowNo = RGD.GetArrivalRowNo(barcodeMdl); barcodeMdl.Status = "S"; return(JSONUtil.JSONHelper.ObjectToJson <Barcode_Model>(barcodeMdl)); } catch (Exception ex) { barcodeMdl.Status = "E"; barcodeMdl.Message = "Web异常:" + ex.Message + ex.StackTrace; return(JSONUtil.JSONHelper.ObjectToJson <Barcode_Model>(barcodeMdl)); } }