|
@@ -84,5 +84,68 @@ namespace PRS.Mobile
|
|
|
App.Data.ProductDimensionUnits.FirstOrDefault(x => x.ID == DimensionsUnitID);
|
|
|
|
|
|
|
|
|
+ }
|
|
|
+
|
|
|
+ public class ProductLookupShell : Shell<ProductLookupModel, Product>
|
|
|
+ {
|
|
|
+ protected override void ConfigureColumns(ShellColumns<ProductLookupModel, Product> columns)
|
|
|
+ {
|
|
|
+ columns
|
|
|
+ .Map(nameof(Code), x => x.Code)
|
|
|
+ .Map(nameof(Name), x => x.Name)
|
|
|
+ .Map(nameof(GroupID), x => x.Group.ID)
|
|
|
+ .Map(nameof(GroupCode), x => x.Group.Code)
|
|
|
+ .Map(nameof(GroupDescription), x => x.Group.Description)
|
|
|
+ .Map(nameof(DimensionsUnitID), x => x.DefaultInstance.Dimensions.Unit.ID)
|
|
|
+ .Map(nameof(DimensionsQuantity), x => x.DefaultInstance.Dimensions.Quantity)
|
|
|
+ .Map(nameof(DimensionsLength), x => x.DefaultInstance.Dimensions.Length)
|
|
|
+ .Map(nameof(DimensionsWidth), x => x.DefaultInstance.Dimensions.Width)
|
|
|
+ .Map(nameof(DimensionsHeight), x => x.DefaultInstance.Dimensions.Height)
|
|
|
+ .Map(nameof(DimensionsWeight), x => x.DefaultInstance.Dimensions.Weight)
|
|
|
+ .Map(nameof(DimensionsValue), x => x.DefaultInstance.Dimensions.Value)
|
|
|
+ .Map(nameof(DimensionsUnitSize), x => x.DefaultInstance.Dimensions.UnitSize)
|
|
|
+ .Map(nameof(DefaultStyleID), x => x.DefaultInstance.Style.ID)
|
|
|
+ .Map(nameof(DefaultStyleCode), x => x.DefaultInstance.Style.Code)
|
|
|
+ .Map(nameof(DefaultStyleDescription), x => x.DefaultInstance.Style.Description)
|
|
|
+ .Map(nameof(Units), x => x.UnitQty)
|
|
|
+ .Map(nameof(TotalStock), x => x.TotalStock)
|
|
|
+ .Map(nameof(ReservedStock), x => x.ReservedStock)
|
|
|
+ .Map(nameof(AverageCost), x => x.DefaultInstance.AverageCost);
|
|
|
+ ;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static Filter<Product> AllProducts => LookupFactory.DefineFilter<Product>();
|
|
|
+
|
|
|
+ public string Code => Get<string>();
|
|
|
+ public string Name => Get<string>();
|
|
|
+
|
|
|
+ public Guid GroupID => Get<Guid>();
|
|
|
+ public String GroupCode => Get<String>();
|
|
|
+ public String GroupDescription => Get<String>();
|
|
|
+
|
|
|
+ public Guid DefaultStyleID => Get<Guid>();
|
|
|
+ public String DefaultStyleCode => Get<String>();
|
|
|
+ public String DefaultStyleDescription => Get<String>();
|
|
|
+
|
|
|
+ public Guid DimensionsUnitID => Get<Guid>();
|
|
|
+ public double DimensionsQuantity => Row.Get<Product,double>(x => x.DefaultInstance.Dimensions.Quantity);
|
|
|
+ public double DimensionsLength => Row.Get<Product,double>(x => x.DefaultInstance.Dimensions.Length);
|
|
|
+ public double DimensionsWidth => Row.Get<Product,double>(x => x.DefaultInstance.Dimensions.Width);
|
|
|
+ public double DimensionsHeight => Row.Get<Product,double>(x => x.DefaultInstance.Dimensions.Height);
|
|
|
+ public double DimensionsWeight => Row.Get<Product,double>(x => x.DefaultInstance.Dimensions.Weight);
|
|
|
+ public double DimensionsValue => Row.Get<Product,double>(x => x.DefaultInstance.Dimensions.Value);
|
|
|
+ public string DimensionsUnitSize => Row.Get<Product,string>(x => x.DefaultInstance.Dimensions.UnitSize);
|
|
|
+
|
|
|
+ public double AverageCost => Get<double>();
|
|
|
+
|
|
|
+ public double Units => Get<double>();
|
|
|
+ public double TotalStock => Get<double>();
|
|
|
+ public double ReservedStock => Get<double>();
|
|
|
+ public double AvailableStock => TotalStock - ReservedStock;
|
|
|
+
|
|
|
+ public ProductDimensionUnitShell DimensionsUnit =>
|
|
|
+ App.Data.ProductDimensionUnits.FirstOrDefault(x => x.ID == DimensionsUnitID);
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
}
|