using System; using InABox.Core; namespace Comal.Classes { public class JobTrackerLink : EntityLink { public JobTrackerLink() { JobLink = new JobLink(); } [LookupEditor(typeof(JobTracker))] public override Guid ID { get; set; } [NullEditor] public JobLink JobLink { get; set; } [TextBoxEditor(Editable = Editable.Hidden)] public string Gate { get; set; } } [UserTracking(typeof(GPSTracker))] public class JobTracker : Entity, IPersistent, IRemotable, IManyToMany, ILicense { [EntityRelationship(DeleteAction.Cascade)] public JobLink JobLink { get; set; } [EntityRelationship(DeleteAction.SetNull)] public GPSTrackerLink TrackerLink { get; set; } public string Gate { get; set; } public bool Active { get; set; } // If a mobile app finds one of these tiles // this flag should indicate whether to log them onto // the associated job or not. public bool IsJobSite { get; set; } protected override void Init() { base.Init(); TrackerLink = new GPSTrackerLink(); JobLink = new JobLink(); } } public class JobTrackerLookups : EntityLookup { public override Columns DefineColumns() { return new Columns( x => x.ID, x => x.JobLink.JobNumber, x => x.JobLink.Name, x => x.Gate ); } public override Filter DefineFilter() { return null; } public override SortOrder DefineSortOrder() { return new SortOrder(x => x.JobLink.JobNumber).ThenBy(x => x.Gate); } } }