Beispiel #1
0
        public async Task <string> Delete(long id)
        {
            var userInfo = await _userRepository.SingleOrDefaultAsync(p => p.Id == id);

            if (userInfo == null)
            {
                throw new BusinessException($"不存在Id为{id}的账号信息");
            }
            await _userDomainService.Delete(id);

            return("删除员工成功");
        }
Beispiel #2
0
        public Account Delete(Account Account)
        {
            var user = _userService.GetByAccount(Account.Id);

            if (user != null)
            {
                _userService.Delete(user);
            }

            database.Account.Remove(Account);
            database.SaveChanges();
            return(Account);
        }
Beispiel #3
0
        public async Task <string> Delete(long id)
        {
            if (_session.UserId.Value == id)
            {
                throw new BusinessException("不允许删除当前登录用户");
            }
            var userInfo = await _userRepository.SingleOrDefaultAsync(p => p.Id == id);

            if (userInfo == null)
            {
                throw new BusinessException($"不存在Id为{id}的账号信息");
            }
            _session.CheckLoginUserDataPermision(userInfo.OrgId, "您没有删除该用户的权限");
            await _userDomainService.Delete(id);

            return("删除员工成功");
        }
 ///<inheritdoc/>
 public override Task DeleteAsync(Guid key, CancellationToken cancellationToken = default)
 {
     _userDomain.Delete(key);
     return(base.DeleteAsync(key, cancellationToken));
 }
Beispiel #5
0
 public void Delete(Guid id)
 {
     _userDomainService.Delete(id);
 }