public ContactsInviteServiceResponse InviteUsers(InviteServiceRequest request) { var response = new ContactsInviteServiceResponse(); try { UserConnection.DBSecurityEngine.CheckCanManageSspUsers(); var sspUserManagementHelper = new SspUserManagementServiceHelper(UserConnection); IEnumerable <ISspUserInvitation> result = sspUserManagementHelper.InviteUsers(request); response.ContactInvites = MapContactsInvites(result); } catch (Exception ex) { response.Exception = ex; } return(response); }
/// <summary> /// Invite portal user by SysAdminUnitUIds. /// </summary> /// <param name="request">Service request.</param> /// <returns>Information about the invitation of users.</returns> public List <ISspUserInvitation> InviteUsers(InviteServiceRequest request) { List <Guid> usersAccounts = GetUsersSspAccounts(request.SysAdminUnitIds).ToList(); CheckValidityUserAccountData(usersAccounts); var sspUserInviter = SspUserInviter ?? new SspUserInviter(UserConnection); foreach (var sysAdminUnitIdId in request.SysAdminUnitIds) { sspUserInviter.AddInvite(new SspUserInvite { SysAdminUnitId = sysAdminUnitIdId }); } return(sspUserInviter.InviteUsers()); }