private async Task AddDataForCertificate(List <ICertficateDetail> certs, IChallengeResult result) { if (!result.Print) { return; } if (string.IsNullOrEmpty(result.EntryNumber)) { return; } if (result.ShowId <= 0) { return; } var allentries = await _handlerEntryService.GetHandlerEntryListAsync <HandlerEntryEntityWithAdditionalData>(); var entries = allentries.Where(e => e.ShowId == result.ShowId && e.EntryNumber == result.EntryNumber).ToList(); if (entries.Count == 1) { IHandlerEntryEntityWithAdditionalData entryData = entries.First(); certs.Add(new CertificateDetail() { RegionName = ReportConstants.REGION_NAME, DateAsString = ReportConstants.SHOWDATE_AS_STRING, SecretaryName = ReportConstants.SECRETARY, VenueName = ReportConstants.VENUE_NAME, ClubName = ReportConstants.CLUB_NAME, ShowName = entryData.ShowName, DateOfBirth = entryData.DOB.ToString("yyyy-MM-dd"), ChallengeName = entryData.EnteredClassName, BreedName = entryData.DogBreed, DogName = entryData.HandlerDisplayName, EntryNumber = entryData.EntryNumber, JudgeName = entryData.JudgeName, OwnerName = "", RegistrationNumber = entryData.DogRegistrationNumber, SexName = entryData.SexName }); } ; }
private async Task AddDataForCertificate(List <ICertficateDetail> certs, IChallengeResult result) { if (!result.Print) { return; } if (string.IsNullOrEmpty(result.EntryNumber)) { return; } if (result.ShowId <= 0) { return; } var entries = await _breedEntryService.GetBreedEntryListAsync <BreedEntryEntityWithAdditionalData>(result.ShowId, result.EntryNumber); if (entries.Count == 1) { IBreedEntryEntityWithAdditionalData entryData = entries.First(); certs.Add(new CertificateDetail() { RegionName = ReportConstants.REGION_NAME, DateAsString = ReportConstants.SHOWDATE_AS_STRING, SecretaryName = ReportConstants.SECRETARY, VenueName = ReportConstants.VENUE_NAME, ClubName = ReportConstants.CLUB_NAME, ShowName = entryData.ShowName, DateOfBirth = entryData.DOB.ToString("yyyy-MM-dd"), ChallengeName = result.Challenge, BreedName = entryData.BreedName, DogName = entryData.DogName, EntryNumber = entryData.EntryNumber, JudgeName = entryData.ActualJudgeName, OwnerName = entryData.RegisteredOwner, RegistrationNumber = entryData.DogRegistrationNumber, SexName = entryData.GenderName }); } ; }