예제 #1
0
        public override void ProcessDelivering(DeliverySheet sheet)
        {
            switch (CurrentProcess)
            {
            case ProcessPacking packing:
                if (!packing.EndTime.HasValue)
                {
                    throw new Exception($"Order currently being PACKED on Packing Machine {packing.MachinePacking.Name}");
                }

                packing.IsCurrent = false;

                var deliveringProcess = Processes.OfType <ProcessDelivering>().First();
                deliveringProcess.DeliverySheetId = sheet.Id;
                deliveringProcess.StartTime       = DateTime.Now;
                deliveringProcess.IsCurrent       = true;
                break;

            default:
                throw new Exception("Order needs to be at PACKED stage to be DISPATCHED");
            }
        }
예제 #2
0
 public abstract void ProcessDelivering(DeliverySheet sheet);