| | |
| | | string FID = JObject.Parse(result)["Result"]["Id"].ToString(); |
| | | |
| | | string updateSql = string.Format(@" |
| | | update a set |
| | | a.HERPInterID = {0} , |
| | | a.HERPBillNO ='{1}' |
| | | from Cg_POInStockBillMain a |
| | | join Cg_POInStockBillSub b on a.hinterid = b.hinterid |
| | | where b.HInterID = ({2}) |
| | | and b. HSOURCEINTERID = {3} |
| | | and a.HERPInterID = 0 |
| | | ", FID, FBillNo, dr["HINTERID"].ToString(), dr["FID"].ToString()); |
| | | update a set |
| | | a.HERPInterID = {0} , |
| | | a.HERPBillNO ='{1}' |
| | | from Cg_POInStockBillMain a |
| | | join Cg_POInStockBillSub b on a.hinterid = b.hinterid |
| | | where b.HInterID = ({2}) |
| | | and b. HSOURCEINTERID = {3} |
| | | and a.HERPInterID = 0 |
| | | ", FID, FBillNo, dr["HINTERID"].ToString(), dr["FID"].ToString()); |
| | | oCn.RunProc(updateSql); |
| | | } |
| | | else |
| | |
| | | //更新关联数量 |
| | | HinterID = mylist[i].ToString(); |
| | | oCn.RunProc("exec h_p_SRM_UpDatePPBomRelationQty '" + HinterID + "'"); |
| | | //判断未关联数量是否为0 |
| | | DataSet ds = oCn.RunProcReturn("select * from H_v_SRM_POOrderBillList where hmainid='"+HinterID+"'", "H_v_SRM_POOrderBillList"); |
| | | if (ds!= null || ds.Tables[0].Rows.Count>0) |
| | | { |
| | | if (ds.Tables[0].Rows[0]["未关联数量"].ToString() == "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "单据号:" + ds.Tables[0].Rows[0]["单据号"].ToString()+"已全部生成送货单!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "操作成功!"; |