1
wtt
2024-08-16 b2910c43e8204c411f638349e610be95060290ef
WebAPI/Controllers/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/Gy_SOPBillListController.cs
@@ -82,6 +82,71 @@
            }
        }
        #endregion
        /// <summary>
        /// ä½œä¸šæŒ‡å¯¼ä¹¦åˆ é™¤
        /// </summary>
        /// <returns></returns>
        [Route("Gy_SOPBill/Del")]
        [HttpGet]
        public object Del(string hmainid, string hsubid, string user)
        {
            DataSet ds;
            try
            {
                //删除权限
                if (!DBUtility.ClsPub.Security_Log("Gy_SOPBill_Drop", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无删除权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                if (string.IsNullOrWhiteSpace(hmainid))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "资料内码为空!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.BeginTran();//开始事务
                ds = oCN.RunProcReturn("select * from Gy_SOPBillSub where HInterID=" + hmainid + " and HEntryID=" + hsubid, "Gy_SOPBillSub");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    oCN.RollBack();
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有数据,无法删除!";
                    objJsonResult.data = null;
                    return objJsonResult; ;
                }
                oCN.RunProc("delete Gy_SOPBillSub where HInterID=" + hmainid + " and HEntryID=" + hsubid);
                oCN.RunProc("delete Gy_SOPBillSub2 where HInterID=" + hmainid + " and HEntryID=" + hsubid);
                oCN.Commit();//提交事务
                objJsonResult.code = "0";
                objJsonResult.count = 1;
                objJsonResult.Message = "作业指导书删除成功!";
                objJsonResult.data = null;
                return objJsonResult; ;
            }
            catch (Exception e)
            {
                oCN.RollBack();
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "删除失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #region å¼•出
        [Route("Gy_SOPBill/SetExcel")]
        [HttpGet]
@@ -207,7 +272,6 @@
            return response;
        }
        #endregion
        //
        private Int32 Fun_GetCol(string sCol)