예제 #1
0
        /// <summary>
        ///  删除权限功能
        /// </summary>
        /// <param name="ParamenterID">系统参数Id</param>
        /// <returns></returns>
        /// <remarks>added by jimmy,2015-7-3</remarks>
        public JsonResult Delete(int?functionID)
        {
            var resultModel = new ResultModel();

            if (functionID.HasValue)
            {
                var result = _aC_FunctionService.Delete(functionID.Value).Data;
                if (result > 0)
                {
                    resultModel.IsValid  = true;
                    resultModel.Messages = new List <string> {
                        "Delete success"
                    };
                }
                else
                {
                    resultModel.IsValid  = false;
                    resultModel.Messages = new List <string> {
                        "Delete failed"
                    };
                }
            }
            else
            {
                resultModel.IsValid  = false;
                resultModel.Messages = new List <string> {
                    "Key ID error"
                };
            }
            var opera = string.Format("删除权限功能 functionID:{0},结果:{1}", functionID, resultModel.IsValid?"成功":"失败");

            LogPackage.InserAC_OperateLog(opera, "系统管理--权限管理");
            return(Json(resultModel, JsonRequestBehavior.AllowGet));
        }
        public void AC_FunctionService_Delete_Test()
        {
            var result = _aC_FunctionService.Delete(10);

            Assert.IsTrue(result.Data);
        }