123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- using System;
- using System.Linq;
- using InABox.Core;
- namespace Comal.Classes
- {
- public class JobDocumentSetLink : EntityLink<JobDocumentSet>, IJobDocumentSet
- {
- [LookupEditor(typeof(JobDocumentSet))]
- public override Guid ID { get; set; }
-
- [NullEditor]
- public JobLink Job { get; set; }
-
- [NullEditor]
- public JobDocumentSetFolderLink Folder { get; set; }
-
- [CodeEditor(Editable = Editable.Hidden)]
- [EditorSequence(1)]
- public string Code { get; set; }
-
- [TextBoxEditor(Editable = Editable.Hidden)]
- [EditorSequence(2)]
- public string Description { get; set; }
-
- public JobDocumentSetDisciplineLink Discipline { get; set; }
-
- public JobDocumentSetTypeLink Type { get; set; }
-
- public JobDocumentSetCategoryLink Category { get; set; }
-
- public JobITPLink Area { get; set; }
- public LightJobDocumentSetMileStoneLink CurrentMileStone { get; set; }
- }
-
- public class JobDocumentSetLookups : EntityLookup<JobDocumentSet>,
- ILookupDefinition<JobDocumentSet,JobProductMapping>,
- ILookupDefinition<JobDocumentSet,JobStyle>
- {
- 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(JobProductMapping[] 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();
- }
- Columns<JobProductMapping> ILookupDefinition<JobDocumentSet, JobProductMapping>.DefineFilterColumns()
- {
- return new Columns<JobProductMapping>(x => x.ID)
- .Add(x=>x.Job.ID)
- .Add(x => x.Job.JobNumber)
- .Add(x => x.Job.Name);
- }
-
-
- public 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();
- }
- Columns<JobStyle> ILookupDefinition<JobDocumentSet, JobStyle>.DefineFilterColumns()
- {
- return new Columns<JobStyle>(x => x.ID)
- .Add(x=>x.Job.ID)
- .Add(x => x.Job.JobNumber)
- .Add(x => x.Job.Name);
- }
-
- }
- }
|