Exemplo n.º 1
0
        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
            }));
        }
Exemplo n.º 2
0
        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
            });
        }