/// <summary>
        /// 撤销用户权限
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="userName">用户名</param>
        /// <param name="permissionCode">权限编号</param>
        /// <returns>主键</returns>
        public int RevokeUserPermission(BaseUserInfo userInfo, string userName, string permissionCode)
        {
            var result = 0;

            var parameter = ServiceInfo.Create(userInfo, MethodBase.GetCurrentMethod());

            ServiceUtil.ProcessUserCenterWriteDb(userInfo, parameter, (ServiceUtil.ProcessFun)((dbHelper) =>
            {
                var userManager = new BaseUserManager(dbHelper, userInfo);
                var userId      = userManager.GetId(new KeyValuePair <string, object>(BaseUserEntity.FieldUserName, userName));
                if (ValidateUtil.IsInt(userId))
                {
                    var userPermissionManager = new BasePermissionManager((IDbHelper)dbHelper, (BaseUserInfo)userInfo);
                    result = userPermissionManager.RevokeByPermissionCode(userInfo.SystemCode, userId, permissionCode);
                }
            }));

            return(result);
        }