| | |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | ds = oCN.RunProcReturn("select HItemID,HParentID,HNumber,HName,HLevel, case when HEndFlag<>0 then 'Y'else ' 'end HEndFlag,case when HStopFlag <> 0 then 'Y'else ' 'end HStopFlag, HRemark, HUseFlag from Gy_MouldType where 1=1 " + sWhere+ " order by HNumber", "Gy_MouldType"); |
| | | //ds = oCN.RunProcReturn("select HItemID,HParentID,HNumber,HName,HLevel, case when HEndFlag<>0 then 'Y'else ' 'end HEndFlag,case when HStopFlag <> 0 then 'Y'else ' 'end HStopFlag, HRemark, HUseFlag from Gy_MouldType where 1=1 " + sWhere+ " order by HNumber", "Gy_MouldType"); |
| | | |
| | | string sql = "select * from h_v_Gy_MouldType where 1=1 " + sWhere + " order by 器具分类代码,器具分类名称,所属父级分类名称,创建人,审核人,备注,组织,禁用标记"; |
| | | |
| | | ds = oCN.RunProcReturn(sql, "h_v_Gy_MouldType"); |
| | | |
| | | foreach (DataColumn col in ds.Tables[0].Columns) |
| | | { |
| | | Type dataType = col.DataType; |
| | |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | DataSet ds_check_1 = oCN.RunProcReturn("select * from Gy_MouldType where HItemID =" + HItemID, "Gy_MouldType"); |
| | | if (ds_check_1.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "删除失败:数据不存在"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else if (ds_check_1.Tables[0].Rows[0]["HCheckEmp"].ToString() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "删除失败:当前数据已审核,不可删除"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (oDeptHlp.GetInfoByID(HItemID)) |
| | | { |
| | | if (oDept.HavChildCodes(HItemID)) |
| | |
| | | bool HStopflag = list[0].HStopflag; |
| | | string HUseFlag = list[0].HUseFlag; |
| | | bool HEndFlag = list[0].HEndFlag; |
| | | long HUSEORGID = list[0].HUSEORGID; |
| | | |
| | | DataSet ds_check = oCN.RunProcReturn("select * from Gy_MouldType where HNumber = '" + HNumber + "' and HUSEORGID = " + HUSEORGID, "Gy_MouldType"); |
| | | if (ds_check.Tables[0].Rows.Count > 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "新增失败:当前组织下代码【" + HNumber + "】已存在,请修改代码后重新保存"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //判断权限 |
| | | if (!DBUtility.ClsPub.Security_Log(msg4, 1, false, msg3)) |
| | |
| | | //主表 |
| | | oCN.RunProc("Insert into Gy_MouldType " + |
| | | " (HNumber,HName,HHelpCode,HShortNumber,HParentID" + |
| | | ",HLevel,HEndFlag,HStopflag,HRemark,HMakeEmp,HMakeTime) " + |
| | | ",HLevel,HEndFlag,HStopflag,HRemark,HMakeEmp,HMakeTime,HUSEORGID) " + |
| | | " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "'," + HParentID + |
| | | "," + HLevel+ "," + Convert.ToString(HEndFlag ? 1 : 0) + "," + Convert.ToString(HStopflag ? 1 : 0) + ",'" + HRemark + "','" + msg3 + "',getdate())", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | "," + HLevel+ "," + Convert.ToString(HEndFlag ? 1 : 0) + "," + Convert.ToString(HStopflag ? 1 : 0) + ",'" + HRemark + "','" + msg3 + "',getdate()," + HUSEORGID + ")", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //修改上级为非末级代码 |
| | | oCN.RunProc("Update Gy_MouldType set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | oCN.Commit(); |
| | |
| | | string HRemark = list[0].HRemark; |
| | | bool HStopflag = list[0].HStopflag; |
| | | string HUseFlag = list[0].HUseFlag; |
| | | long HUSEORGID = list[0].HUSEORGID; |
| | | |
| | | DataSet ds_check = oCN.RunProcReturn("select * from Gy_MouldType where HNumber = '" + HNumber + "' and HUSEORGID = " + HUSEORGID + " and HItemID <>" + HItemID,"Gy_MouldType"); |
| | | if (ds_check.Tables[0].Rows.Count > 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "修改失败:当前组织下代码【" + HNumber + "】已存在,请修改代码后重新保存"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | DataSet ds_check_1 = oCN.RunProcReturn("select * from Gy_MouldType where HItemID =" + HItemID, "Gy_MouldType"); |
| | | if (ds_check_1.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "修改失败:数据不存在"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else if(ds_check_1.Tables[0].Rows[0]["HCheckEmp"].ToString() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "修改失败:当前数据已审核,不可修改"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //判断权限 |
| | | if (!DBUtility.ClsPub.Security_Log(msg5, 1, false, msg4)) |
| | |
| | | ",HRemark= '" + HRemark + "' " + |
| | | ",HModifyEmp='" + msg4 + "' " + |
| | | ",HModifyTime=getdate() " + |
| | | "Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | ",HUSEORGID=" + HUSEORGID + " " + |
| | | " Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //修改子项目代码 |
| | | //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_RepairCheck,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //将上级 为非末级 |
| | |
| | | { |
| | | try |
| | | { |
| | | ds = oCN.RunProcReturn("select * from Gy_MouldType where HItemID=" + HInterID, "Gy_MouldType"); |
| | | string sql = "select a.*,b.HName HParentName from Gy_MouldType as a left join Gy_MouldType as b on a.HParentID = b.HItemID where a.HItemID=" + HInterID; |
| | | ds = oCN.RunProcReturn(sql, "Gy_MouldType"); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |