internal static Inventory ToInventory(this ChileMaterialsReceivedItem item, IInventoryTreatmentKey treatment) { return(new Inventory { Quantity = item.Quantity }.ConstrainByKeys(item.ChileMaterialsReceived, item, item, treatment, null, item.ToteKey)); }
internal static ModifyInventoryParameters ToAddInventoryParameters(this ChileMaterialsReceivedItem item, IInventoryTreatmentKey treatment) { if (item == null) { throw new ArgumentNullException("item"); } return(new ModifyInventoryParameters(item, item, item, treatment, item.ToteKey, item.Quantity)); }
public ChileMaterialsReceivedItemParameters(ChileMaterialsReceivedItem item) { ItemKey = item.ToChileMaterialsReceivedItemKey(); ToteKey = item.ToteKey; Quantity = item.Quantity; PackagingProductKey = item.ToPackagingProductKey(); Variety = item.ChileVariety; GrowerCode = item.GrowerCode; LocationKey = item.ToLocationKey(); }
internal static ChileMaterialsReceivedItem ConstrainByKeys(this ChileMaterialsReceivedItem item, ILotKey lotKey = null) { if (item == null) { throw new ArgumentNullException("item"); } if (lotKey != null) { item.ChileMaterialsReceived = null; item.LotDateCreated = lotKey.LotKey_DateCreated; item.LotDateSequence = lotKey.LotKey_DateSequence; item.LotTypeId = lotKey.LotKey_LotTypeId; } return(item); }
internal static void AssertAsExpected(this ICreateChileMaterialsReceivedItemParameters parameters, ChileMaterialsReceivedItem item) { Assert.AreEqual(parameters.GrowerCode, item.GrowerCode); Assert.AreEqual(parameters.ToteKey, item.ToteKey); Assert.AreEqual(parameters.Quantity, item.Quantity); Assert.AreEqual(parameters.Variety, item.ChileVariety); Assert.AreEqual(parameters.PackagingProductKey, new PackagingProductKey(item).KeyValue); Assert.AreEqual(parameters.LocationKey, new LocationKey(item).KeyValue); }