Beispiel #1
0
 public void GetUserChoice()
 {
     int userChoice = UserInteractions.PromptForChoice("Please enter a number (1-5): ", 1, 5);
     switch (userChoice)
     {
         case 1:
             var displayOrdersWorkflow = new DisplayOrderWorkflow();
             displayOrdersWorkflow.Execute();
             break;
         case 2:
             var addOrderWorkflow = new AddOrderWorkflow();
             addOrderWorkflow.Execute();
             break;
         case 3:
             var editOrderWorkflow = new EditOrderWorkflow();
             editOrderWorkflow.Execute();
             break;
         case 4:
             var removeOrderWorkflow = new RemoveOrderWorkflow();
             removeOrderWorkflow.Execute();
             break;
         default:
             _active = false;
             break;
     }
 }
Beispiel #2
0
 private void ProcessUserChoice(string input)
 {
     switch (input)
     {
         case "1":
             var displayOrdersWorkflow = new DisplayOrderWorkflow();
             displayOrdersWorkflow.Execute();
             break;
         case "2":
             var addOrderWorkflow = new AddOrderWorkflow();
             addOrderWorkflow.Execute();
             break;
         case "3":
             var editOrderWorkflow = new EditOrderWorkflow();
             editOrderWorkflow.Execute();
             break;
         case "4":
             var removeOrderWorkflow = new RemoveOrderWorkflow();
             removeOrderWorkflow.Execute();
             break;
     }
 }