| | |
| | | Single msg_HRate = float.Parse(sArray[3]); |
| | | Int64 HItemID = 0; |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | |
| | | ClsXt_SystemParameter oClsXt_SystemParameter = new ClsXt_SystemParameter(); |
| | | //获取最大ID值赋值 |
| | | DataSet Maxds = oCN.RunProcReturn("select MAX(HItemID) HItemID from Gy_Unit ", "Gy_Unit"); |
| | | if (Maxds != null || Maxds.Tables[0].Rows.Count > 0) |
| | |
| | | } |
| | | else//编辑时判断 |
| | | { |
| | | //已审核不允许修改 |
| | | DataSet dss; |
| | | dss = oCN.RunProcReturn("select * from Gy_Unit where HItemID=" + oItem.HItemID, "Gy_Unit"); |
| | | //判断是否可编辑 |
| | | if (dss.Tables[0].Rows[0]["HCheckEmp"].ToString() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "此单据状态已经审核,不允许修改!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //检查父级是否存在 |
| | | string sParent; |
| | | sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim()); |
| | |
| | | } |
| | | if (bResult) |
| | | { |
| | | //自动审核功能 |
| | | if(oBill.oModel.HItemID == 0) |
| | | { |
| | | ds = oCN.RunProcReturn("select * from Gy_Unit where HStopflag=0 and HNumber='" + oBill.oModel.HNumber.Trim() + "'", "Gy_Unit"); |
| | | if (ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "保存成功!自动审核失败找不到对应单据"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | string sAutoCheck = oClsXt_SystemParameter.GetSingleSystemParameter("Gy_Unit_AutoCheck", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | objJsonResult.Verify = "N"; |
| | | if (sAutoCheck == "Y") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "保存成功"; |
| | | objJsonResult.data = ds.Tables[0].Rows[0]["HItemID"].ToString(); |
| | | objJsonResult.Verify = "Y"; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "保存成功!"; |
| | | //WebAPIController.Add_Log("送货单下推", UserName, "生成送货单"); |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |