| 123456789101112131415161718192021222324252627282930313233343536373839404142 | 
							- using InABox.Core;
 
- using System.Linq;
 
- namespace Comal.Classes
 
- {
 
-     public class JobStyle : Entity, IRemotable, IPersistent, ILicense<ProjectManagementLicense>
 
-     {
 
-         [EntityRelationship(DeleteAction.Cascade)]
 
-         [Editable(Editable.Hidden)]
 
-         public JobLink Job { get; set; }
 
-         [EntityRelationship(DeleteAction.SetNull)]
 
-         [EditorSequence(2)]
 
-         public ProductStyleLink Style { get; set; }
 
-         [EditorSequence(3)]
 
-         [MemoEditor]
 
-         public string Note { get; set; } = "";
 
-         private class JobDocumentSetLookup : LookupDefinitionGenerator<JobDocumentSet, JobStyle>
 
-         {
 
-             public override Filter<JobDocumentSet>? DefineFilter(JobStyle[] items)
 
-             {
 
-                 var ids = items.Select(x => x.Job.ID).Distinct().ToArray();
 
-                 return ids.Any()
 
-                     ? new Filter<JobDocumentSet>(x => x.Job.ID).InList(ids)
 
-                     : new Filter<JobDocumentSet>().None();
 
-             }
 
-             public override Columns<JobStyle> DefineFilterColumns()
 
-             {
 
-                 return Columns.None<JobStyle>().Add(x => x.ID)
 
-                     .Add(x=>x.Job.ID)
 
-                     .Add(x => x.Job.JobNumber)
 
-                     .Add(x => x.Job.Name);
 
-             }
 
-         }
 
-         [LookupDefinition(typeof(JobDocumentSetLookup))]
 
-         [EntityRelationship(DeleteAction.SetNull)]
 
-         public JobDocumentSetLink JobDocumentSet { get; set; }
 
-     }
 
- }
 
 
  |