Пример #1
0
        internal OrderQuantumDto ConvertOrderQuantum(OrderQuantum orderQuantum)
        {
            var orderQuantumDto = new OrderQuantumDto()
            {
                Id    = orderQuantum.Id,
                Count = orderQuantum.Count,
                ItemsCountInOnePart = orderQuantum.ItemsCountInOnePart,
                OrderId             = orderQuantum.OrderId,
                ProductionItem      = orderQuantum.ProductionItem != null?ConvertProductionItem(orderQuantum.ProductionItem) : null,
            };

            return(orderQuantumDto);
        }
Пример #2
0
        internal OrderQuantum ConvertOrderQuantum(OrderQuantumDto orderQuantumDto)
        {
            var orderQuantum = new OrderQuantum()
            {
                Count = orderQuantumDto.Count,
                ItemsCountInOnePart = orderQuantumDto.ItemsCountInOnePart,
            };

            if (orderQuantumDto.ProductionItem.Id != null)
            {
                orderQuantum.ProductionItemId = (int)orderQuantumDto.ProductionItem.Id;
            }

            return(orderQuantum);
        }
Пример #3
0
        internal OrderQuantumDto ConvertOrderQuantumForViewing(OrderQuantum orderQuantum)
        {
            var orderQuantumDto = new OrderQuantumDto()
            {
                Id    = orderQuantum.Id,
                Count = orderQuantum.Count,
                ItemsCountInOnePart = orderQuantum.ItemsCountInOnePart,
                OrderId             = orderQuantum.OrderId,
                ProductionItem      = orderQuantum.ProductionItem != null?ConvertProductionItemForViewing(orderQuantum.ProductionItem) : null,
                                          AssemblingDurations              = orderQuantum.AssemblingDurations.Select(a => a.Ticks).ToList(),
                                          AssemblingEndTimes               = orderQuantum.AssemblingEndTimes.Select(a => a.Ticks).ToList(),
                                          AssemblingFullBatchTime          = orderQuantum.AssemblingFullBatchTime.Ticks,
                                          AssemblingFullPartTime           = orderQuantum.AssemblingFullPartTime.Ticks,
                                          AssemblingRemainingFromPartsTime = orderQuantum.AssemblingRemainingFromPartsTime.HasValue ? orderQuantum.AssemblingRemainingFromPartsTime.Value.Ticks : default(long),
                                          AssemblingStartTimes             = orderQuantum.AssemblingStartTimes.Select(a => a.Ticks).ToList(),
                                          MachiningDurations               = orderQuantum.MachiningDurations.Select(a => a.Ticks).ToList(),
                                          MachiningEndTimes               = orderQuantum.MachiningEndTimes.Select(a => a.Ticks).ToList(),
                                          MachiningFullPartTime           = orderQuantum.MachiningFullPartTime.Ticks,
                                          MachiningRemainingFromPartsTime = orderQuantum.MachiningRemainingFromPartsTime.Ticks,
                                          MachiningStartTimes             = orderQuantum.MachiningStartTimes.Select(a => a.Ticks).ToList()
            };

            return(orderQuantumDto);
        }