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 bool PrintQuality(DeliveryReceive_Model deliveryMdl, UserInfo userModel, ref string strErrMsg) { ReceiveGoods_DB RGD = new ReceiveGoods_DB(); if (!RGD.PrintQuality(deliveryMdl, userModel, ref strErrMsg)) { strErrMsg = "更新打印次数失败!" + strErrMsg; return(false); } return(true); }
/// <summary> /// 获取检验通知书表体数据 /// </summary> /// <param name="DeliveryInfo"></param> /// <param name="strErrMsg"></param> /// <returns></returns> public bool GetQualityDetailInfo(DeliveryReceive_Model DeliveryInfo, ref List <DeliveryReceiveDetail_Model> lstDeliveryDetailInfo, UserInfo userModel, ref string strErrMsg) { try { ReceiveGoods_DB RGD = new ReceiveGoods_DB(); lstDeliveryDetailInfo = RGD.GetQualityDetailInfo(DeliveryInfo); if (lstDeliveryDetailInfo == null || lstDeliveryDetailInfo.Count == 0) { strErrMsg = "没有获取到质检数据!"; return(false); } return(true); } catch (Exception ex) { strErrMsg = "Web异常:" + ex.Message; return(false); } }
public bool SaveQualityDetailInfo(DeliveryReceive_Model DeliveryModel, UserInfo userModel, ref string strErrMsg) { try { if (DeliveryModel.lstDeliveryDetail == null || DeliveryModel.lstDeliveryDetail.Count == 0) { strErrMsg = "没有质检数据!"; return(false); } if (DeliveryModel.lstDeliveryDetail.Where(t => t.OKSelect == true).Count() == 0) { strErrMsg = "请选中质检行!"; return(false); } if (DeliveryModel.lstDeliveryDetail.Where(t => t.CurrentQualityQty > 0 || t.CurrentUnQualityQty > 0).Count() == 0) { strErrMsg = "合格数量和不合格数量都为零,不能保存!"; return(false); } if (CheckQualityQty(DeliveryModel.lstDeliveryDetail.Where(t => t.CurrentQualityQty > 0 || t.CurrentUnQualityQty > 0).ToList(), ref strErrMsg) == false) { return(false); } DeliveryModel.lstDeliveryDetail = DeliveryModel.lstDeliveryDetail.Where(t => t.OKSelect == true).ToList(); string strDeliveryDetailXml = XMLUtil.XmlUtil.Serializer(typeof(DeliveryReceive_Model), DeliveryModel); TOOL.WriteLogMethod.WriteLog("方法:SaveQualityDetailInfo" + strDeliveryDetailXml); ReceiveGoods_DB RGD = new ReceiveGoods_DB(); return(RGD.SaveQualityDetailInfo(strDeliveryDetailXml, userModel, ref strErrMsg)); } catch (Exception ex) { strErrMsg = ex.Message; return(false); } }
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)); } }