diff --git a/WebService/AppWebservice.asmx.cs b/WebService/AppWebservice.asmx.cs index 9c3f1cf..9487064 100644 --- a/WebService/AppWebservice.asmx.cs +++ b/WebService/AppWebservice.asmx.cs @@ -108,15 +108,17 @@ namespace Webservice if (dt.Rows.Count < 1) { - model.Result = "0"; + model.ResultRowsCount = "0"; model.DataList = null; if (string.IsNullOrEmpty(errorReasonBoxData)) { - model.ErrReason = "箱码包含总成数量为零"; + model.Result = "1"; + model.ErrReason = ""; } else { + model.Result = "0"; model.ErrReason = errorReasonBoxData; } } @@ -133,6 +135,7 @@ namespace Webservice var barCodeList = barCode.Split(';'); if (!barCode.Contains("S104") || !barCode.Contains(".") || barCodeList[0].Length != 17 || barCodeList[1].Length != 4 || barCodeList[2].Length != 4) { + model.Result = "0"; model.ErrReason = "总成条码格式不对或不存在"; Context.Response.Write(JSONTools.ScriptSerialize>(model)); return; @@ -143,6 +146,7 @@ namespace Webservice string barCodePartNo = barCodeList[0].Substring(0, 10); if(boxPartNo != barCodePartNo) { + model.Result = "0"; model.ErrReason = "箱码和总成条码零件号不符"; Context.Response.Write(JSONTools.ScriptSerialize>(model)); return; @@ -158,15 +162,17 @@ namespace Webservice if (dt.Rows.Count < 1) { - model.Result = "0"; + model.ResultRowsCount = "0"; model.DataList = null; if (string.IsNullOrEmpty(errorReasonBoxData)) { - model.ErrReason = "箱码包含总成数量为零"; + model.Result = "1"; + model.ErrReason = ""; } else { + model.Result = "0"; model.ErrReason = errorReasonBoxData; } }