RequisitionShell.cs 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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. .Map(nameof(StockUpdated), x => x.StockUpdated)
  25. ;
  26. }
  27. public int Number => Get<int>();
  28. public String Title
  29. {
  30. get => Get<String>();
  31. set => Set(value);
  32. }
  33. public String Request
  34. {
  35. get => Get<String>();
  36. set => Set(value);
  37. }
  38. public String[] Notes
  39. {
  40. get => Get<String[]>();
  41. set => Set(value);
  42. }
  43. public DateTime Due
  44. {
  45. get => Get<DateTime>();
  46. set => Set(value);
  47. }
  48. #region Delivery Method
  49. public Guid DestinationID
  50. {
  51. get => Get<Guid>();
  52. set => Set(value);
  53. }
  54. public String DestinationDescription
  55. {
  56. get => Get<String>();
  57. set => Set(value);
  58. }
  59. #endregion
  60. public DateTime Filled
  61. {
  62. get => Get<DateTime>();
  63. set => Set(value);
  64. }
  65. public DateTime StockUpdated
  66. {
  67. get => Get<DateTime>();
  68. set => Set(value);
  69. }
  70. #region Job Settings
  71. public Guid JobID
  72. {
  73. get => Get<Guid>();
  74. set => Set(value);
  75. }
  76. public String JobNumber
  77. {
  78. get => Get<String>();
  79. set
  80. {
  81. Set(value,false);
  82. DoPropertyChanged(nameof(JobDisplay));
  83. }
  84. }
  85. public String JobName
  86. {
  87. get => Get<String>();
  88. set
  89. {
  90. Set(value,false);
  91. DoPropertyChanged(nameof(JobDisplay));
  92. }
  93. }
  94. #endregion
  95. #region RequestedBy Settings
  96. public Guid RequestedByID
  97. {
  98. get => Get<Guid>();
  99. set => Set(value);
  100. }
  101. public String RequestedByName
  102. {
  103. get => Get<String>();
  104. set => Set(value);
  105. }
  106. #endregion
  107. #region Calculated Fields
  108. public String JobDisplay => JobID != Guid.Empty
  109. ? $"{JobNumber}: {JobName}"
  110. : "";
  111. public override string ToString()
  112. {
  113. return ID != Guid.Empty
  114. ? $"{Number}: {Title} {(JobID != Guid.Empty ? "("+JobNumber+")" : "")}"
  115. : "New Requisition";
  116. }
  117. #endregion
  118. }
  119. }