| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 | using InABox.Core;using System;using System.Collections.Generic;using System.Linq;using System.Linq.Expressions;using System.Text;namespace Comal.Classes{    public class JobProductMapping : Entity, IRemotable, IPersistent, ILicense<ProjectManagementLicense>    {                [EntityRelationship(DeleteAction.Cascade)]        [NullEditor]        public JobLink Job { get; set; }                [CodeEditor(Editable = Editable.Enabled, Visible = Visible.Default)]        [EditorSequence(1)]        public string Code { get; set; } = "";        [MemoEditor(Visible = Visible.Default)]        [EditorSequence(2)]        public string Description { get; set; } = "";                [EntityRelationship(DeleteAction.SetNull)]        [EditorSequence(3)]        public ProductLink Product { get; set; }        private class JobDocumentSetLookup : LookupDefinitionGenerator<JobDocumentSet, JobProductMapping>        {            public override 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();            }            public override Columns<JobProductMapping> DefineFilterColumns()            {                return new Columns<JobProductMapping>(x => x.ID)                    .Add(x=>x.Job.ID)                    .Add(x => x.Job.JobNumber)                    .Add(x => x.Job.Name);            }        }        [LookupDefinition(typeof(JobDocumentSetLookup))]        [EntityRelationship(DeleteAction.SetNull)]        [EditorSequence(3)]        public JobDocumentSetLink JobDocumentSet { get; set; }    }}
 |