public async Task <IActionResult> CertificatePreview(long id, bool isPreview) { var batch = await _certificateService.GetCertificateBatchByID(id, true); var data = batch.Certificates.OrderBy(e => e.SerialNo) .Select(e => CertificateHelper.Convert(e)) .ToList(); return(View("Certificate", new CertificateModel { IsPreview = isPreview, Title = batch.TemplateText, Certificates = data })); }
public async Task <CertificateModel> CertificatePreviewApi(bool isPreview, [FromQuery] long[] ids) { var certificates = await _certificateService.GetCertificates(new CertificateOptions { IDs = ids }); var data = certificates.OrderBy(e => e.SerialNo) .Select(e => CertificateHelper.Convert(e)) .ToList(); return(new CertificateModel { IsPreview = isPreview, Certificates = data }); }