Esempio n. 1
0
        public async Task <IActionResult> CreatePDFAsync(int objId)
        {
            if (objId <= 0)
            {
                throw new ArgumentException("Cannot crated pdf id is not valid");
            }
            var check = checkService.GetWithAllInfo(objId);

            byte[] arr = await pdfService.DecesionCreatePDFAsync(check);

            return(File(arr, "application/pdf"));
        }
Esempio n. 2
0
        public async Task<ActionResult> CreatePDFAsync(int objId)
        {
            try
            {
                if (objId <= 0)
                {
                    throw new ArgumentException("Cannot crated pdf id is not valid");
                }

                byte[] arr = await _PDFService.DecesionCreatePDFAsync(_repoWrapper.Decesion.Include(x => x.DecesionTarget,
                        x => x.Organization)
                    .FirstOrDefault(x => x.ID == objId));
                return File(arr, "application/pdf");
            }
            catch
            {
                return RedirectToAction("HandleError", "Error");
            }
        }