Files
Disco/Disco.Models/Repository/DocumentTemplate/DocumentTemplate.cs
T
Gary Sharp 1cc7e94646 Feature #67: Advanced document template events
OnGenerated and OnImportAttachment allow advanced users to enter
expressions which will be evaluated whenever these document
template/importing events are triggered. This enables greater
automation.
2014-07-26 20:02:59 +10:00

52 lines
1.7 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Disco.Models.Repository
{
public class DocumentTemplate
{
public const string PdfMimeType = "application/pdf";
[StringLength(30), Required, Key]
public string Id { get; set; }
[StringLength(250), Required]
public string Description { get; set; }
[Required, StringLength(6)]
public string Scope { get; set; }
[DataType(DataType.MultilineText)]
public string FilterExpression { get; set; }
[DataType(DataType.MultilineText)]
public string OnGenerateExpression { get; set; }
[DataType(DataType.MultilineText)]
public string OnImportAttachmentExpression { get; set; }
// Feature Request 2012-05-10 by G#: https://disco.uservoice.com/forums/159707-feedback/suggestions/2811092-document-template-option-flatten-form-on-generate
public bool FlattenForm { get; set; }
// End Feature Request
public string DevicesLinkedGroup { get; set; }
public string UsersLinkedGroup { get; set; }
[InverseProperty("DocumentTemplates")]
public virtual IList<JobSubType> JobSubTypes { get; set; }
public static class DocumentTemplateScopes
{
public const string Device = "Device";
public const string Job = "Job";
public const string User = "User";
public static List<string> ToList()
{
return new List<string> { Device, Job, User };
}
}
}
}