public byte[] GetCandidateAssessmentDownloadFileForCentre(int candidateAssessmentId, int candidateId)
        {
            var summaryData = selfAssessmentDataService.GetCandidateAssessmentExportSummary(candidateAssessmentId, candidateId);
            var detailData  = selfAssessmentDataService.GetCandidateAssessmentExportDetails(candidateAssessmentId, candidateId);
            var details     = detailData.Select(
                x => new
            {
                x.Group,
                x.Competency,
                x.CompetencyOptional,
                x.AssessmentQuestion,
                x.SelfAssessmentRequired,
                x.SelfAssessmentResult,
                x.SelfAssessmentComments,
                x.Reviewer,
                x.ReviewerPrn,
                x.Reviewed,
                x.ReviewerComments,
                x.ReviewerVerified,
                x.RoleRequirements
            }
                );

            using var workbook = new XLWorkbook();
            AddSummarySheet(workbook, summaryData);
            AddSheetToWorkbook(workbook, "Details", details);
            using var stream = new MemoryStream();
            workbook.SaveAs(stream);
            return(stream.ToArray());
        }
Exemplo n.º 2
0
 public IEnumerable <CandidateAssessmentExportDetail> GetCandidateAssessmentExportDetails(
     int candidateAssessmentId,
     int candidateId
     )
 {
     return(selfAssessmentDataService.GetCandidateAssessmentExportDetails(candidateAssessmentId, candidateId));
 }