wtt
6 天以前 9124a9b2e9f4a041da4509039c65a70cc81dd033
WebAPI/Controllers/WebAPIController.cs
@@ -14637,7 +14637,7 @@
                    }
                    //查询数据中是否存在重复代码
                    ds = oCN.RunProcReturn("select * from  Gy_PreventErrMould where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_PreventErrMould");
                    //ds = oCN.RunProcReturn("select * from  Gy_PreventErrMould where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_PreventErrMould");
                    if (oItem.HNumber.Trim() == "")
                    {
                        objJsonResult.code = "0";
@@ -14646,21 +14646,32 @@
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    //查询数据中是否存在重复代码
                    ds = oCN.RunProcReturn("Select HItemID from Gy_PreventErrMould  Where HItemID<>" + oItem.HItemID + " and HNumber='" + oItem.HNumber.Trim() + "' and HUSEORGID=" + oItem.HUSEORGID, "Gy_PreventErrMould");
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败!代码重复!";
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    //新增时判断
                    if (oItem.HItemID == 0)
                    {
                        if (ds == null || ds.Tables[0].Rows.Count == 0)
                        {
                        //if (ds == null || ds.Tables[0].Rows.Count == 0)
                        //{
                        }
                        else
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "保存失败!代码重复!";
                            objJsonResult.data = 1;
                            return objJsonResult;
                        }
                        //}
                        //else
                        //{
                        //    objJsonResult.code = "0";
                        //    objJsonResult.count = 0;
                        //    objJsonResult.Message = "保存失败!代码重复!";
                        //    objJsonResult.data = 1;
                        //    return objJsonResult;
                        //}
                        //检查父级是否存在
                        string sParent;
                        sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim());
@@ -14686,6 +14697,18 @@
                    }
                    else//编辑时判断
                    {
                        //已审核不允许修改
                        DataSet dss;
                        dss = oCN.RunProcReturn("select * from Gy_PreventErrMould where HItemID=" + oItem.HItemID, "Gy_PreventErrMould");
                        //判断是否可编辑
                        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());
@@ -15275,7 +15298,7 @@
                    }
                    //查询数据中是否存在重复代码
                    ds = oCN.RunProcReturn("select * from  Gy_CheckNoteItem where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_CheckNoteItem");
                    //ds = oCN.RunProcReturn("select * from  Gy_CheckNoteItem where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_CheckNoteItem");
                    if (oItem.HNumber.Trim() == "")
                    {
                        objJsonResult.code = "0";
@@ -15284,21 +15307,21 @@
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    //查询数据中是否存在重复代码
                    ds = oCN.RunProcReturn("Select HItemID from Gy_CheckNoteItem  Where HItemID<>" + oItem.HItemID + " and HNumber='" + oItem.HNumber.Trim() + "' and HUSEORGID=" + oItem.HUSEORGID, "Gy_CheckNoteItem");
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败!代码重复!";
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    //新增时判断
                    if (oItem.HItemID == 0)
                    {
                        if (ds == null || ds.Tables[0].Rows.Count == 0)
                        {
                        }
                        else
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "保存失败!代码重复!";
                            objJsonResult.data = 1;
                            return objJsonResult;
                        }
                        //检查父级是否存在
                        string sParent;
                        sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim());
@@ -15324,6 +15347,18 @@
                    }
                    else//编辑时判断
                    {
                        //已审核不允许修改
                        DataSet dss;
                        dss = oCN.RunProcReturn("select * from Gy_CheckNoteItem where HItemID=" + oItem.HItemID, "Gy_CheckNoteItem");
                        //判断是否可编辑
                        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());