12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- using System;
- using System.Linq;
- using Comal.Classes;
- using Xamarin.Forms;
- namespace comal.timesheets
- {
-
- public class JobShell : Shell<JobModel, Job>
- {
-
- static JobShell()
- {
- Columns
- .Map(nameof(ID), x => x.ID)
- .Map(nameof(JobNumber), x => x.JobNumber)
- .Map(nameof(Name), x => x.Name)
- .Map(nameof(Status), x => x.JobStatus.Description)
- .Map(nameof(Active), x=>x.JobStatus.Active)
- .Map(nameof(_color), x => x.Color)
- .Map(nameof(Latitude), x => x.SiteAddress.Location.Latitude)
- .Map(nameof(Longitude), x => x.SiteAddress.Location.Longitude)
- .Map(nameof(Notes), x => x.Notes)
- .Map(nameof(OpenAssignments), x => x.OpenAssignments);
- }
- public Guid ID => Get<Guid>();
- public string Name => Get<String>();
- public string JobNumber => Get<String>();
- private String _color => Get<String>();
- public Color Color => Color.FromHex(_color);
-
- public String Status => Get<String>();
- public bool Active => Get<bool>();
- public double Latitude => Get<double>();
- public double Longitude => Get<double>();
- public String Notes => Get<String>();
- public int OpenAssignments => Get<int>();
-
- public string DisplayName => $"{JobNumber}: {Name}";
- public InABox.Core.Location Location => new InABox.Core.Location()
- {
- Latitude = this.Latitude,
- Longitude = this.Longitude
- };
- }
- }
|