Beispiel #1
0
        //Note: Ideally once schedule is loaded through schedule engine, it will be persisted in a DB so we would not need to load it again from file system
        Schedule GetScheduleToLoadOrder()
        {
            var fileProcessor = FileProcessorFactory.GetFileProcessor(ConfigurationManager.AppSettings["scheduleFile"]);
            var content       = fileProcessor.GetFileContent();

            var scheduleManager = new ScheduleManager();

            return(scheduleManager.Import(content));
        }
Beispiel #2
0
        public override void DoWork()
        {
            // Import Schedule : assumption from a json file
            var fileProcessor = FileProcessorFactory.GetFileProcessor(FilePath);
            var content       = fileProcessor.GetFileContent();

            // Import Schedule
            var schedule = ScheduleManager.Import(content);

            // Display Schedule
            ScheduleManager.Print(schedule);
        }
Beispiel #3
0
        public override void DoWork()
        {
            // Get File contect
            var fileProcessor = FileProcessorFactory.GetFileProcessor(FilePath);
            var content       = fileProcessor.GetFileContent();

            // Import order
            var orders = OrderManager.Import(content);

            // as part of this engine schedule needs to be referenced too, so we can assign order to scheduled flights
            // so loaded schedule again
            var schedule = GetScheduleToLoadOrder();
            // Map Order to Schedule
            var mapOrderToFlights = OrderManager.MapOrderToFlights(schedule, orders);

            OrderManager.Print(mapOrderToFlights);
        }