|  |  |  | 
|---|
|  |  |  | { | 
|---|
|  |  |  | List<object> columnNameList = new List<object>(); | 
|---|
|  |  |  | //查看权限 | 
|---|
|  |  |  | //if (!DBUtility.ClsPub.Security_Log("Gy_ProjectStage_Query", 1, false, user)) | 
|---|
|  |  |  | //{ | 
|---|
|  |  |  | //    objJsonResult.code = "0"; | 
|---|
|  |  |  | //    objJsonResult.count = 0; | 
|---|
|  |  |  | //    objJsonResult.Message = "无查看权限!"; | 
|---|
|  |  |  | //    objJsonResult.data = null; | 
|---|
|  |  |  | //    return objJsonResult; | 
|---|
|  |  |  | //} | 
|---|
|  |  |  | if (!DBUtility.ClsPub.Security_Log("Xs_SeOrderChangeBill_Query", 1, false, user)) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | objJsonResult.code = "0"; | 
|---|
|  |  |  | objJsonResult.count = 0; | 
|---|
|  |  |  | objJsonResult.Message = "无查看权限!"; | 
|---|
|  |  |  | objJsonResult.data = null; | 
|---|
|  |  |  | return objJsonResult; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (sWhere == null || sWhere.Equals("")) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | 
|---|
|  |  |  | DateTime today = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd"));                   //当日日期 | 
|---|
|  |  |  | foreach (Model.ClsXs_SeOrderChangeBillSub oSub in oBill.DetailColl) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | //判断新数量是否小于单据关联数量 | 
|---|
|  |  |  | if(oSub.HQty_New < oSub.HRelationQty) | 
|---|
|  |  |  | string sqlCheck = "select * from Xs_SeOrderBillSub where HInterID = " + oSub.HSourceInterID + " and HEntryID = " + oSub.HSourceEntryID; | 
|---|
|  |  |  | ds = oCN.RunProcReturn(sqlCheck, "Xs_SeOrderBillSub"); | 
|---|
|  |  |  | if (ds.Tables[0].Rows.Count == 0) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | errorMessage += "第" + oSub.HEntryID + "行物料新数量小于单据被关联数量!"; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //判断新交货日期是否早于当日 | 
|---|
|  |  |  | if ( oSub.HDate_New.CompareTo(today) < 0 ) | 
|---|
|  |  |  | errorMessage += "第" + oSub.HEntryID + "行物料在源单-销售订单中不存在!"; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | else | 
|---|
|  |  |  | { | 
|---|
|  |  |  | errorMessage +=  "第" + oSub.HEntryID + "行新交货日期早于当日!"; | 
|---|
|  |  |  | double HRelationQty = 0; | 
|---|
|  |  |  | //获取销售订单变更单中对应物料在源单-销售订单中的关联数量 | 
|---|
|  |  |  | HRelationQty = double.Parse(ds.Tables[0].Rows[0]["HRelationQty"].ToString()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //判断物料新数量是否小于源单单据中对应物料的关联数量 | 
|---|
|  |  |  | if (oSub.HQty_New < HRelationQty) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | errorMessage += "第" + oSub.HEntryID + "行物料新数量小于源单-销售订单被关联数量!"; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //判断新交货日期是否早于当日 | 
|---|
|  |  |  | if (oSub.HDate_New.CompareTo(today) < 0) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | errorMessage += "第" + oSub.HEntryID + "行新交货日期早于当日!"; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if(errorMessage != "") | 
|---|