public override void SaveTemplate(DigitalSignatureTemplate template) { var path = $"{templateRepository}\\{template.id}.json"; var json = JsonConvert.SerializeObject(template); var bytes = Encoding.UTF8.GetBytes(json); File.WriteAllBytes(path, bytes); }
public string CreateTemplate(string name, string description, List <PDFField> pdfFields) { if (GetTemplates().Any(t => t.name == name)) { throw new AccessViolationException($"duplicate name of '{name}'."); } var template = new DigitalSignatureTemplate() { name = name, description = description, fields = pdfFields }; SaveTemplate(template); return(template.id); }
public abstract void SaveTemplate(DigitalSignatureTemplate template);