public RequestResult CheckMLBarCode(string BarCode, int type = 0) { RequestResult result = new RequestResult(); try { if (TB_BMCode.GetBoolBarCode(BarCode, type)) // 大标或中标是否存在 { result.message = "正常"; result.success = true; if (type == 1) { if (ScaleOutStoke.IsMiddleOutStock(BarCode)) { result.code = 304; result.message = "已出货,无法关联"; result.success = true; } } else if (type == 2) { if (ScaleOutStoke.IsBigOutStock(BarCode)) { result.code = 304; result.message = "已出货,无法关联"; result.success = true; } } } else { result.code = 304; result.message = "条码不存在"; result.success = false; } } catch (Exception ex) { result.code = 500; result.message = "服务出错"; result.success = false; DAL.Log.Instance.Write("检测中标或大标出错:" + ex.Message, "PDA上传出错"); } return(result); }