| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138 |
- using System;
- using Comal.Classes;
- using InABox.Mobile;
- namespace PRS.Mobile
- {
- public class RequisitionShell : Shell<RequisitionModel, Requisition>
- {
- protected override void ConfigureColumns(ShellColumns<RequisitionModel, Requisition> 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)
- ;
- }
-
- public int Number => Get<int>();
-
- public String Title
- {
- get => Get<String>();
- set => Set(value);
- }
-
- public String Request
- {
- get => Get<String>();
- set => Set(value);
- }
-
- public String[] Notes
- {
- get => Get<String[]>();
- set => Set(value);
- }
- public DateTime Due
- {
- get => Get<DateTime>();
- set => Set(value);
- }
-
- #region Delivery Method
-
- public Guid DestinationID
- {
- get => Get<Guid>();
- set => Set(value);
- }
-
- public String DestinationDescription
- {
- get => Get<String>();
- set => Set(value);
- }
-
- #endregion
-
- public DateTime Filled
- {
- get => Get<DateTime>();
- set => Set(value);
- }
-
- #region Job Settings
-
- public Guid JobID
- {
- get => Get<Guid>();
- set => Set(value);
- }
-
- public String JobNumber
- {
- get => Get<String>();
- set
- {
- Set(value,false);
- DoPropertyChanged(nameof(JobDisplay));
- }
- }
-
- public String JobName
- {
- get => Get<String>();
- set
- {
- Set(value,false);
- DoPropertyChanged(nameof(JobDisplay));
- }
- }
-
- #endregion
-
- #region RequestedBy Settings
-
- public Guid RequestedByID
- {
- get => Get<Guid>();
- set => Set(value);
- }
-
- public String RequestedByName
- {
- get => Get<String>();
- 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
-
- }
- }
|