RequisitionShell.cs 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. using System;
  2. using Comal.Classes;
  3. using InABox.Mobile;
  4. namespace PRS.Mobile
  5. {
  6. public class RequisitionShell : Shell<RequisitionModel, Requisition>
  7. {
  8. protected override void ConfigureColumns(ShellColumns<RequisitionModel, Requisition> columns)
  9. {
  10. columns
  11. .Map(nameof(Number), x => x.Number)
  12. .Map(nameof(Title), x => x.Title)
  13. .Map(nameof(Request), x => x.Request)
  14. .Map(nameof(Notes), x => x.Notes)
  15. .Map(nameof(JobID), x => x.JobLink.ID)
  16. .Map(nameof(JobNumber), x => x.JobLink.JobNumber)
  17. .Map(nameof(JobName), x => x.JobLink.Name)
  18. .Map(nameof(Due), x => x.Due)
  19. .Map(nameof(Filled), x => x.Filled)
  20. .Map(nameof(RequestedByID), x => x.RequestedBy.ID)
  21. .Map(nameof(RequestedByName), x => x.RequestedBy.Name)
  22. .Map(nameof(DestinationID), x => x.Destination.ID)
  23. .Map(nameof(DestinationDescription), x => x.Destination.Description)
  24. ;
  25. }
  26. public int Number => Get<int>();
  27. public String Title
  28. {
  29. get => Get<String>();
  30. set => Set(value);
  31. }
  32. public String Request
  33. {
  34. get => Get<String>();
  35. set => Set(value);
  36. }
  37. public String[] Notes
  38. {
  39. get => Get<String[]>();
  40. set => Set(value);
  41. }
  42. public DateTime Due
  43. {
  44. get => Get<DateTime>();
  45. set => Set(value);
  46. }
  47. #region Delivery Method
  48. public Guid DestinationID
  49. {
  50. get => Get<Guid>();
  51. set => Set(value);
  52. }
  53. public String DestinationDescription
  54. {
  55. get => Get<String>();
  56. set => Set(value);
  57. }
  58. #endregion
  59. public DateTime Filled
  60. {
  61. get => Get<DateTime>();
  62. set => Set(value);
  63. }
  64. #region Job Settings
  65. public Guid JobID
  66. {
  67. get => Get<Guid>();
  68. set => Set(value);
  69. }
  70. public String JobNumber
  71. {
  72. get => Get<String>();
  73. set
  74. {
  75. Set(value,false);
  76. DoPropertyChanged(nameof(JobDisplay));
  77. }
  78. }
  79. public String JobName
  80. {
  81. get => Get<String>();
  82. set
  83. {
  84. Set(value,false);
  85. DoPropertyChanged(nameof(JobDisplay));
  86. }
  87. }
  88. #endregion
  89. #region RequestedBy Settings
  90. public Guid RequestedByID
  91. {
  92. get => Get<Guid>();
  93. set => Set(value);
  94. }
  95. public String RequestedByName
  96. {
  97. get => Get<String>();
  98. set => Set(value);
  99. }
  100. #endregion
  101. #region Calculated Fields
  102. public String JobDisplay => JobID != Guid.Empty
  103. ? $"{JobNumber}: {JobName}"
  104. : "";
  105. public override string ToString()
  106. {
  107. return ID != Guid.Empty
  108. ? $"{Number}: {Title} {(JobID != Guid.Empty ? "("+JobNumber+")" : "")}"
  109. : "New Requisition";
  110. }
  111. #endregion
  112. }
  113. }