public ModifyInventoryParameters(ILotKey lotKey, IPackagingProductKey packagingProductKey, ILocationKey locationKey, IInventoryTreatmentKey inventoryTreatmentKey, string toteKey, int adjustQuantity) { if (lotKey == null) { throw new ArgumentNullException("lotKey"); } if (packagingProductKey == null) { throw new ArgumentNullException("packagingProductKey"); } if (locationKey == null) { throw new ArgumentNullException("locationKey"); } if (inventoryTreatmentKey == null) { throw new ArgumentNullException("inventoryTreatmentKey"); } InventoryKey = new InventoryKey(lotKey, packagingProductKey, locationKey, inventoryTreatmentKey, toteKey); LotKey = lotKey.ToLotKey(); PackagingProductKey = packagingProductKey.ToPackagingProductKey(); LocationKey = locationKey.ToLocationKey(); InventoryTreatmentKey = inventoryTreatmentKey.ToInventoryTreatmentKey(); ModifyQuantity = adjustQuantity; }
public InventoryPickOrderItemParameter(IProductKey productKey, IPackagingProductKey packagingProductKey, IInventoryTreatmentKey treatmentKey, int quantity, ICustomerKey customer, string customerProductCode, string customerLotCode) { ProductId = productKey.ProductKey_ProductId; PackagingProductId = packagingProductKey.PackagingProductKey_ProductId; TreatmentId = treatmentKey == null ? (int?)null : treatmentKey.InventoryTreatmentKey_Id; Quantity = quantity; CustomerKey = customer != null ? new CustomerKey(customer) : null; CustomerProductCode = customerProductCode; CustomerLotCode = customerLotCode; }
internal LotPackagingKeyValueQuantity(ILotKey lot, IPackagingProductKey packaging, int quantity) { var lotKey = new LotKey(lot); LotKeyValue = lotKey.KeyValue; LotPredicateExpression = lotKey.FindByPredicate; LotPredicate = lotKey.FindByPredicate.Compile(); var packagingKey = new PackagingProductKey(packaging); PackagingKeyValue = packagingKey.KeyValue; PackagingPredicateExpression = packagingKey.FindByPredicate; PackagingPredicate = packagingKey.FindByPredicate.Compile(); Quantity = quantity; }
internal static PackSchedule SetPackagingProduct(this PackSchedule packSchedule, IPackagingProductKey packagingProductKey) { if (packSchedule == null) { throw new ArgumentNullException("packSchedule"); } packSchedule.PackagingProduct = null; packSchedule.PackagingProductId = packagingProductKey.PackagingProductKey_ProductId; return(packSchedule); }
internal static SalesOrderItem ConstrainByKeys(this SalesOrderItem item, ISalesOrderKey order = null, IContractItemKey contractItem = null, IChileProductKey chileProduct = null, IPackagingProductKey packagingProduct = null, IInventoryTreatmentKey treatment = null) { if (item == null) { throw new ArgumentNullException("item"); } if (order != null) { item.Order = null; item.DateCreated = order.SalesOrderKey_DateCreated; item.Sequence = order.SalesOrderKey_Sequence; if (item.InventoryPickOrderItem != null) { item.InventoryPickOrderItem.InventoryPickOrder = null; } } if (contractItem != null) { item.ContractItem = null; item.ContractYear = contractItem.ContractKey_Year; item.ContractSequence = contractItem.ContractKey_Sequence; item.ContractItemSequence = contractItem.ContractItemKey_Sequence; } if (chileProduct != null) { item.InventoryPickOrderItem.Product = null; item.InventoryPickOrderItem.ProductId = chileProduct.ChileProductKey_ProductId; } if (packagingProduct != null) { item.InventoryPickOrderItem.PackagingProduct = null; item.InventoryPickOrderItem.PackagingProductId = packagingProduct.PackagingProductKey_ProductId; } if (treatment != null) { item.InventoryPickOrderItem.InventoryTreatment = null; item.InventoryPickOrderItem.TreatmentId = treatment.InventoryTreatmentKey_Id; } return(item); }
internal static InventoryPickOrderItem SetPackaging(this InventoryPickOrderItem item, IPackagingProductKey packaging) { if (item == null) { throw new ArgumentNullException("item"); } item.PackagingProduct = null; item.PackagingProductId = packaging.PackagingProductKey_ProductId; return(item); }
public ProductKey(IPackagingProductKey packagingProductKey) : base(packagingProductKey.PackagingProductKey_ProductId) { }
internal static PickedInventoryItem ConstrainByKeys(this PickedInventoryItem item, IPickedInventoryKey pickedInventoryKey = null, ILotKey lotKey = null, IPackagingProductKey packagingProductKey = null, IInventoryTreatmentKey treatmentKey = null, ILocationKey sourceLocationKey = null, ILocationKey currentLocationKey = null, string toteKey = null) { if (item == null) { throw new ArgumentNullException("item"); } if (pickedInventoryKey != null) { item.PickedInventory = null; item.DateCreated = pickedInventoryKey.PickedInventoryKey_DateCreated; item.Sequence = pickedInventoryKey.PickedInventoryKey_Sequence; } if (lotKey != null) { item.Lot = null; item.LotDateCreated = lotKey.LotKey_DateCreated; item.LotDateSequence = lotKey.LotKey_DateSequence; item.LotTypeId = lotKey.LotKey_LotTypeId; } if (packagingProductKey != null) { item.PackagingProduct = null; item.PackagingProductId = packagingProductKey.PackagingProductKey_ProductId; } if (treatmentKey != null) { item.Treatment = null; item.TreatmentId = treatmentKey.InventoryTreatmentKey_Id; } if (sourceLocationKey != null) { item.FromLocation = null; item.FromLocationId = sourceLocationKey.LocationKey_Id; } if (currentLocationKey != null) { item.CurrentLocation = null; item.CurrentLocationId = currentLocationKey.LocationKey_Id; } if (toteKey != null) { item.ToteKey = toteKey; } return(item); }
public InventoryKey(ILotKey lotKey, IPackagingProductKey packagingProductKey, ILocationKey locationKey, IInventoryTreatmentKey treatmentKey, string toteKey) : this(lotKey.LotKey_DateCreated, lotKey.LotKey_DateSequence, lotKey.LotKey_LotTypeId, packagingProductKey.PackagingProductKey_ProductId, locationKey.LocationKey_Id, treatmentKey.InventoryTreatmentKey_Id, toteKey) { }
public static PackagingProductKey ToPackagingProductKey(this IPackagingProductKey k) { return(new PackagingProductKey(k)); }
internal static Inventory ConstrainByKeys(this Inventory inventory, ILotKey lotKey = null, IPackagingProductKey packagingProductKey = null, ILocationKey locationKey = null, IInventoryTreatmentKey treatment = null, IFacilityKey facility = null, string toteKey = null) { if (inventory == null) { throw new ArgumentNullException("inventory"); } if (lotKey != null) { inventory.Lot = null; inventory.LotDateCreated = lotKey.LotKey_DateCreated; inventory.LotDateSequence = lotKey.LotKey_DateSequence; inventory.LotTypeId = lotKey.LotKey_LotTypeId; } if (packagingProductKey != null) { inventory.PackagingProduct = null; inventory.PackagingProductId = packagingProductKey.PackagingProductKey_ProductId; } if (locationKey != null) { inventory.Location = null; inventory.LocationId = locationKey.LocationKey_Id; } if (treatment != null) { inventory.Treatment = null; inventory.TreatmentId = treatment.InventoryTreatmentKey_Id; } if (facility != null) { if (inventory.Location == null) { throw new ArgumentNullException("warehouseLocation is null. Maybe you tried constraining by both the LocationKey and FacilityKey. Can't do that. Pick one or the other. -RI"); } inventory.Location.Facility = null; inventory.Location.FacilityId = facility.FacilityKey_Id; } if (toteKey != null) { inventory.ToteKey = toteKey; } return(inventory); }
internal static LotProductionResultItem Set(this LotProductionResultItem item, ILotKey lotKey, IPackagingProductKey packagingKey = null) { if (item == null) { throw new ArgumentNullException("item"); } if (lotKey != null) { item.ProductionResults = null; item.LotDateCreated = lotKey.LotKey_DateCreated; item.LotDateSequence = lotKey.LotKey_DateSequence; item.LotTypeId = lotKey.LotKey_LotTypeId; } if (packagingKey != null) { item.PackagingProduct = null; item.PackagingProductId = packagingKey.PackagingProductKey_ProductId; } return(item); }