WebAPI/Controllers/BaseSet/Gy_BadReasonController.cs
@@ -21,11 +21,9 @@
        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
        DataSet ds;
        #region 不良原因 查询,审核,反审核,禁用,反禁用
        /// <summary>
        /// 返回不良原因列表
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("Gy_BadReason/list")]
        [HttpGet]
@@ -35,7 +33,7 @@
            {
                List<object> columnNameList = new List<object>();
                //查看权限
                if (!DBUtility.ClsPub.Security_Log("Gy_BadReason", 1, false, user))
                if (!DBUtility.ClsPub.Security_Log("Gy_BadReason_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
@@ -157,7 +155,58 @@
                if (IsAudit == 0)  //审核判断
                {
                    //审核前控制=========================================
                    string sql1 = "exec h_p_Gy_BadReason_BeforeCheckCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_BadReason_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_BadReason set HCheckEmp='" + CurUserName + "',HCheckTime=getdate() where HItemID=" + HInterID);
                    //审核后控制=========================================
                    string sql2 = "exec h_p_Gy_BadReason_AfterCheckCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql2, "h_p_Gy_BadReason_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;
@@ -166,7 +215,61 @@
                }
                if (IsAudit == 1) //反审核判断
                {
                    //反审核前控制=========================================
                    string sql1 = "exec h_p_Gy_BadReason_BeforeUnCheckCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_BadReason_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_BadReason set HCheckEmp='',HCheckTime=null where HItemID=" + HInterID);
                    //反审核后控制=========================================
                    string sql2 = "exec h_p_Gy_BadReason_AfterUnCheckCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql2, "h_p_Gy_BadReason_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;
@@ -252,7 +355,58 @@
                if (IsStop == 0)  //禁用判断
                {
                    //禁用前控制=========================================
                    string sql1 = "exec h_p_Gy_BadReason_BeforeStopCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_BadReason_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_BadReason set HStopEmp='" + CurUserName + "',HStopTime=getdate(),HStopflag=1 where HItemID=" + HInterID);
                    //禁用后控制=========================================
                    string sql2 = "exec h_p_Gy_BadReason_AfterStopCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql2, "h_p_Gy_BadReason_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;
@@ -261,7 +415,58 @@
                }
                if (IsStop == 1) //反禁用判断
                {
                    //反禁用前控制=========================================
                    string sql1 = "exec h_p_Gy_BadReason_BeforeUnStopCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_BadReason_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_BadReason set HStopEmp='',HStopTime=null,HStopflag=0 where HItemID=" + HInterID);
                    //反禁用后控制=========================================
                    string sql2 = "exec h_p_Gy_BadReason_AfterUnStopCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql2, "h_p_Gy_BadReason_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;
@@ -284,52 +489,10 @@
        }
        #endregion
        #endregion
        #region 不良类型  查询
        [Route("Gy_BadReason/Gy_BadTypeList")]
        [HttpGet]
        public object Gy_BadTypeList(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                //查看权限
                if (!DBUtility.ClsPub.Security_Log("Gy_BadType_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查看权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                string sql1 = "select * from h_v_gy_BadTypeList where 1 = 1";
                string sql = sql1 + sWhere + " order by 不良类型代码 ";
                ds = oCN.RunProcReturn(sql, "h_v_gy_BadTypeList");
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
                {
                    Type dataType = col.DataType;
                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
@@ -448,7 +611,56 @@
                if (IsAudit == 0)  //审核判断
                {
                    //审核前控制=========================================
                    string sql1 = "exec h_p_Gy_BadResult_BeforeCheckCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_BadResult_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_BadResult set HCheckEmp='" + CurUserName + "',HCheckTime=getdate() where HItemID=" + HInterID);
                    //审核后控制=========================================
                    string sql2 = "exec h_p_Gy_BadResult_AfterCheckCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql2, "h_p_Gy_BadResult_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;
@@ -457,7 +669,58 @@
                }
                if (IsAudit == 1) //反审核判断
                {
                    //反审核前控制=========================================
                    string sql1 = "exec h_p_Gy_BadResult_BeforeUnCheckCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_BadResult_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_BadResult set HCheckEmp='',HCheckTime=null where HItemID=" + HInterID);
                    //反审核后控制=========================================
                    string sql2 = "exec h_p_Gy_BadResult_AfterUnCheckCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql2, "h_p_Gy_BadResult_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;
@@ -543,7 +806,56 @@
                if (IsStop == 0)  //禁用判断
                {
                    //禁用前控制=========================================
                    string sql1 = "exec h_p_Gy_BadResult_BeforeStopCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_BadResult_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_BadResult set HStopEmp='" + CurUserName + "',HStopTime=getdate(),HStopflag=1 where HItemID=" + HInterID);
                    //禁用后控制=========================================
                    string sql2 = "exec h_p_Gy_BadResult_AfterStopCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql2, "h_p_Gy_BadResult_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;
@@ -552,7 +864,56 @@
                }
                if (IsStop == 1) //反禁用判断
                {
                    //反禁用前控制=========================================
                    string sql1 = "exec h_p_Gy_BadResult_BeforeUnStopCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_BadResult_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_BadResult set HStopEmp='',HStopTime=null,HStopflag=0 where HItemID=" + HInterID);
                    //反禁用后控制=========================================
                    string sql2 = "exec h_p_Gy_BadResult_AfterUnStopCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql2, "h_p_Gy_BadResult_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;
@@ -1681,9 +2042,61 @@
        #endregion
        #region 不良类型审核、反审核
        #region 不良类型 查询,审核、反审核,禁用,反禁用
        /// <summary>
        ///
        /// 不良类型  查询
        /// </summary>
        /// <param name="sWhere"></param>
        /// <param name="user"></param>
        /// <returns></returns>
        [Route("Gy_BadReason/Gy_BadTypeList")]
        [HttpGet]
        public object Gy_BadTypeList(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                //查看权限
                if (!DBUtility.ClsPub.Security_Log("Gy_BadType_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查看权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                string sql1 = "select * from h_v_gy_BadTypeList where 1 = 1";
                string sql = sql1 + sWhere + " order by 不良类型代码 ";
                ds = oCN.RunProcReturn(sql, "h_v_gy_BadTypeList");
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
                {
                    Type dataType = col.DataType;
                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        /// <summary>
        /// 不良类型 审核、反审核
        /// </summary>
        /// <param name="HInterID">单据ID</param>
        /// <param name="IsAudit">审核(0),反审核(1)</param>
@@ -1744,7 +2157,56 @@
                if (IsAudit == 0)  //审核判断
                {
                    //审核前控制=========================================
                    string sql1 = "exec h_p_Gy_BadType_BeforeCheckCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_BadType_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_BadType set HCheckEmp='" + CurUserName + "',HCheckTime=getdate() where HItemID=" + HInterID);
                    //审核后控制=========================================
                    string sql2 = "exec h_p_Gy_BadType_AfterCheckCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql2, "h_p_Gy_BadType_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;
@@ -1753,7 +2215,58 @@
                }
                if (IsAudit == 1) //反审核判断
                {
                    //反审核前控制=========================================
                    string sql1 = "exec h_p_Gy_BadType_BeforeUnCheckCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_BadType_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_BadType set HCheckEmp='',HCheckTime=null where HItemID=" + HInterID);
                    //反审核后控制=========================================
                    string sql2 = "exec h_p_Gy_BadType_AfterUnCheckCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql2, "h_p_Gy_BadType_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;
@@ -1774,11 +2287,9 @@
                return objJsonResult;
            }
        }
        #endregion
        #region 不良类型禁用、反禁用
        /// <summary>
        ///
        /// 不良类型 禁用、反禁用
        /// </summary>
        /// <param name="HInterID">单据ID</param>
        /// <param name="IsStop">禁用(0),反禁用(1)</param>
@@ -1839,7 +2350,57 @@
                if (IsStop == 0)  //禁用判断
                {
                    //禁用前控制=========================================
                    string sql1 = "exec h_p_Gy_BadType_BeforeStopCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_BadType_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_BadType set HStopEmp='" + CurUserName + "',HStopTime=getdate(),HStopflag=1 where HItemID=" + HInterID);
                    //禁用后控制=========================================
                    string sql2 = "exec h_p_Gy_BadType_AfterStopCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql2, "h_p_Gy_BadType_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;
@@ -1848,7 +2409,57 @@
                }
                if (IsStop == 1) //反禁用判断
                {
                    //反禁用前控制=========================================
                    string sql1 = "exec h_p_Gy_BadType_BeforeUnStopCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_BadType_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_BadType set HStopEmp='',HStopTime=null,HStopflag=0 where HItemID=" + HInterID);
                    //反禁用后控制=========================================
                    string sql2 = "exec h_p_Gy_BadType_AfterUnStopCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql2, "h_p_Gy_BadType_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;
@@ -2646,7 +3257,57 @@
                if (IsAudit == 0)  //审核判断
                {
                    //审核前控制=========================================
                    string sql1 = "exec h_p_Gy_PostSkill_BeforeCheckCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_PostSkill_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_PostSkill set HCheckEmp='" + CurUserName + "',HCheckTime=getdate() where HItemID=" + HInterID);
                    //审核后控制=========================================
                    string sql2 = "exec h_p_Gy_PostSkill_AfterCheckCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql2, "h_p_Gy_PostSkill_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;
@@ -2655,7 +3316,58 @@
                }
                if (IsAudit == 1) //反审核判断
                {
                    //反审核前控制=========================================
                    string sql1 = "exec h_p_Gy_PostSkill_BeforeUnCheckCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_PostSkill_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_PostSkill set HCheckEmp='',HCheckTime=null where HItemID=" + HInterID);
                    //反审核后控制=========================================
                    string sql2 = "exec h_p_Gy_PostSkill_AfterUnCheckCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql2, "h_p_Gy_PostSkill_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;
@@ -2741,7 +3453,57 @@
                if (IsStop == 0)  //禁用判断
                {
                    //禁用前控制=========================================
                    string sql1 = "exec h_p_Gy_PostSkill_BeforeStopCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_PostSkill_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_PostSkill set HStopEmp='" + CurUserName + "',HStopTime=getdate(),HStopflag=1 where HItemID=" + HInterID);
                    //禁用后控制=========================================
                    string sql2 = "exec h_p_Gy_PostSkill_AfterStopCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql2, "h_p_Gy_PostSkill_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;
@@ -2750,7 +3512,57 @@
                }
                if (IsStop == 1) //反禁用判断
                {
                    //反禁用前控制=========================================
                    string sql1 = "exec h_p_Gy_PostSkill_BeforeUnStopCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_PostSkill_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_PostSkill set HStopEmp='',HStopTime=null,HStopflag=0 where HItemID=" + HInterID);
                    //反禁用后控制=========================================
                    string sql2 = "exec h_p_Gy_PostSkill_AfterUnStopCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql2, "h_p_Gy_PostSkill_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;
@@ -2888,7 +3700,57 @@
                if (IsAudit == 0)  //审核判断
                {
                    //审核前控制=========================================
                    string sql1 = "exec h_p_Gy_Post_BeforeCheckCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_Post_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_Post set HCheckEmp='" + CurUserName + "',HCheckTime=getdate() where HItemID=" + HInterID);
                    //审核后控制=========================================
                    string sql2 = "exec h_p_Gy_Post_AfterCheckCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql2, "h_p_Gy_Post_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;
@@ -2897,7 +3759,58 @@
                }
                if (IsAudit == 1) //反审核判断
                {
                    //反审核前控制=========================================
                    string sql1 = "exec h_p_Gy_Post_BeforeUnCheckCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_Post_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_Post set HCheckEmp='',HCheckTime=null where HItemID=" + HInterID);
                    //反审核后控制=========================================
                    string sql2 = "exec h_p_Gy_Post_AfterUnCheckCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql2, "h_p_Gy_Post_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;
@@ -2983,7 +3896,56 @@
                if (IsStop == 0)  //禁用判断
                {
                    //禁用前控制=========================================
                    string sql1 = "exec h_p_Gy_Post_BeforeStopCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_Post_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_Post set HStopEmp='" + CurUserName + "',HStopTime=getdate(),HStopflag=1 where HItemID=" + HInterID);
                    //禁用后控制=========================================
                    string sql2 = "exec h_p_Gy_Post_AfterStopCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql2, "h_p_Gy_Post_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;
@@ -2992,7 +3954,56 @@
                }
                if (IsStop == 1) //反禁用判断
                {
                    //反禁用前控制=========================================
                    string sql1 = "exec h_p_Gy_Post_BeforeUnStopCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_Post_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_Post set HStopEmp='',HStopTime=null,HStopflag=0 where HItemID=" + HInterID);
                    //反禁用后控制=========================================
                    string sql2 = "exec h_p_Gy_Post_AfterUnStopCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql2, "h_p_Gy_Post_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;
@@ -4711,7 +5722,7 @@
        #region  工艺参数分类  查询,审核,反审核,禁用,反禁用
        /// <summary> 
        /// 供应商分类  查询
        /// 工艺参数分类  查询
        /// </summary>
        /// <param name="sWhere"></param>
        /// <param name="user"></param>
@@ -4763,20 +5774,216 @@
        }
        /// <summary>
        /// 供应商分类 禁用、反禁用
        /// 工艺参数分类审核、反审核
        /// </summary>
        /// <param name="HInterID">单据ID</param>
        /// <param name="IsAudit">审核(0),反审核(1)</param>
        /// <param name="CurUserName">审核人</param>
        /// <returns></returns>
        [Route("Gy_BadReason/AuditGy_TechnologyParameterClass")]
        [HttpGet]
        public object AuditGy_TechnologyParameterClass(int HInterID, int IsAudit, string CurUserName)
        {
            try
            {
                //审核权限
                if (!DBUtility.ClsPub.Security_Log_second("Gy_Technology_Check", 1, false, CurUserName))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "审核失败!无权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                var ds = oCN.RunProcReturn("select * from Gy_TechnologyParameterClass where HItemID=" + HInterID, "Gy_TechnologyParameterClass");
                if (ds.Tables[0].Rows.Count > 0)
                {
                    if (IsAudit == 0)  //审核判断
                    {
                        if (ds.Tables[0].Rows[0]["HCheckEmp"].ToString() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已审核!不能再次审核!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                    if (IsAudit == 1) //反审核判断
                    {
                        if (ds.Tables[0].Rows[0]["HCheckEmp"].ToString() == "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据未审核!不需要反审核!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据不存在!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.BeginTran();
                if (IsAudit == 0)  //审核判断
                {
                    //审核前控制=========================================
                    string sql1 = "exec h_p_Gy_TechnologyParameterClass_BeforeCheckCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_TechnologyParameterClass_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_TechnologyParameterClass set HCheckEmp='" + CurUserName + "',HCheckTime=getdate() where HItemID=" + HInterID);
                    //审核后控制=========================================
                    string sql2 = "exec h_p_Gy_TechnologyParameterClass_AfterCheckCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql2, "h_p_Gy_TechnologyParameterClass_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;
                    objJsonResult.Message = "审核成功";
                    objJsonResult.data = null;
                }
                if (IsAudit == 1) //反审核判断
                {
                    //反审核前控制=========================================
                    string sql1 = "exec h_p_Gy_TechnologyParameterClass_BeforeUnCheckCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_TechnologyParameterClass_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_TechnologyParameterClass set HCheckEmp='',HCheckTime=null where HItemID=" + HInterID);
                    //反审核后控制=========================================
                    string sql2 = "exec h_p_Gy_TechnologyParameterClass_AfterUnCheckCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql2, "h_p_Gy_TechnologyParameterClass_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;
                    objJsonResult.Message = "反审核成功";
                    objJsonResult.data = null;
                }
                oCN.Commit();
                return objJsonResult;
            }
            catch (Exception e)
            {
                oCN.RollBack();
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "审核失败或者反审核失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        /// <summary>
        /// 工艺参数分类禁用、反禁用
        /// </summary>
        /// <param name="HInterID">单据ID</param>
        /// <param name="IsStop">禁用(0),反禁用(1)</param>
        /// <param name="CurUserName">审核人</param>
        /// <returns></returns>
        [Route("Gy_BadReason/StopGy_TechnologyType")]
        [Route("Gy_BadReason/StopGy_TechnologyParameterClass")]
        [HttpGet]
        public object StopGy_TechnologyType(int HInterID, int IsStop, string CurUserName)
        public object StopGy_TechnologyParameterClass(int HInterID, int IsStop, string CurUserName)
        {
            try
            {
                //审核权限
                if (!DBUtility.ClsPub.Security_Log_second("Gy_TechnologyType_Close", 1, false, CurUserName))
                if (!DBUtility.ClsPub.Security_Log_second("Gy_Technology_Stop", 1, false, CurUserName))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
@@ -4790,7 +5997,7 @@
                {
                    if (IsStop == 0)  //禁用判断
                    {
                        if (ds.Tables[0].Rows[0]["HStopflag"].Equals(true))
                        if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
@@ -4801,7 +6008,7 @@
                    }
                    if (IsStop == 1) //反禁用判断
                    {
                        if (ds.Tables[0].Rows[0]["HStopflag"].Equals(false))
                        if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() == "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
@@ -4824,7 +6031,58 @@
                if (IsStop == 0)  //禁用判断
                {
                    oCN.RunProc("update Gy_TechnologyParameterClass set HStopflag=1 where HItemID=" + HInterID);
                    //禁用前控制=========================================
                    string sql1 = "exec h_p_Gy_TechnologyParameterClass_BeforeStopCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_TechnologyParameterClass_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_TechnologyParameterClass set HStopEmp='" + CurUserName + "',HStopTime=getdate(),HStopflag=1 where HItemID=" + HInterID);
                    //禁用后控制=========================================
                    string sql2 = "exec h_p_Gy_TechnologyParameterClass_AfterStopCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql2, "h_p_Gy_TechnologyParameterClass_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;
@@ -4833,7 +6091,58 @@
                }
                if (IsStop == 1) //反禁用判断
                {
                    oCN.RunProc("update Gy_TechnologyParameterClass set HStopflag=0 where HItemID=" + HInterID);
                    //反禁用前控制=========================================
                    string sql1 = "exec h_p_Gy_TechnologyParameterClass_BeforeUnStopCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_TechnologyParameterClass_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_TechnologyParameterClass set HStopEmp='',HStopTime=null,HStopflag=0 where HItemID=" + HInterID);
                    //反禁用后控制=========================================
                    string sql2 = "exec h_p_Gy_TechnologyParameterClass_AfterUnStopCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql2, "h_p_Gy_TechnologyParameterClass_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;
@@ -5001,8 +6310,7 @@
                return objJsonResult;
            }
        }
        #endregion
        /// <summary>
@@ -5097,6 +6405,8 @@
                return objJsonResult;
            }
        }
        #endregion
        #region  盘点方案  查询,审核,反审核,禁用,反禁用
        /// <summary> 
@@ -6001,7 +7311,7 @@
        }
        #endregion
        #region 异常类型  查询
        #region 异常类型  查询,审核,反审核,禁用,反禁用
        [Route("Gy_BadReason/Gy_ErrTypeList")]
        [HttpGet]
        public object Gy_ErrTypeList(string sWhere, string user)
@@ -6048,11 +7358,8 @@
            }
        }
        #endregion
        #region 异常类型审核、反审核
        /// <summary>
        ///
        /// 异常类型审核、反审核
        /// </summary>
        /// <param name="HInterID">单据ID</param>
        /// <param name="IsAudit">审核(0),反审核(1)</param>
@@ -6143,11 +7450,9 @@
                return objJsonResult;
            }
        }
        #endregion
        #region 异常类型禁用、反禁用
        /// <summary>
        ///
        /// 异常类型禁用、反禁用
        /// </summary>
        /// <param name="HInterID">单据ID</param>
        /// <param name="IsStop">禁用(0),反禁用(1)</param>
@@ -6355,7 +7660,58 @@
                if (IsAudit == 0)  //审核判断
                {
                    //审核前控制=========================================
                    string sql1 = "exec h_p_Gy_BadPhenomena_BeforeCheckCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_BadPhenomena_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_BadPhenomena set HCheckEmp='" + CurUserName + "',HCheckTime=getdate() where HItemID=" + HInterID);
                    //审核后控制=========================================
                    string sql2 = "exec h_p_Gy_BadPhenomena_AfterCheckCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql2, "h_p_Gy_BadPhenomena_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;
@@ -6364,7 +7720,60 @@
                }
                if (IsAudit == 1) //反审核判断
                {
                    //反审核前控制=========================================
                    string sql1 = "exec h_p_Gy_BadPhenomena_BeforeUnCheckCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_BadPhenomena_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_BadPhenomena set HCheckEmp='',HCheckTime=null where HItemID=" + HInterID);
                    //反审核后控制=========================================
                    string sql2 = "exec h_p_Gy_BadPhenomena_AfterUnCheckCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql2, "h_p_Gy_BadPhenomena_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;
@@ -6450,7 +7859,59 @@
                if (IsStop == 0)  //禁用判断
                {
                    //禁用前控制=========================================
                    string sql1 = "exec h_p_Gy_BadPhenomena_BeforeStopCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_BadPhenomena_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_BadPhenomena set HStopEmp='" + CurUserName + "',HStopTime=getdate(),HStopflag=1 where HItemID=" + HInterID);
                    //禁用后控制=========================================
                    string sql2 = "exec h_p_Gy_BadPhenomena_AfterStopCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql2, "h_p_Gy_BadPhenomena_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;
@@ -6459,8 +7920,60 @@
                }
                if (IsStop == 1) //反禁用判断
                {
                    //反禁用前控制=========================================
                    string sql1 = "exec h_p_Gy_BadPhenomena_BeforeUnStopCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_BadPhenomena_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_BadPhenomena set HStopEmp='',HStopTime=null,HStopflag=0 where HItemID=" + HInterID);
                    //反禁用后控制=========================================
                    string sql2 = "exec h_p_Gy_BadPhenomena_AfterUnStopCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql2, "h_p_Gy_BadPhenomena_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 = "反禁用成功";
@@ -7081,7 +8594,57 @@
                if (IsAudit == 0)  //审核判断
                {
                    //审核前控制=========================================
                    string sql1 = "exec h_p_Gy_PreventErrMould_BeforeCheckCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_PreventErrMould_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_PreventErrMould set HCheckEmp='" + CurUserName + "',HCheckTime=getdate() where HItemID=" + HInterID);
                    //审核后控制=========================================
                    string sql2 = "exec h_p_Gy_PreventErrMould_AfterCheckCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql2, "h_p_Gy_PreventErrMould_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;
@@ -7090,7 +8653,60 @@
                }
                if (IsAudit == 1) //反审核判断
                {
                    //反审核前控制=========================================
                    string sql1 = "exec h_p_Gy_PreventErrMould_BeforeUnCheckCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_PreventErrMould_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_PreventErrMould set HCheckEmp='',HCheckTime=null where HItemID=" + HInterID);
                    //反审核后控制=========================================
                    string sql2 = "exec h_p_Gy_PreventErrMould_AfterUnCheckCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql2, "h_p_Gy_PreventErrMould_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;
@@ -7176,7 +8792,58 @@
                if (IsStop == 0)  //禁用判断
                {
                    //禁用前控制=========================================
                    string sql1 = "exec h_p_Gy_PreventErrMould_BeforeStopCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_PreventErrMould_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_PreventErrMould set HStopEmp='" + CurUserName + "',HStopTime=getdate(),HStopflag=1 where HItemID=" + HInterID);
                    //禁用后控制=========================================
                    string sql2 = "exec h_p_Gy_PreventErrMould_AfterStopCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql2, "h_p_Gy_PreventErrMould_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;
@@ -7185,7 +8852,58 @@
                }
                if (IsStop == 1) //反禁用判断
                {
                    //反禁用前控制=========================================
                    string sql1 = "exec h_p_Gy_PreventErrMould_BeforeUnStopCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_PreventErrMould_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_PreventErrMould set HStopEmp='',HStopTime=null,HStopflag=0 where HItemID=" + HInterID);
                    //反禁用后控制=========================================
                    string sql2 = "exec h_p_Gy_PreventErrMould_AfterUnStopCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql2, "h_p_Gy_PreventErrMould_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;
@@ -7323,7 +9041,59 @@
                if (IsAudit == 0)  //审核判断
                {
                    //审核前控制=========================================
                    string sql1 = "exec h_p_Gy_MaintainLev_BeforeCheckCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_MaintainLev_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_MaintainLev set HCheckEmp='" + CurUserName + "',HCheckTime=getdate() where HItemID=" + HInterID);
                    //审核后控制=========================================
                    string sql2 = "exec h_p_Gy_MaintainLev_AfterCheckCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql2, "h_p_Gy_MaintainLev_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;
@@ -7332,7 +9102,61 @@
                }
                if (IsAudit == 1) //反审核判断
                {
                    //反审核前控制=========================================
                    string sql1 = "exec h_p_Gy_MaintainLev_BeforeUnCheckCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_MaintainLev_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_MaintainLev set HCheckEmp='',HCheckTime=null where HItemID=" + HInterID);
                    //反审核后控制=========================================
                    string sql2 = "exec h_p_Gy_MaintainLev_AfterUnCheckCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql2, "h_p_Gy_MaintainLev_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;
@@ -7418,7 +9242,60 @@
                if (IsStop == 0)  //禁用判断
                {
                    //禁用前控制=========================================
                    string sql1 = "exec h_p_Gy_MaintainLev_BeforeStopCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_MaintainLev_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_MaintainLev set HStopEmp='" + CurUserName + "',HStopTime=getdate(),HStopflag=1 where HItemID=" + HInterID);
                    //禁用后控制=========================================
                    string sql2 = "exec h_p_Gy_MaintainLev_AfterStopCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql2, "h_p_Gy_MaintainLev_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;
@@ -7427,7 +9304,58 @@
                }
                if (IsStop == 1) //反禁用判断
                {
                    //反禁用前控制=========================================
                    string sql1 = "exec h_p_Gy_MaintainLev_BeforeUnStopCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_MaintainLev_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_MaintainLev set HStopEmp='',HStopTime=null,HStopflag=0 where HItemID=" + HInterID);
                    //反禁用后控制=========================================
                    string sql2 = "exec h_p_Gy_MaintainLev_AfterUnStopCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql2, "h_p_Gy_MaintainLev_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;
@@ -7565,8 +9493,58 @@
                if (IsAudit == 0)  //审核判断
                {
                    //审核前控制=========================================
                    string sql1 = "exec h_p_Gy_CheckNoteItem_BeforeCheckCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_CheckNoteItem_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_CheckNoteItem set HCheckEmp='" + CurUserName + "',HCheckTime=getdate() where HItemID=" + HInterID);
                    //审核后控制=========================================
                    string sql2 = "exec h_p_Gy_CheckNoteItem_AfterCheckCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql2, "h_p_Gy_CheckNoteItem_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;
                    objJsonResult.Message = "审核成功";
@@ -7574,7 +9552,59 @@
                }
                if (IsAudit == 1) //反审核判断
                {
                    //反审核前控制=========================================
                    string sql1 = "exec h_p_Gy_CheckNoteItem_BeforeUnCheckCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_CheckNoteItem_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_CheckNoteItem set HCheckEmp='',HCheckTime=null where HItemID=" + HInterID);
                    //反审核后控制=========================================
                    string sql2 = "exec h_p_Gy_CheckNoteItem_AfterUnCheckCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql2, "h_p_Gy_CheckNoteItem_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;
@@ -7660,7 +9690,58 @@
                if (IsStop == 0)  //禁用判断
                {
                    //禁用前控制=========================================
                    string sql1 = "exec h_p_Gy_CheckNoteItem_BeforeStopCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_CheckNoteItem_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_CheckNoteItem set HStopEmp='" + CurUserName + "',HStopTime=getdate(),HStopflag=1 where HItemID=" + HInterID);
                    //禁用后控制=========================================
                    string sql2 = "exec h_p_Gy_CheckNoteItem_AfterStopCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql2, "h_p_Gy_CheckNoteItem_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;
@@ -7669,7 +9750,57 @@
                }
                if (IsStop == 1) //反禁用判断
                {
                    //反禁用前控制=========================================
                    string sql1 = "exec h_p_Gy_CheckNoteItem_BeforeUnStopCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_CheckNoteItem_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_CheckNoteItem set HStopEmp='',HStopTime=null,HStopflag=0 where HItemID=" + HInterID);
                    //反禁用后控制=========================================
                    string sql2 = "exec h_p_Gy_CheckNoteItem_AfterUnStopCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql2, "h_p_Gy_CheckNoteItem_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;
@@ -8049,7 +10180,58 @@
                if (IsAudit == 0)  //审核判断
                {
                    //审核前控制=========================================
                    string sql1 = "exec h_p_Gy_EnvironmentTestItem_BeforeCheckCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_EnvironmentTestItem_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_EnvironmentTestItem set HCheckEmp='" + CurUserName + "',HCheckTime=getdate() where HItemID=" + HInterID);
                    //审核后控制=========================================
                    string sql2 = "exec h_p_Gy_EnvironmentTestItem_AfterCheckCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql2, "h_p_Gy_EnvironmentTestItem_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;
@@ -8058,7 +10240,57 @@
                }
                if (IsAudit == 1) //反审核判断
                {
                    //反审核前控制=========================================
                    string sql1 = "exec h_p_Gy_EnvironmentTestItem_BeforeUnCheckCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_EnvironmentTestItem_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_EnvironmentTestItem set HCheckEmp='',HCheckTime=null where HItemID=" + HInterID);
                    //反审核后控制=========================================
                    string sql2 = "exec h_p_Gy_EnvironmentTestItem_AfterUnCheckCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql2, "h_p_Gy_EnvironmentTestItem_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;
@@ -8144,7 +10376,58 @@
                if (IsStop == 0)  //禁用判断
                {
                    //禁用前控制=========================================
                    string sql1 = "exec h_p_Gy_EnvironmentTestItem_BeforeStopCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_EnvironmentTestItem_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_EnvironmentTestItem set HStopEmp='" + CurUserName + "',HStopTime=getdate(),HStopflag=1 where HItemID=" + HInterID);
                    //禁用后控制=========================================
                    string sql2 = "exec h_p_Gy_EnvironmentTestItem_AfterStopCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql2, "h_p_Gy_EnvironmentTestItem_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;
@@ -8153,8 +10436,59 @@
                }
                if (IsStop == 1) //反禁用判断
                {
                    //反禁用前控制=========================================
                    string sql1 = "exec h_p_Gy_EnvironmentTestItem_BeforeUnStopCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_EnvironmentTestItem_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_EnvironmentTestItem set HStopEmp='',HStopTime=null,HStopflag=0 where HItemID=" + HInterID);
                    //反禁用后控制=========================================
                    string sql2 = "exec h_p_Gy_EnvironmentTestItem_AfterUnStopCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql2, "h_p_Gy_EnvironmentTestItem_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 = "反禁用成功";