| | |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | //查询数据中是否存在重复代码 |
| | | ds = oCN.RunProcReturn("Select HItemID from Gy_Warehouse Where HItemID<>" + HItemID + " and HNumber='" + HNumber + "' and HUSEORGID=" + HUSEORGID, "Gy_Warehouse"); |
| | | |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "保存失败!代码重复!"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | //保存 |
| | | //保存完毕后处理 |
| | | if (HItemID == 0) |
| | |
| | | else { |
| | | //若MAINDI重复则重新获取 |
| | | oCN.BeginTran(); |
| | | //已审核不允许修改 |
| | | DataSet dss; |
| | | dss = oCN.RunProcReturn("select * from Gy_Warehouse where HItemID=" + HItemID, "Gy_Warehouse"); |
| | | //判断是否可编辑 |
| | | if (dss.Tables[0].Rows[0]["HCheckEmp"].ToString() != "") |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "此单据状态已经审核,不允许修改!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //主表 |
| | | oCN.RunProc("Update Gy_Warehouse set " + |
| | | " HNumber='" + HNumber + "'" + |