| | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | #region 工作中心 文件上传 |
| | | [Route("Gy_WorkCenter/Gy_WorkCenter_Excel")] |
| | | [HttpPost] |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 返回工作中心列表 |
| | | ///参数:string sql。 |
| | | ///返回值:object。 |
| | | /// 查询方法 |
| | | /// </summary> |
| | | [Route("Gy_WorkCenter/list")] |
| | | [HttpGet] |
| | |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 保存按钮 |
| | | ///参数:string sql。 |
| | | ///返回值:object。 |
| | | /// </summary> |
| | | [Route("Gy_WorkCenter/ModifyByID")] |
| | | [HttpPost] |
| | |
| | | var HProcID = list[0].HProcID; |
| | | var HWorkTimes = list[0].HWorkTimes; |
| | | int HUSEORGID = list[0].HUSEORGID; |
| | | int HCREATEORGID = list[0].HCREATEORGID; |
| | | string HMaker = msg2; |
| | | |
| | | //末级标志 |
| | |
| | | if (HItemID == 0) |
| | | { |
| | | oCN.BeginTran(); |
| | | //保存前控制========================================= |
| | | string sql1 = "exec h_p_Gy_WorkCenter_BeforeSaveCtrl " + HMaker + ",'" + 1 + "'"; |
| | | ds = oCN.RunProcReturn(sql1, "h_p_Gy_WorkCenter_BeforeSaveCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "保存失败!原因:保存前判断失败,请与网络管理人员联系"; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "保存失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | //================================================================================== |
| | | |
| | | |
| | | oCN.RunProc("Insert into Gy_WorkCenter " + |
| | | " (HNumber,HName,HHelpCode,HShortNumber,HParentID" + |
| | | ",HDeptNumber,HWorkTimes,HQty" + |
| | | ",HLevel,HEndFlag,HStopflag,HRemark,HDeptID,HBarCodeForBase" + |
| | | ",HProcID,HDayMoney,HUSEORGID,HMaker,HMakeTime) " + |
| | | " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "'," + HParentID.ToString() + |
| | | ",'" + HDeptNumber + "'," + HWorkTimes + "," + HQty + |
| | | "," + HLevel.ToString() + "," + Convert.ToString(HEndFlag ? 1 : 0) + "," + Convert.ToString(HStopflag ? 1 : 0) + |
| | | ",'" + HRemark + "'," + HDeptID + ",'" + HBarCodeForBase + "'," + HProcID + "," + HDayMoney + ","+ HUSEORGID + "" + |
| | | ",'"+ HMaker + "',getdate())", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | " (HNumber,HName,HHelpCode,HShortNumber,HParentID" + |
| | | ",HDeptNumber,HWorkTimes,HQty,HUseFlag" + |
| | | ",HLevel,HEndFlag,HStopflag,HRemark,HDeptID,HBarCodeForBase" + |
| | | ",HProcID,HDayMoney,HUSEORGID,HCREATEORGID,HMaker,HMakeTime) " + |
| | | " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "'," + HParentID.ToString() + |
| | | ",'" + HDeptNumber + "'," + HWorkTimes + "," + HQty +",'"+ HUseFlag+ |
| | | "'," + HLevel.ToString() + "," + Convert.ToString(HEndFlag ? 1 : 0) + "," + Convert.ToString(HStopflag ? 1 : 0) + |
| | | ",'" + HRemark + "'," + HDeptID + ",'" + HBarCodeForBase + "'," + HProcID + "," + HDayMoney + "," + HUSEORGID + "," + HCREATEORGID + "" + |
| | | ",'" + HMaker + "',getdate())", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //修改上级为非末级代码 |
| | | oCN.RunProc("Update Gy_WorkCenter set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | |
| | | |
| | | //保存后控制========================================= |
| | | string sql2 = "exec h_p_Gy_WorkCenter_AfterSaveCtrl " + HMaker + ",'" + 1 + "'"; |
| | | ds = oCN.RunProcReturn(sql2, "h_p_Gy_WorkCenter_AfterSaveCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "保存失败!原因:保存后判断失败,请与网络管理人员联系"; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "保存失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | //================================================================================== |
| | | |
| | | |
| | | oCN.Commit(); |
| | | } |
| | | else |
| | | { |
| | | //若MAINDI重复则重新获取 |
| | | oCN.BeginTran(); |
| | | |
| | | //保存前控制========================================= |
| | | string sql1 = "exec h_p_Gy_WorkCenter_BeforeSaveCtrl " + HMaker + ",'" + 1 + "'"; |
| | | ds = oCN.RunProcReturn(sql1, "h_p_Gy_WorkCenter_BeforeSaveCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "保存失败!原因:保存前判断失败,请与网络管理人员联系"; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "保存失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | //================================================================================== |
| | | |
| | | oCN.RunProc("Update Gy_WorkCenter set " + |
| | | " HNumber='" + HNumber + "'" + |
| | | ",HName='" + HName + "'" + |
| | |
| | | ",HQty=" + HQty + |
| | | ",HWorkTimes=" + HWorkTimes + |
| | | ",HDayMoney=" + HDayMoney + |
| | | ",HUseFlag='" + HUseFlag + "'" + |
| | | ",HUSEORGID='" + HUSEORGID + "'" + |
| | | ",HCREATEORGID='" + HCREATEORGID + "'" + |
| | | ",HBarCodeForBase='" + HBarCodeForBase + "' Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //修改子项目代码 |
| | | //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_WorkCenter,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //将上级 为非末级 |
| | | oCN.RunProc("Update Gy_WorkCenter set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | |
| | | //保存后控制========================================= |
| | | string sql2 = "exec h_p_Gy_WorkCenter_AfterSaveCtrl " + HMaker + ",'" + 1 + "'"; |
| | | ds = oCN.RunProcReturn(sql2, "h_p_Gy_WorkCenter_AfterSaveCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "保存失败!原因:保存后判断失败,请与网络管理人员联系"; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "保存失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | //================================================================================== |
| | | |
| | | oCN.Commit(); |
| | | } |
| | |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | ///// <summary> |
| | | ///// 修改单据-保存按钮 |
| | | /////参数:string sql。 |
| | | /////返回值:object。 |
| | | ///// </summary> |
| | | //[Route("Gy_WorkCenter/EditBill")] |
| | | //[HttpPost] |
| | | //public object EditBill([FromBody] JObject oMain) |
| | | //{ |
| | | // try |
| | | // { |
| | | // var _value = oMain["oMain"].ToString(); |
| | | // string msg1 = _value.ToString(); |
| | | // //反序列化 |
| | | // msg1 = "[" + msg1.ToString() + "]"; |
| | | // DAL.ClsGy_WorkCenter_Ctl oDept = new DAL.ClsGy_WorkCenter_Ctl(); |
| | | // List<Gy_WorkCenter> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Gy_WorkCenter>>(msg1); |
| | | |
| | | //long HItemID = list[0].HItemID; |
| | | //string HNumber = list[0].HNumber; |
| | | //string HName = list[0].HName; |
| | | //string HShortNumber = list[0].HNumber; |
| | | //long HParentID = list[0].HParentID; |
| | | //string HHelpCode = list[0].HHelpCode; |
| | | //string HRemark = list[0].HRemark; |
| | | //string HStopflag = list[0].HStopflag; |
| | | //string HUseFlag = list[0].HUseFlag; |
| | | //var HQty = list[0].HQty; |
| | | //var HBarCodeForBase = list[0].HBarCodeForBase; |
| | | //var HDayMoney = list[0].HDayMoney; |
| | | //var HDeptID = list[0].HDeptID; |
| | | //var HWorkTimes = list[0].HWorkTimes; |
| | | |
| | | // //判断权限 |
| | | // //if (!ClsPub.Security_Log(msg5, 1, false, msg4)) |
| | | // //{ |
| | | // // objJsonResult.code = "0"; |
| | | // // objJsonResult.count = 0; |
| | | // // objJsonResult.Message = "没有找到该功能模块!"; |
| | | // // objJsonResult.data = null; |
| | | // // return objJsonResult; |
| | | // //} |
| | | // //if (!DBUtility.ClsPub.AllowNumber(HNumber)) |
| | | // //{ |
| | | // // objJsonResult.code = "0"; |
| | | // // objJsonResult.count = 0; |
| | | // // objJsonResult.Message = "代码中不能出现连续‘.’并且首位末位不能为‘.’!"; |
| | | // // objJsonResult.data = null; |
| | | // // return objJsonResult; |
| | | // //} |
| | | // //if (oDept.HavSameNumber(HItemID, HNumber)) |
| | | // //{ |
| | | // // objJsonResult.code = "0"; |
| | | // // objJsonResult.count = 0; |
| | | // // objJsonResult.Message = "代码重复!"; |
| | | // // objJsonResult.data = null; |
| | | // // return objJsonResult; |
| | | // //} |
| | | // //若MAINDI重复则重新获取 |
| | | // oCN.BeginTran(); |
| | | // //主表 |
| | | // oCN.RunProc("Update Gy_WorkCenter set " + |
| | | // " HNumber='" + HNumber + "'" + |
| | | // ",HName='" + HName + "'" + |
| | | // ",HShortNumber='" + HShortNumber + "'" + |
| | | // ",HHelpCode='" + HHelpCode + "'" + |
| | | // ",HParentID=" + HParentID + |
| | | // ",HStopflag='" + HStopflag + "'" + |
| | | // ",HRemark= '" + HRemark + "'"+ |
| | | // ",HDeptID=" + HDeptID + |
| | | // ",HQty=" + HQty + |
| | | // ",HWorkTimes=" + HWorkTimes + |
| | | // ",HBarCodeForBase='" + HBarCodeForBase + "' Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | // //修改子项目代码 |
| | | // //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_WorkCenter,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | // //将上级 为非末级 |
| | | // oCN.RunProc("Update Gy_WorkCenter set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | // // |
| | | // oCN.Commit(); |
| | | // objJsonResult.code = "1"; |
| | | // objJsonResult.count = 1; |
| | | // objJsonResult.Message = "修改单据成功!"; |
| | | // //objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | // } |
| | | // catch (Exception e) |
| | | // { |
| | | // oCN.RollBack(); |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "Exception!" + e.Message; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | // } |
| | | //} |
| | | |
| | | /// <summary> |
| | | /// 工作中心删除功能 |
| | | /// </summary> |
| | |
| | | objJsonResult.Message = "已经审核不能删除!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; ; |
| | | } |
| | | //var HStopflag = Convert.ToBoolean(ds.Tables[0].Rows[0]["HStopflag"]); |
| | | //if (HStopflag) |
| | | //{ |
| | | // oCN.RollBack();//回滚事务 |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "数据已删除无法再次删除!"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | } |
| | | ds1 = oCN.RunProcReturn("Select HItemID from Gy_WorkCenter Where HParentID='" + HItemID + "'", " Gy_WorkCenter"); |
| | | if (ds1.Tables[0].Rows.Count != 0) |
| | | { |
| | |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //删除前控制========================================= |
| | | string sql1 = "exec h_p_Gy_WorkCenter_BeforeDelCtrl " + HItemID + ",'" + user + "'"; |
| | | ds = oCN.RunProcReturn(sql1, "h_p_Gy_WorkCenter_BeforeDelCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "删除失败!原因:删除前判断失败,请与网络管理人员联系"; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "删除失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | //================================================================================== |
| | | |
| | | |
| | | oCN.RunProc("delete from Gy_WorkCenter where HItemID=" + HItemID); |
| | | |
| | | |
| | | //删除后控制========================================= |
| | | string sql2 = "exec h_p_Gy_WorkCenter_AfterDelCtrl " + HItemID + ",'" + user + "'"; |
| | | ds = oCN.RunProcReturn(sql2, "h_p_Gy_WorkCenter_AfterDelCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "删除失败!原因:删除后判断失败,请与网络管理人员联系"; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "删除失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | //================================================================================== |
| | | |
| | | oCN.Commit();//提交事务 |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 工作中心列表修改按钮方法 |
| | | ///参数:string sql。 |
| | | ///返回值:object。 |
| | | /// </summary> |
| | | [Route("Gy_WorkCenter/xg")] |
| | | [HttpGet] |
| | |
| | | |
| | | if (IsAudit == 0) //审核判断 |
| | | { |
| | | //审核前控制========================================= |
| | | string sql1 = "exec h_p_Gy_WorkCenter_BeforeCheckCtrl " + HInterID + ",'" + CurUserName + "'"; |
| | | ds = oCN.RunProcReturn(sql1, "h_p_Gy_WorkCenter_BeforeCheckCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "审核失败!原因:审核前判断失败,请与网络管理人员联系"; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | //================================================================================== |
| | | |
| | | |
| | | oCN.RunProc("update Gy_WorkCenter set HCheckEmp='" + CurUserName + "',HCheckTime=getdate() where HItemID=" + HInterID); |
| | | |
| | | |
| | | //审核后控制========================================= |
| | | string sql2 = "exec h_p_Gy_WorkCenter_AfterCheckCtrl " + HInterID + ",'" + CurUserName + "'"; |
| | | ds = oCN.RunProcReturn(sql2, "h_p_Gy_WorkCenter_AfterCheckCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "审核失败!原因:审核后判断失败,请与网络管理人员联系"; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | //================================================================================== |
| | | |
| | | |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | |
| | | } |
| | | if (IsAudit == 1) //反审核判断 |
| | | { |
| | | |
| | | //反审核前控制========================================= |
| | | string sql1 = "exec h_p_Gy_WorkCenter_BeforeUnCheckCtrl " + HInterID + ",'" + CurUserName + "'"; |
| | | ds = oCN.RunProcReturn(sql1, "h_p_Gy_WorkCenter_BeforeCheckCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "反审核失败!原因:反审核前判断失败,请与网络管理人员联系"; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "反审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | //================================================================================== |
| | | |
| | | |
| | | |
| | | oCN.RunProc("update Gy_WorkCenter set HCheckEmp='',HCheckTime=null where HItemID=" + HInterID); |
| | | |
| | | |
| | | //反审核后控制========================================= |
| | | string sql2 = "exec h_p_Gy_WorkCenter_AfterUnCheckCtrl " + HInterID + ",'" + CurUserName + "'"; |
| | | ds = oCN.RunProcReturn(sql2, "h_p_Gy_WorkCenter_AfterCheckCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "反审核失败!原因:反审核后判断失败,请与网络管理人员联系"; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "反审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | //================================================================================== |
| | | |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | |
| | | |
| | | if (IsStop == 0) //禁用判断 |
| | | { |
| | | //禁用前控制========================================= |
| | | string sql1 = "exec h_p_Gy_WorkCenter_BeforeStopCtrl " + HInterID + ",'" + CurUserName + "'"; |
| | | ds = oCN.RunProcReturn(sql1, "h_p_Gy_WorkCenter_BeforeStopCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "禁用失败!原因:禁用前判断失败,请与网络管理人员联系"; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "禁用失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | //================================================================================== |
| | | |
| | | |
| | | oCN.RunProc("update Gy_WorkCenter set HStopEmp='" + CurUserName + "',HStopTime=getdate(),HStopflag=1 where HItemID=" + HInterID); |
| | | |
| | | |
| | | //禁用后控制========================================= |
| | | string sql2 = "exec h_p_Gy_WorkCenter_AfterStopCtrl " + HInterID + ",'" + CurUserName + "'"; |
| | | ds = oCN.RunProcReturn(sql2, "h_p_Gy_WorkCenter_AfterStopCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "禁用失败!原因:禁用后判断失败,请与网络管理人员联系"; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "禁用失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | //================================================================================== |
| | | |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | |
| | | } |
| | | if (IsStop == 1) //反禁用判断 |
| | | { |
| | | //反禁用前控制========================================= |
| | | string sql1 = "exec h_p_Gy_WorkCenter_BeforeUnStopCtrl " + HInterID + ",'" + CurUserName + "'"; |
| | | ds = oCN.RunProcReturn(sql1, "h_p_Gy_WorkCenter_BeforeUnStopCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "反禁用失败!原因:反禁用前判断失败,请与网络管理人员联系"; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "反禁用失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | //================================================================================== |
| | | |
| | | |
| | | oCN.RunProc("update Gy_WorkCenter set HStopEmp='',HStopTime=null,HStopflag=0 where HItemID=" + HInterID); |
| | | |
| | | |
| | | //反禁用后控制========================================= |
| | | string sql2 = "exec h_p_Gy_WorkCenter_AfterUnStopCtrl " + HInterID + ",'" + CurUserName + "'"; |
| | | ds = oCN.RunProcReturn(sql2, "h_p_Gy_WorkCenter_AfterUnStopCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "反禁用失败!原因:反禁用后判断失败,请与网络管理人员联系"; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "反禁用失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | //================================================================================== |
| | | |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "反禁用成功"; |