/// <summary>
        /// 授予用户操作权限
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="userIds">用户主键数组</param>
        /// <param name="grantPermissionIds">授予权限数组</param>
        /// <returns>影响的行数</returns>
        public int GrantUserPermissions(BaseUserInfo userInfo, string[] userIds, string[] grantPermissionIds)
        {
            var result = 0;

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

            ServiceUtil.ProcessUserCenterWriteDb(userInfo, parameter, (ServiceUtil.ProcessFun)((dbHelper) =>
            {
                var manager = new BasePermissionManager((IDbHelper)dbHelper, (BaseUserInfo)userInfo);
                // 小心异常,检查一下参数的有效性
                if (userIds != null && grantPermissionIds != null)
                {
                    result += manager.GrantUser(userInfo.SystemCode, userIds, grantPermissionIds);
                }
            }));

            return(result);
        }
        /// <summary>
        /// 授予用户操作权限
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="userId">用户主键</param>
        /// <param name="grantPermissionId">授予权限数组</param>
        /// <returns>影响的行数</returns>
        public string GrantUserPermissionById(BaseUserInfo userInfo, string userId, string grantPermissionId)
        {
            var result = string.Empty;

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

            ServiceUtil.ProcessUserCenterWriteDb(userInfo, parameter, (ServiceUtil.ProcessFun)((dbHelper) =>
            {
                var manager = new BasePermissionManager((IDbHelper)dbHelper, (BaseUserInfo)userInfo);
                // 小心异常,检查一下参数的有效性
                if (grantPermissionId != null)
                {
                    result = manager.GrantUser(userInfo.SystemCode, userId, grantPermissionId);
                }
            }));

            return(result);
        }