Пример #1
0
        /// <summary>
        /// 锁定
        /// </summary>
        /// <param name="id">菜单编号</param>
        /// <returns></returns>
        public async Task RemoveAsync(long id)
        {
            var entity = await _menuRepository.GetAsync(id);

            entity.IsValid = false;

            await _menuRepository.UpdateAsync(entity);
        }
Пример #2
0
        /// <summary>
        ///   锁定,解锁操作
        /// </summary>
        /// <param name="managerId"></param>
        /// <returns></returns>
        public async Task LockManagerAsync(long managerId)
        {
            //获取管理员信息
            var manager = await GetManagerByIdAsync(managerId, new List <string> {
                "UserBase"
            });

            manager.UserBase.IsLockoutEnaled = !manager.UserBase.IsLockoutEnaled;

            await _managerRepository.UpdateAsync(manager);
        }
Пример #3
0
 /// <summary>
 ///     更新角色
 /// </summary>
 /// <param name="info">角色实体</param>
 /// <returns></returns>
 public async Task UpdateRoleAsync(Role info)
 {
     if (info.BelongUserId != AprilSession.BelongUserId)
     {
         throw new UserFriendlyException("您无权修改此角色");
     }
     await _roleRepository.UpdateAsync(info);
 }
Пример #4
0
 /// <summary>
 ///     更新
 /// </summary>
 /// <param name="input"></param>
 /// <returns></returns>
 public async Task UpdateUserBaseAsync(UserBase input)
 {
     await _userBaseRepository.UpdateAsync(input);
 }