Ejemplo n.º 1
0
        public IResult <IEnumerable <IProductionScheduleReportReturn> > GetProductionScheduleReport(DateTime productionDate, string productionLocationKey)
        {
            ILocationKey locationKey = null;

            if (!string.IsNullOrWhiteSpace(productionLocationKey))
            {
                var keyResult = KeyParserHelper.ParseResult <ILocationKey>(productionLocationKey);
                if (!keyResult.Success)
                {
                    return(keyResult.ConvertTo <IEnumerable <IProductionScheduleReportReturn> >());
                }
                locationKey = keyResult.ResultingObject;
            }

            var predicate = ProductionSchedulePredicates.ByProductionDate(productionDate);

            if (locationKey != null)
            {
                predicate = predicate.AndExpanded(ProductionSchedulePredicates.ByProductionLineLocationKey(locationKey));
            }
            var result = _productionUnitOfWork.ProductionScheduleRepository
                         .Filter(predicate)
                         .SplitSelect(ProductionScheduleProjectors.SelectReport())
                         .ToList();

            return(new SuccessResult <IEnumerable <IProductionScheduleReportReturn> >(result));
        }
        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(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;
        }
        internal static PackSchedule SetProductionLine(this PackSchedule packSchedule, ILocationKey productionLine)
        {
            if (packSchedule == null)
            {
                throw new ArgumentNullException("packSchedule");
            }

            packSchedule.ProductionLineLocation   = null;
            packSchedule.ProductionLineLocationId = productionLine.LocationKey_Id;

            return(packSchedule);
        }
Ejemplo n.º 6
0
 internal static ProductionSchedule SetProductionLine(this ProductionSchedule productionSchedule, ILocationKey location)
 {
     productionSchedule.ProductionLineLocation   = null;
     productionSchedule.ProductionLineLocationId = location.LocationKey_Id;
     return(productionSchedule);
 }
Ejemplo n.º 7
0
 public NewPickedInventory(IInventoryKey inventoryKey, int quantity, ILocationKey currentLocationKey)
 {
     InventoryKey       = new InventoryKey(inventoryKey);
     QuantityPicked     = quantity;
     CurrentLocationKey = new LocationKey(currentLocationKey);
 }
 internal static Expression <Func <ProductionSchedule, bool> > ByProductionLineLocationKey(ILocationKey locationKey)
 {
     return(p => p.ProductionLineLocationId == locationKey.LocationKey_Id);
 }
Ejemplo n.º 9
0
        internal static PickedInventoryItem SetFromLocation(this PickedInventoryItem item, ILocationKey fromLocationKey)
        {
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }

            item.FromLocation   = null;
            item.FromLocationId = fromLocationKey.LocationKey_Id;

            return(item);
        }
Ejemplo n.º 10
0
        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);
        }
Ejemplo n.º 11
0
 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)
 {
 }
Ejemplo n.º 12
0
 public static LocationKey ToLocationKey(this ILocationKey k)
 {
     return(new LocationKey(k));
 }
Ejemplo n.º 13
0
        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 ModifyInventoryParameters ToModifyInventoryDestinationParameters(this PickedInventoryItem item, ILocationKey destinationLocation, IInventoryTreatmentKey newTreamentKey = null)
 {
     return(new ModifyInventoryParameters(item, item, destinationLocation, newTreamentKey ?? item, item.ToteKey, item.Quantity));
 }