using System; using Comal.Classes; namespace comal.timesheets { public class AssignmentDetailShell : DetailShell { static AssignmentDetailShell() { Columns .Map(nameof(ID), c => c.ID) .Map(nameof(EmployeeID), x => x.EmployeeLink.ID) .Map(nameof(Number), x => x.Number) .Map(nameof(Subject), x => x.Title) .Map(nameof(Description), x => x.Description) .Map(nameof(Date), x => x.Date) .Map(nameof(ActualStart), x => x.Actual.Start) .Map(nameof(ActualDuration), x => x.Actual.Duration) .Map(nameof(ActualFinish), x => x.Actual.Finish) .Map(nameof(BookedStart), x => x.Booked.Start) .Map(nameof(BookedDuration), x => x.Booked.Duration) .Map(nameof(BookedFinish), x => x.Booked.Finish) .Map(nameof(JobID), x => x.JobLink.ID) .Map(nameof(JobNumber), x => x.JobLink.JobNumber) .Map(nameof(JobName), x => x.JobLink.Name) .Map(nameof(Latitude), x => x.JobLink.SiteAddress.Location.Latitude) .Map(nameof(Longitude), x => x.JobLink.SiteAddress.Location.Longitude) .Map(nameof(TaskID), x => x.Task.ID) .Map(nameof(TaskNumber), x => x.Task.Number) .Map(nameof(TaskName), x => x.Task.Title) .Map(nameof(ActivityID), x => x.ActivityLink.ID) .Map(nameof(ActivityCode), x => x.ActivityLink.Code) .Map(nameof(ActivityDescription), x => x.ActivityLink.Description) .Map(nameof(ActivityColor), x => x.ActivityLink.Color) .Map(nameof(Completed), x => x.Completed); } public Guid ID => Get(); public Guid EmployeeID { get => Get(); set => Set(value); } public int Number { get => Get(); set => Set(value); } public String Subject { get => Get(); set => Set(value); } public String Description { get => Get(); set => Set(value); } public DateTime Date { get => Get(); set => Set(value); } public TimeSpan ActualStart { get => Get(); set => Set(value); } public TimeSpan ActualDuration { get => Get(); set => Set(value); } public TimeSpan ActualFinish { get => Get(); set => Set(value); } public TimeSpan BookedStart { get => Get(); set => Set(value); } public TimeSpan BookedDuration { get => Get(); set => Set(value); } public TimeSpan BookedFinish { get => Get(); set => Set(value); } public Guid JobID { get => Get(); set => Set(value); } public String JobNumber { get => Get(); set { Set(value,false); DoPropertyChanged(nameof(JobDisplay)); } } public String JobName { get => Get(); set { Set(value,false); DoPropertyChanged(nameof(JobDisplay)); } } public String JobDisplay => JobID != Guid.Empty ? String.Format("{0}: {1}", JobNumber, JobName ) : "(No Job Selected)"; public double Latitude { get => Get(); set => Set(value); } public double Longitude { get => Get(); set => Set(value); } public Guid TaskID { get => Get(); set => Set(value); } public int TaskNumber { get => Get(); set { Set(value,false); DoPropertyChanged(nameof(TaskDisplay)); } } public String TaskName { get => Get(); set { Set(value,false); DoPropertyChanged(nameof(TaskDisplay)); } } public String TaskDisplay => TaskID != Guid.Empty ? String.Format("{0}: {1}", TaskNumber, TaskName ) : "(No Task Selected)"; public Guid ActivityID { get => Get(); set => Set(value); } public String ActivityCode { get => Get(); set { Set(value,false); DoPropertyChanged(nameof(ActivityDisplay)); } } public String ActivityDescription { get => Get(); set { Set(value,false); DoPropertyChanged(nameof(TaskDisplay)); } } public String ActivityColor { get => Get(); set => Set(value); } public String ActivityDisplay => ActivityID != Guid.Empty ? String.Format("{0}: {1}", ActivityCode, ActivityDescription) : "(No Activity Selected)"; public DateTime Completed { get => Get(); set => Set(value); } } }