Exemple #1
0
 internal PickedInventoryParameters(IInventoryKey inventoryKey, int quantity, string customerLotCode, string customerProductCode)
 {
     InventoryKey        = new InventoryKey(inventoryKey);
     CurrentLocationKey  = new LocationKey(InventoryKey);
     Quantity            = quantity;
     CustomerLotCode     = customerLotCode;
     CustomerProductCode = customerProductCode;
 }
 internal ParamsItem(IInventoryKey inventoryKey)
 {
     LotKey = inventoryKey.ToLotKey();
     WarehouseLocationKey = inventoryKey.ToLocationKey();
     PackagingProductKey  = inventoryKey.ToPackagingProductKey();
     TreatmentKey         = inventoryKey.ToInventoryTreatmentKey();
     ToteKey = inventoryKey.InventoryKey_ToteKey;
 }
Exemple #3
0
 internal PickedInventoryParameters(IInventoryPickOrderItemKey orderItemKey, IInventoryKey inventoryKey, int quantity, string customerLotCode, string customerProductCode)
     : this(inventoryKey, quantity, customerLotCode, customerProductCode)
 {
     if (orderItemKey != null)
     {
         OrderItemKey = new InventoryPickOrderItemKey(orderItemKey);
     }
 }
        public ModifyPickedInventoryItemParameters(IInventoryKey inventoryKey, ILocationKey currentLocationKey, int quantity, string customerLotCode, string customerProductCode, IInventoryPickOrderItemKey orderItemKey = null)
        {
            InventoryKey       = inventoryKey.ToInventoryKey();
            CurrentLocationKey = currentLocationKey != null?currentLocationKey.ToLocationKey() : inventoryKey.ToLocationKey();

            OrderItemKey        = orderItemKey == null ? null : orderItemKey.ToInventoryPickOrderItemKey();
            NewQuantity         = quantity;
            OriginalQuantity    = 0;
            CustomerLotCode     = customerLotCode;
            CustomerProductCode = customerProductCode;
        }
        public MoveInventoryCommandParameters(IInventoryKey sourceInventoryKey, ILocationKey destinationWarehouseLocationKey, int moveQuantity)
        {
            if (sourceInventoryKey == null)
            {
                throw new ArgumentNullException("sourceInventoryKey");
            }
            if (destinationWarehouseLocationKey == null)
            {
                throw new ArgumentNullException("destinationWarehouseLocationKey");
            }

            SourceInventoryKey     = new InventoryKey(sourceInventoryKey);
            DestinationLocationKey = new LocationKey(destinationWarehouseLocationKey);
            MoveQuantity           = moveQuantity;
        }
 public ModifyInventoryParameters(IInventoryKey inventoryKey, int adjustQuantity)
     : this(inventoryKey, inventoryKey, inventoryKey, inventoryKey, inventoryKey.InventoryKey_ToteKey, adjustQuantity)
 {
 }
        internal static Expression <Func <InventoryTransaction, bool> > ByInventoryKey(IInventoryKey inventoryKey)
        {
            var lot       = new LotKey(inventoryKey).FindByPredicate;
            var location  = new LocationKey(inventoryKey).FindByPredicate;
            var packaging = new PackagingProductKey(inventoryKey).FindByPredicate;
            var treatment = new InventoryTreatmentKey(inventoryKey).FindByPredicate;

            return(Projector <InventoryTransaction> .To(i =>
                                                        lot.Invoke(i.SourceLot) &&
                                                        location.Invoke(i.Location) &&
                                                        packaging.Invoke(i.PackagingProduct) &&
                                                        treatment.Invoke(i.Treatment) &&
                                                        i.ToteKey == inventoryKey.InventoryKey_ToteKey));
        }
 public ModifySalesOrderPickedInventoryItemParameters(IInventoryPickOrderItemKey orderItemKey, IInventoryKey inventoryKey, int quantity, string customerLotCode, string customerProductCode)
     : base(inventoryKey, null, quantity, customerLotCode, customerProductCode)
 {
     if (orderItemKey != null)
     {
         SalesOrderItemKey = new SalesOrderItemKey(orderItemKey);
     }
 }
 public NewPickedInventory(IInventoryKey inventoryKey, int quantity, ILocationKey currentLocationKey)
 {
     InventoryKey       = new InventoryKey(inventoryKey);
     QuantityPicked     = quantity;
     CurrentLocationKey = new LocationKey(currentLocationKey);
 }
Exemple #10
0
        internal IResult <InventoryTransaction> Create(InventoryTransactionParameters parameters, IInventoryKey inventoryKey, int quantity)
        {
            var date              = parameters.TimeStamp.Date;
            var sequence          = new EFUnitOfWorkHelper(_coreUnitOfWork).GetNextSequence <InventoryTransaction>(t => t.DateCreated == date, t => t.Sequence);
            var setDestinationLot = quantity < 0 && parameters.DestinationLotKey != null;

            var transaction = _coreUnitOfWork.InventoryTransactionsRepository.Add(new InventoryTransaction
            {
                DateCreated     = date,
                Sequence        = sequence,
                EmployeeId      = parameters.EmployeeKey.EmployeeKey_Id,
                TimeStamp       = parameters.TimeStamp,
                TransactionType = parameters.TransactionType,
                Description     = parameters.Description,
                SourceReference = parameters.SourceReference,

                SourceLotDateCreated  = inventoryKey.LotKey_DateCreated,
                SourceLotDateSequence = inventoryKey.LotKey_DateSequence,
                SourceLotTypeId       = inventoryKey.LotKey_LotTypeId,
                PackagingProductId    = inventoryKey.PackagingProductKey_ProductId,
                LocationId            = inventoryKey.LocationKey_Id,
                TreatmentId           = inventoryKey.InventoryTreatmentKey_Id,
                ToteKey = inventoryKey.InventoryKey_ToteKey,

                DestinationLotDateCreated  = setDestinationLot ? parameters.DestinationLotKey.LotKey_DateCreated : (DateTime?)null,
                DestinationLotDateSequence = setDestinationLot ? parameters.DestinationLotKey.LotKey_DateSequence : (int?)null,
                DestinationLotTypeId       = setDestinationLot ? parameters.DestinationLotKey.LotKey_LotTypeId : (int?)null,

                Quantity = quantity
            });

            return(new SuccessResult <InventoryTransaction>(transaction));
        }
Exemple #11
0
 public static Expression <Func <LotProductionResultItem, bool> > FilterByInventoryKey(IInventoryKey inventoryKey)
 {
     return(i => i.LotDateCreated == inventoryKey.LotKey_DateCreated &&
            i.LotDateSequence == inventoryKey.LotKey_DateSequence &&
            i.LotTypeId == inventoryKey.LotKey_LotTypeId &&
            i.LocationId == inventoryKey.LocationKey_Id &&
            i.PackagingProductId == inventoryKey.PackagingProductKey_ProductId &&
            i.TreatmentId == inventoryKey.InventoryTreatmentKey_Id);
 }
Exemple #12
0
        internal static PickedInventoryItem SetToInventory(this PickedInventoryItem item, IInventoryKey inventoryKey)
        {
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }
            if (inventoryKey == null)
            {
                throw new ArgumentNullException("inventoryKey");
            }

            return(item.ConstrainByKeys(null, inventoryKey, inventoryKey, inventoryKey, inventoryKey, inventoryKey, inventoryKey.InventoryKey_ToteKey));
        }
 public static InventoryKey ToInventoryKey(this IInventoryKey k)
 {
     return(new InventoryKey(k));
 }
Exemple #14
0
        internal static LotProductionResultItem SetToInventory(this LotProductionResultItem item, IInventoryKey inventoryKey)
        {
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }
            if (inventoryKey == null)
            {
                throw new ArgumentNullException("inventoryKey");
            }

            item.ProductionResults = null;
            item.LotDateCreated    = inventoryKey.LotKey_DateCreated;
            item.LotDateSequence   = inventoryKey.LotKey_DateSequence;
            item.LotTypeId         = inventoryKey.LotKey_LotTypeId;

            item.Location   = null;
            item.LocationId = inventoryKey.LocationKey_Id;

            item.PackagingProduct   = null;
            item.PackagingProductId = inventoryKey.PackagingProductKey_ProductId;

            item.Treatment   = null;
            item.TreatmentId = inventoryKey.InventoryTreatmentKey_Id;

            return(item);
        }