RequisitionItemShell.cs 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  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(JobID), 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(LocationID), x=>x.Location.ID)
  30. .Map(nameof(JobRequisitionItemID), x=>x.JobRequisitionItem.ID)
  31. .Map(nameof(ActualQuantity), x => x.ActualQuantity)
  32. .Map(nameof(ImageID), x=>x.Image.ID)
  33. ;
  34. }
  35. public Guid RequisitionID
  36. {
  37. get => Get<Guid>();
  38. set => Set(value);
  39. }
  40. public Guid JobID
  41. {
  42. get => Get<Guid>();
  43. set => Set(value);
  44. }
  45. public Guid ProductID
  46. {
  47. get => Get<Guid>();
  48. set => Set(value);
  49. }
  50. public String ProductCode
  51. {
  52. get => Get<String>();
  53. set => Set(value);
  54. }
  55. public String ProductName
  56. {
  57. get => Get<String>();
  58. set => Set(value);
  59. }
  60. public Guid StyleID
  61. {
  62. get => Get<Guid>();
  63. set => Set(value);
  64. }
  65. public String StyleCode
  66. {
  67. get => Get<String>();
  68. set => Set(value);
  69. }
  70. public String StyleDescription
  71. {
  72. get => Get<String>();
  73. set => Set(value);
  74. }
  75. public Guid DimensionsUnitID
  76. {
  77. get => Get<Guid>();
  78. set => Set(value);
  79. }
  80. public double DimensionsQuantity
  81. {
  82. get => Get<double>();
  83. set => Set(value);
  84. }
  85. public double DimensionsLength
  86. {
  87. get => Get<double>();
  88. set => Set(value);
  89. }
  90. public double DimensionsWidth
  91. {
  92. get => Get<double>();
  93. set => Set(value);
  94. }
  95. public double DimensionsHeight
  96. {
  97. get => Get<double>();
  98. set => Set(value);
  99. }
  100. public double DimensionsWeight
  101. {
  102. get => Get<double>();
  103. set => Set(value);
  104. }
  105. public double DimensionsValue
  106. {
  107. get => Get<double>();
  108. set => Set(value);
  109. }
  110. public string DimensionsUnitSize
  111. {
  112. get => Get<string>();
  113. set => Set(value);
  114. }
  115. public String Description
  116. {
  117. get => Get<String>();
  118. set => Set(value);
  119. }
  120. public double Quantity
  121. {
  122. get => Get<double>();
  123. set => Set(value);
  124. }
  125. public double ActualQuantity
  126. {
  127. get => Get<double>();
  128. set => Set(value);
  129. }
  130. public Guid LocationID
  131. {
  132. get => Get<Guid>();
  133. set => Set(value);
  134. }
  135. public Guid JobRequisitionItemID
  136. {
  137. get => Get<Guid>();
  138. set => Set(value);
  139. }
  140. public Guid ImageID
  141. {
  142. get => Get<Guid>();
  143. set => Set(value);
  144. }
  145. public byte[] Image => Parent.GetImage(ImageID);
  146. public String ProductDisplay() => ProductID != Guid.Empty
  147. ? $"{ProductCode}: {ProductName}"
  148. : "";
  149. public String StyleDisplay() => StyleID != Guid.Empty
  150. ? $"{StyleCode}: {StyleDescription}"
  151. : "";
  152. }
  153. }