123456789101112131415161718192021222324252627282930 |
- using InABox.Core;
- namespace Comal.Classes
- {
- public class JobForm : EntityForm<Job, JobLink, JobForm>, IDigitalForm<Job>, ILicense<ProjectManagementLicense>
- {
- [EditorSequence(998)]
- [EntityRelationship(DeleteAction.Cascade)]
- public override JobLink Parent { get; set; }
-
- private class JobScopeLookup : LookupDefinitionGenerator<JobScope, JobForm>
- {
- public override Filter<JobScope> DefineFilter(JobForm[] items)
- {
- var item = items?.Length == 1 ? items[0] : null;
- if (item != null)
- return new Filter<JobScope>(x => x.Job.ID).IsEqualTo(item.Parent.ID).And(x => x.Status.Approved).IsEqualTo(true);
- return new Filter<JobScope>(x => x.ID).None();
- }
- public override Columns<JobForm> DefineFilterColumns()
- => new Columns<JobForm>(x => x.Parent.ID);
- }
- [LookupDefinition(typeof(JobScopeLookup))]
- [EditorSequence(999)]
- public JobScopeLink JobScope { get; set; }
- public override string AutoIncrementPrefix() => "JF";
- }
- }
|