JobDeliveryShell.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using System;
  2. using Comal.Classes;
  3. using InABox.Core;
  4. using Xamarin.Forms;
  5. namespace comal.timesheets
  6. {
  7. public class JobDeliveryShell : Shell<JobDetailModel, Delivery>
  8. {
  9. static JobDeliveryShell()
  10. {
  11. Columns
  12. .Map(nameof(ID), x => x.ID)
  13. .Map(nameof(Number), x => x.Number)
  14. .Map(nameof(Address), x => x.Location.Address)
  15. .Map(nameof(ContactName), x => x.Contact.Name)
  16. .Map(nameof(Due), x => x.Due)
  17. .Map(nameof(Delivered), x => x.Delivered)
  18. .Map(nameof(DeliveredBy), x => x.DeliveredBy.Name)
  19. .Map(nameof(Latitude), x => x.Location.Latitude)
  20. .Map(nameof(Longitude), x => x.Location.Longitude)
  21. .Map(nameof(JobID), x => x.Job.ID);
  22. }
  23. public Guid ID => Row.Get<JobEquipment, Guid>(x => x.ID);
  24. public int Number => Get<int>();
  25. public String Address => Get<String>();
  26. public String ContactName => Get<String>();
  27. public DateTime Due => Get<DateTime>();
  28. public DateTime Delivered => Get<DateTime>();
  29. public String DeliveredBy => Get<String>();
  30. public double Latitude => Get<double>();
  31. public double Longitude => Get<double>();
  32. public Guid JobID => Get<Guid>();
  33. public ImageSource IsDelivered => Delivered.IsEmpty() ? null : ImageSource.FromFile("tick.png");
  34. }
  35. }