using System.Linq; using InABox.Core; namespace Comal.Classes { [UserTracking(false)] public class CustomModule : Entity, IRemotable, IPersistent, ISchedulable, ILicense { [EditorSequence(1)] public string Name { get; set; } [NullEditor] public string Section { get; set; } [NullEditor] public string DataModel { get; set; } [TextBoxEditor(Visible = InABox.Core.Visible.Hidden, Editable = Editable.Hidden)] public string Group { get; set; } [ScriptEditor] [EditorSequence(3)] public string Script { get; set; } [EditorSequence(4)] public ImageDocumentLink Thumbnail { get; set; } [CheckBoxEditor] [EditorSequence(5)] public bool Visible { get; set; } [CheckBoxEditor] [EditorSequence(6)] public bool AllRecords { get; set; } = false; [CheckBoxEditor] [EditorSequence(7)] public bool SelectedRecords { get; set; } = true; //[NullEditor] //public bool ScheduleEnabled { get; set; } [NullEditor] public int ActiveSchedules { get; set; } private class SectionLookups : LookupGenerator { public SectionLookups(object[] items) : base(items) { AddValue("", "Unassigned"); foreach (var module in CustomModules.All.Where(x => !string.IsNullOrWhiteSpace(x))) AddValue(module, module); } } } public class CustomModuleLookups : EntityLookup { public override Filter DefineFilter() { return null; } public override SortOrder DefineSortOrder() { return new SortOrder(x => x.Section).ThenBy(x => x.Name); } } }