Esempio n. 1
0
        public string GetTemplate(TemplateToPdfCommand templateToPdfCommand)
        {
            return
                (@"<div class=""entry"">
  <h1>Hello {{vwEnrollmentRequests:First_Name}} {{vwEnrollmentRequests:Last_Name}},</h1>
  <div>
    This is the body
  </div>
</div>");
        }
Esempio n. 2
0
        public string GetTemplate(TemplateToPdfCommand templateToPdfCommand)
        {
            string template;

            using (var webClient = new WebClient())
            {
                template = webClient.DownloadString(testURL);
            }

            return(template);
        }
Esempio n. 3
0
        public ActionResult Get(string language, string documentType, string id)
        {
            var command = new TemplateToPdfCommand
            {
                Language     = language,
                DocumentType = documentType,
                Id           = id
            };

            var result = _mediator.Send(command);

            return(new FileStreamResult(result.Result.Stream, "application/pdf"));
        }
        public string GetTemplate(TemplateToPdfCommand templateToPdfCommand)
        {
            string path;

            switch (templateToPdfCommand.DocumentType?.ToLower())
            {
            case "affidavit":
                path = Path.Combine(_hostingEnvironment.ContentRootPath, "Resources\\TaxAffidavit\\PA\\attachment.html");
                break;

            default:
                throw new MicroserviceException($"No template setup for DocumentType {templateToPdfCommand.DocumentType}");
            }

            return(File.ReadAllText(path));
        }