using System; using Comal.Classes; using InABox.Core; namespace comal.timesheets { public class DeliveryShell : Shell { 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(); public int Number => Get(); public Guid _jobid => Get(); private String _jobNumber => Get(); private String _jobName => Get(); public String Job => _jobid != Guid.Empty ? $"{_jobNumber}: {_jobName}" : ""; public String Address => Get(); public String ContactName => Get(); private DateTime _booked => Get(); private DateTime _due => Get(); public DateTime Date => _booked.IsEmpty() ? _due : _booked; public DateTime Delivered => Get(); } }