Пример #1
0
        public List <QualifiedServerDto> GetQualifiedServers(int groupId, int opportunityId, string token)
        {
            var qualifiedServers            = new List <QualifiedServerDto>();
            var immediateFamilyParticipants = GetImmediateFamilyParticipants(token);

            foreach (var participant in immediateFamilyParticipants)
            {
                var membership = _groupService.ParticipantQualifiedServerGroupMember(groupId, participant.ParticipantId);

                var opportunityResponse = _opportunityService.GetMyOpportunityResponses(participant.ContactId,
                                                                                        opportunityId);
                var qualifiedServer = new QualifiedServerDto();
                qualifiedServer.ContactId     = participant.ContactId;
                qualifiedServer.Email         = participant.Email;
                qualifiedServer.LastName      = participant.LastName;
                qualifiedServer.LoggedInUser  = participant.LoggedInUser;
                qualifiedServer.MemberOfGroup = membership;
                qualifiedServer.Pending       = opportunityResponse != null;
                qualifiedServer.ParticipantId = participant.ParticipantId;
                qualifiedServer.PreferredName = participant.PreferredName;
                qualifiedServers.Add(qualifiedServer);
            }
            return(qualifiedServers);
        }