|
@@ -1,11 +1,12 @@
|
|
|
using System;
|
|
|
+using System.Linq;
|
|
|
using InABox.Core;
|
|
|
|
|
|
namespace Comal.Classes
|
|
|
{
|
|
|
public class JobDocumentSetLink : EntityLink<JobDocumentSet>, IJobDocumentSet
|
|
|
{
|
|
|
- [NullEditor]
|
|
|
+ [LookupEditor(typeof(JobDocumentSet))]
|
|
|
public override Guid ID { get; set; }
|
|
|
|
|
|
[NullEditor]
|
|
@@ -32,4 +33,40 @@ namespace Comal.Classes
|
|
|
|
|
|
public LightJobDocumentSetMileStoneLink CurrentMileStone { get; set; }
|
|
|
}
|
|
|
+
|
|
|
+ public class JobDocumentSetLookups : EntityLookup<JobDocumentSet>, ILookupDefinition<JobDocumentSet,Job>
|
|
|
+ {
|
|
|
+ public override Filter<JobDocumentSet>? DefineFilter()
|
|
|
+ {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ public override SortOrder<JobDocumentSet> DefineSortOrder()
|
|
|
+ {
|
|
|
+ return new SortOrder<JobDocumentSet>(x=>x.Code);
|
|
|
+ }
|
|
|
+
|
|
|
+ public override Columns<JobDocumentSet> DefineColumns()
|
|
|
+ {
|
|
|
+ return new Columns<JobDocumentSet>(x => x.ID)
|
|
|
+ .Add(x => x.Code)
|
|
|
+ .Add(x => x.Description);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public Filter<JobDocumentSet>? DefineFilter(Job[] items)
|
|
|
+ {
|
|
|
+ var ids = items.Select(x => x.ID).Distinct().ToArray();
|
|
|
+ return ids.Any()
|
|
|
+ ? new Filter<JobDocumentSet>(x => x.Job.ID).InList(ids)
|
|
|
+ : new Filter<JobDocumentSet>().None();
|
|
|
+ }
|
|
|
+
|
|
|
+ public Columns<Job> DefineFilterColumns()
|
|
|
+ {
|
|
|
+ return new Columns<Job>(x => x.ID)
|
|
|
+ .Add(x => x.JobNumber)
|
|
|
+ .Add(x => x.Name);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|