RequisitionItemShell.cs 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. using System;
  2. using Comal.Classes;
  3. using InABox.Mobile;
  4. namespace PRS.Mobile
  5. {
  6. public class RequisitionItemShell : Shell<RequisitionItemModel, RequisitionItem>
  7. {
  8. protected override void ConfigureColumns(ShellColumns<RequisitionItemModel, RequisitionItem> columns)
  9. {
  10. columns
  11. .Map(nameof(RequisitionID), x=>x.RequisitionLink.ID)
  12. .Map(nameof(RequisitionJobID), x=>x.RequisitionLink.JobLink.ID)
  13. .Map(nameof(ProductID), x => x.Product.ID)
  14. .Map(nameof(ProductCode), x => x.Product.Code)
  15. .Map(nameof(ProductName), x => x.Product.Name)
  16. .Map(nameof(StyleID), x => x.Style.ID)
  17. .Map(nameof(StyleCode), x => x.Style.Code)
  18. .Map(nameof(StyleDescription), x => x.Style.Description)
  19. .Map(nameof(DimensionsUnitID), x => x.Dimensions.Unit.ID)
  20. .Map(nameof(DimensionsQuantity), x => x.Dimensions.Quantity)
  21. .Map(nameof(DimensionsLength), x => x.Dimensions.Length)
  22. .Map(nameof(DimensionsHeight), x => x.Dimensions.Height)
  23. .Map(nameof(DimensionsWeight), x => x.Dimensions.Weight)
  24. .Map(nameof(DimensionsWidth), x => x.Dimensions.Width)
  25. .Map(nameof(DimensionsValue), x => x.Dimensions.Value)
  26. .Map(nameof(DimensionsUnitSize), x => x.Dimensions.UnitSize)
  27. .Map(nameof(Description), x => x.Description)
  28. .Map(nameof(Quantity), x => x.Quantity)
  29. .Map(nameof(JobID), x=>x.JobLink.ID)
  30. .Map(nameof(TargetJRI), x=>x.JobRequisitionItem.ID)
  31. .Map(nameof(LocationID), x=>x.Location.ID)
  32. .Map(nameof(SourceJRI), x=>x.SourceJRI.ID)
  33. .Map(nameof(ActualQuantity), x => x.ActualQuantity)
  34. .Map(nameof(ImageID), x=>x.Image.ID)
  35. .Map(nameof(Cost), x=>x.Cost)
  36. .Map(nameof(Done), x=>x.Done)
  37. ;
  38. }
  39. public Guid RequisitionID
  40. {
  41. get => Get<Guid>();
  42. set => Set(value);
  43. }
  44. public Guid RequisitionJobID
  45. {
  46. get => Get<Guid>();
  47. set => Set(value);
  48. }
  49. public Guid ProductID
  50. {
  51. get => Get<Guid>();
  52. set => Set(value);
  53. }
  54. public String ProductCode
  55. {
  56. get => Get<String>();
  57. set => Set(value);
  58. }
  59. public String ProductName
  60. {
  61. get => Get<String>();
  62. set => Set(value);
  63. }
  64. public Guid StyleID
  65. {
  66. get => Get<Guid>();
  67. set => Set(value);
  68. }
  69. public String StyleCode
  70. {
  71. get => Get<String>();
  72. set => Set(value);
  73. }
  74. public String StyleDescription
  75. {
  76. get => Get<String>();
  77. set => Set(value);
  78. }
  79. public Guid DimensionsUnitID
  80. {
  81. get => Get<Guid>();
  82. set => Set(value);
  83. }
  84. public double DimensionsQuantity
  85. {
  86. get => Get<double>();
  87. set => Set(value);
  88. }
  89. public double DimensionsLength
  90. {
  91. get => Get<double>();
  92. set => Set(value);
  93. }
  94. public double DimensionsWidth
  95. {
  96. get => Get<double>();
  97. set => Set(value);
  98. }
  99. public double DimensionsHeight
  100. {
  101. get => Get<double>();
  102. set => Set(value);
  103. }
  104. public double DimensionsWeight
  105. {
  106. get => Get<double>();
  107. set => Set(value);
  108. }
  109. public double DimensionsValue
  110. {
  111. get => Get<double>();
  112. set => Set(value);
  113. }
  114. public string DimensionsUnitSize
  115. {
  116. get => Get<string>();
  117. set => Set(value);
  118. }
  119. public String Description
  120. {
  121. get => Get<String>();
  122. set => Set(value);
  123. }
  124. public double Quantity
  125. {
  126. get => Get<double>();
  127. set => Set(value);
  128. }
  129. public double ActualQuantity
  130. {
  131. get => Get<double>();
  132. set => Set(value);
  133. }
  134. public Guid LocationID
  135. {
  136. get => Get<Guid>();
  137. set => Set(value);
  138. }
  139. public Guid JobID
  140. {
  141. get => Get<Guid>();
  142. set => Set(value);
  143. }
  144. public Guid SourceJRI
  145. {
  146. get => Get<Guid>();
  147. set => Set(value);
  148. }
  149. public Guid TargetJRI
  150. {
  151. get => Get<Guid>();
  152. set => Set(value);
  153. }
  154. public Guid ImageID
  155. {
  156. get => Get<Guid>();
  157. set => Set(value);
  158. }
  159. public double Cost
  160. {
  161. get => Get<double>();
  162. set => Set(value);
  163. }
  164. public bool Done
  165. {
  166. get => Get<bool>();
  167. set => Set(value);
  168. }
  169. public byte[] Image => Parent.GetImage(ImageID);
  170. public String ProductDisplay() => ProductID != Guid.Empty
  171. ? $"{ProductCode}: {ProductName}"
  172. : "";
  173. public String StyleDisplay() => StyleID != Guid.Empty
  174. ? $"{StyleCode}: {StyleDescription}"
  175. : "";
  176. }
  177. }