12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- using System;
- using Comal.Classes;
- using InABox.Core;
- namespace comal.timesheets
- {
- public class DeliveryShell : Shell<DeliveryModel, Delivery>
- {
-
- static DeliveryShell()
- {
- Columns.Map(nameof(ID), x => x.ID)
- .Map(nameof(Number), x => x.Number)
- .Map(nameof(_jobid), x => x.Job.ID)
- .Map(nameof(_jobNumber), x => x.Job.JobNumber)
- .Map(nameof(_jobName), x => x.Job.Name)
- .Map(nameof(Date), x => x.Date)
- .Map(nameof(ContactName), x => x.Contact.Name)
- .Map(nameof(_booked), x => x.Assignment.Date)
- .Map(nameof(Delivered), x => x.Delivered)
- .Map(nameof(_due), x => x.Due)
- .Map(nameof(Address), x => x.Location.Address);
- }
-
- public Guid ID => Get<Guid>();
- public int Number => Get<int>();
-
- public Guid _jobid => Get<Guid>();
- private String _jobNumber => Get<String>();
- private String _jobName => Get<String>();
- public String Job => _jobid != Guid.Empty
- ? $"{_jobNumber}: {_jobName}"
- : "";
- public String Address => Get<String>();
- public String ContactName => Get<String>();
-
- private DateTime _booked => Get<DateTime>();
- private DateTime _due => Get<DateTime>();
- public DateTime Date => _booked.IsEmpty() ? _due : _booked;
-
- public DateTime Delivered => Get<DateTime>();
- }
- }
|