ch
2022-01-14 15ed2f3df5a7899f6123ff254b8887dd03958513
WebAPI/Controllers/Sc_MouldRepairSendWorkBillController.cs
@@ -20,6 +20,7 @@
        private json objJsonResult = new json();
        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
        DataSet ds;
        DLL.ClsSb_MouldRepairWorkBill oBill = new DLL.ClsSb_MouldRepairWorkBill();
        #region 器具维修派工单查询
        [Route("Sc_MouldRepairSendWorkBill/GetMouldRepairSendWorkBillList")]
@@ -219,5 +220,67 @@
        }
        #endregion
        #region 器具维修派工单 删除
        [Route("Sc_MouldRepairSendWorkBill/MouldDeleteBill")]
        [HttpGet]
        public object MouldDeleteBill(long HInterID, string User, string ModRightNameDelete)
        {
            try
            {
                //判断权限
                //if (!DBUtility.ClsPub.Security_Log(ModRightNameDelete, 1, true, User))
                //{
                //    objJsonResult.code = "0";
                //    objJsonResult.count = 0;
                //    objJsonResult.Message = "没有删除权限";
                //    objJsonResult.data = null;
                //    return objJsonResult;
                //}
                oBill.ShowBill(HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
                if (oBill.omodel.HBillStatus > 1)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "单据当前处于不能删除的状态";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (oBill.omodel.HChecker != "")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "单据当前已审核";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (oBill.DeleteBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo))
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "删除成功";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "删除失败";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "无权限删除";
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
    }
}