コード例 #1
0
        public ActionResult DelPermissions(string id)
        {
            try
            {
                var response = _permissionsService.DelPermissions(new DelPermissionsRequest()
                {
                    Id = int.Parse(id.IsNullOrEmpty() ? "0" : id)
                });

                if (!response.IsSuccess)
                {
                    return(ToJsonErrorResult(1, response.MessageText));
                }

                return(ToJsonResult(new { status = 0 }));
            }
            catch (Exception ex)
            {
                LogManager.DefaultLogger.ErrorFormat("删除权限出错:{0}", new { id, err = ex.ToString() }.ToJson());
                return(ToJsonFatalResult("删除权限出错!", ex.Message));
            }
        }