public virtual async Task AddUsersAsync(Guid id, OrganizationUnitAddUserDto input)
        {
            var origanizationUnit = await OrganizationUnitRepository.GetAsync(id);

            var users = await UserRepository.GetListByIdListAsync(input.UserIds, includeDetails : true);

            // 调用内部方法设置用户组织机构
            foreach (var user in users)
            {
                await UserManager.AddToOrganizationUnitAsync(user, origanizationUnit);
            }

            await CurrentUnitOfWork.SaveChangesAsync();
        }
Example #2
0
 public virtual async Task AddUsersAsync(Guid id, OrganizationUnitAddUserDto input)
 {
     await OrganizationUnitAppService.AddUsersAsync(id, input);
 }