public ScreenerSummaryViewModel GetApplicantList(SSOApplicationUser currentUser) { var corpApplicantIds = _screenerRepository.GetCorporationApplicants(currentUser.CorporationId).Select(s => s.CharacterId); var allianceApplicantIds = _screenerRepository.GetAllianceApplicants(currentUser.AllianceId).Select(s => s.CharacterId); var idList = new IdList() { Ids = corpApplicantIds.Concat(allianceApplicantIds).Distinct().ToList() }; if (idList.Ids.Count > 0) { var models = idList.GetCharacterNames(); return(new ScreenerSummaryViewModel() { CorporateApplications = models.CharacterDetail.Where(w => corpApplicantIds.Contains(w.Id) && !w.Id.Equals(currentUser.CorporationId)).ToList(), AllianceApplications = models.CharacterDetail.Where(w => allianceApplicantIds.Contains(w.Id) && !w.Id.Equals(currentUser.AllianceId)).ToList() }); } return(new ScreenerSummaryViewModel() { CorporateApplications = new System.Collections.Generic.List <ESI.Models.Character.Summary>(), AllianceApplications = new System.Collections.Generic.List <ESI.Models.Character.Summary>() }); }
public static List <ESIBasicEntity> GetEntityNames(this IdList me) { var characters = me.GetCharacterNames().CharacterDetail.ToList(); var corporationIdList = new IdList() { Ids = characters .Where(w => w.Name.Equals("Character Not Found")).Select(w => w.Id).ToList() }; var corporations = corporationIdList.GetCorporationNames().CorporationDetail.ToList(); characters = characters.Where(w => !w.Name.Equals("Character Not Found")).ToList(); var result = new List <ESIBasicEntity>(); characters.ForEach(character => result.Add(new ESIBasicEntity() { Id = character.Id, Name = character.Name, Type = "character" })); corporations.ForEach(corporation => result.Add(new ESIBasicEntity() { Id = corporation.Id, Name = corporation.Name, Type = "corporation" })); return(result); }
public List <string> Resolve(MailHeaderModel source, MailSummaryModel destination, List <string> destMember, ResolutionContext context) { var idList = new IdList() { Ids = source.Recipients.Where(w => w.RecipientType == "character").Select(s => s.RecipientId).ToList() }; var names = idList.GetCharacterNames(); return(names.CharacterDetail.Select(s => s.Name).ToList()); }