public string GenerateTemplatePreview(int id, int templateType, string templateName, string templatePath, string documentPath) { //string templateName = string.Empty; var generator = new DocumentGenerator(templatePath, documentPath, GetTemplateData(templateType, id), GetTransactionDetails(id),_log); var result = generator.GenerateDocument(); return result.Value ? result.ResultPath : string.Empty; }
public string GenerateTemplate(int id, int templateType, string templateName) { //string templateName = string.Empty; string templatePath = HttpContext.Current.Server.MapPath(string.Format("~/Templates/{0}.dotx", templateName)); string documentPath = HttpContext.Current.Server.MapPath(string.Format("~/Templates/{0}.docx", Guid.NewGuid().ToString())); var generator = new DocumentGenerator(templatePath, documentPath, GetTemplateData(templateType, id), GetTransactionDetails(id), _log); var result = generator.GenerateDocument(); return result.Value ? result.ResultPath : string.Empty; }