Пример #1
0
        public static PeriodicConsumption Create(WorkPeriod currentWorkPeriod, IEnumerable <int> warehouseIds)
        {
            var result = new PeriodicConsumption
            {
                WorkPeriodId = currentWorkPeriod.Id,
                Name         = currentWorkPeriod.StartDate + " - " +
                               currentWorkPeriod.EndDate,
                StartDate = currentWorkPeriod.StartDate,
                EndDate   = currentWorkPeriod.EndDate
            };

            result.CreateWarehouseConsumptions(warehouseIds);
            return(result);
        }
Пример #2
0
        public void CreatePeriodicConsumptionItems(int warehouseId, IList <InventoryItem> inventoryItems, PeriodicConsumption previousPc, List <InventoryTransaction> transactionItems)
        {
            var warehouseConsumption = WarehouseConsumptions.Single(x => x.WarehouseId == warehouseId);
            var previousWhc          = previousPc != null
                                  ? previousPc.WarehouseConsumptions.SingleOrDefault(x => x.WarehouseId == warehouseConsumption.WarehouseId)
                                  : null;

            warehouseConsumption.CreatePeriodicConsumptionItems(inventoryItems, previousWhc, transactionItems);
        }