using System; using Comal.Classes; using InABox.Mobile; namespace PRS.Mobile { public class RequisitionShell : Shell { protected override void ConfigureColumns(ShellColumns columns) { columns .Map(nameof(Number), x => x.Number) .Map(nameof(Title), x => x.Title) .Map(nameof(Request), x => x.Request) .Map(nameof(Notes), x => x.Notes) .Map(nameof(JobID), x => x.JobLink.ID) .Map(nameof(JobNumber), x => x.JobLink.JobNumber) .Map(nameof(JobName), x => x.JobLink.Name) .Map(nameof(Due), x => x.Due) .Map(nameof(Filled), x => x.Filled) .Map(nameof(RequestedByID), x => x.RequestedBy.ID) .Map(nameof(RequestedByName), x => x.RequestedBy.Name) .Map(nameof(DestinationID), x => x.Destination.ID) .Map(nameof(DestinationDescription), x => x.Destination.Description) .Map(nameof(StockUpdated), x => x.StockUpdated) ; } public int Number => Get(); public String Title { get => Get(); set => Set(value); } public String Request { get => Get(); set => Set(value); } public String[] Notes { get => Get(); set => Set(value); } public DateTime Due { get => Get(); set => Set(value); } #region Delivery Method public Guid DestinationID { get => Get(); set => Set(value); } public String DestinationDescription { get => Get(); set => Set(value); } #endregion public DateTime Filled { get => Get(); set => Set(value); } public DateTime StockUpdated { get => Get(); set => Set(value); } #region Job Settings 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)); } } #endregion #region RequestedBy Settings public Guid RequestedByID { get => Get(); set => Set(value); } public String RequestedByName { get => Get(); set => Set(value); } #endregion #region Calculated Fields public String JobDisplay => JobID != Guid.Empty ? $"{JobNumber}: {JobName}" : ""; public override string ToString() { return ID != Guid.Empty ? $"{Number}: {Title} {(JobID != Guid.Empty ? "("+JobNumber+")" : "")}" : "New Requisition"; } #endregion } }