1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- using System;
- using InABox.Core;
- namespace Comal.Classes
- {
- public class JobTrackerLink : EntityLink<JobTracker>
- {
- 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<Job, GPSTracker>, ILicense<GPSTrackerLicense>
- {
- [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<JobTracker>
- {
- public override Columns<JobTracker> DefineColumns()
- {
- return new Columns<JobTracker>(
- x => x.ID,
- x => x.JobLink.JobNumber,
- x => x.JobLink.Name,
- x => x.Gate
- );
- }
- public override Filter<JobTracker> DefineFilter()
- {
- return null;
- }
- public override SortOrder<JobTracker> DefineSortOrder()
- {
- return new SortOrder<JobTracker>(x => x.JobLink.JobNumber).ThenBy(x => x.Gate);
- }
- }
- }
|