JobTracker.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using System;
  2. using InABox.Core;
  3. namespace Comal.Classes
  4. {
  5. public class JobTrackerLink : EntityLink<JobTracker>
  6. {
  7. protected override void Init()
  8. {
  9. base.Init();
  10. JobLink = new JobLink();
  11. }
  12. [LookupEditor(typeof(JobTracker))]
  13. public override Guid ID { get; set; }
  14. [NullEditor]
  15. public JobLink JobLink { get; set; }
  16. [TextBoxEditor(Editable = Editable.Hidden)]
  17. public string Gate { get; set; }
  18. }
  19. [UserTracking(typeof(GPSTracker))]
  20. public class JobTracker : Entity, IPersistent, IRemotable, IManyToMany<Job, GPSTracker>, ILicense<GPSTrackerLicense>
  21. {
  22. [EditorSequence(1)]
  23. [EntityRelationship(DeleteAction.Cascade)]
  24. public JobLink JobLink { get; set; }
  25. [EditorSequence(2)]
  26. [EntityRelationship(DeleteAction.SetNull)]
  27. public GPSTrackerLink TrackerLink { get; set; }
  28. [EditorSequence(3)]
  29. public string Gate { get; set; }
  30. [EditorSequence(4)]
  31. public bool Active { get; set; }
  32. // If a mobile app finds one of these tiles
  33. // this flag should indicate whether to log them onto
  34. // the associated job or not.
  35. [EditorSequence(5)]
  36. public bool IsJobSite { get; set; }
  37. protected override void Init()
  38. {
  39. base.Init();
  40. TrackerLink = new GPSTrackerLink();
  41. JobLink = new JobLink();
  42. }
  43. }
  44. }