GPSTrackerShell.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. using System;
  2. using Comal.Classes;
  3. using String = System.String;
  4. namespace comal.timesheets
  5. {
  6. public class GPSTrackerShell : Shell<GPSTrackerModel, GPSTracker>
  7. {
  8. static GPSTrackerShell()
  9. {
  10. Columns
  11. .Map(nameof(ID), x => x.ID)
  12. .Map(nameof(DeviceID), x => x.DeviceID)
  13. .Map(nameof(Description), x => x.Description)
  14. .Map(nameof(Latitude), x => x.Location.Latitude)
  15. .Map(nameof(Longitude), x => x.Location.Longitude)
  16. .Map(nameof(Timestamp), x => x.Location.Timestamp)
  17. .Map(nameof(Address), x => x.Location.Address);
  18. }
  19. public Guid ID => Row.Get<GPSTracker, Guid>(x => x.ID);
  20. public String DeviceID => Row.Get<GPSTracker, String>(x => x.DeviceID);
  21. public String Description => Row.Get<GPSTracker, String>(x => x.Description);
  22. public double Latitude => Get<double>();
  23. public double Longitude => Get<double>();
  24. public DateTime Timestamp => Get<DateTime>();
  25. public String Address => Get<String>();
  26. public InABox.Core.Location Location => new InABox.Core.Location()
  27. {
  28. Latitude = this.Latitude,
  29. Longitude = this.Longitude,
  30. Address = this.Address,
  31. Timestamp = this.Timestamp
  32. };
  33. }
  34. }