Example #1
0
        public static void ProcessMenuInput()
        {
            int userInput;

            int.TryParse(Console.ReadLine(), out userInput);
            switch (userInput)
            {
            case 1:
                if (ShopManager.WorkingHours())
                {
                    Customer newCustomer = new Customer();
                    Menu.customers.Add(newCustomer);
                    ShopManager.AcceptNewCustomer(newCustomer);
                }
                else
                {
                    Console.WriteLine($"The Auto Repair Shop will open at 8 am tomorrow! We are not working at night time: {PassMeTime().ToString()}");
                    Menu.DisplayMenu();
                }
                //foreach (object o in customers)
                //{
                //    foreach (PropertyInfo prop in o.GetType().GetProperties())
                //    {
                //        Console.WriteLine(prop.GetValue(o));
                //    }
                //}
                break;

            case 2:
                Customer checkCustomer = ShopManager.GetCurrentCustomer();
                if (checkCustomer != null)
                {
                    Menu.PrintMenuMessage($"The last order was from {checkCustomer.Name}, car - {checkCustomer.MyCar.Name}.");
                    Console.WriteLine();
                    DisplayMenu();
                }
                else
                {
                    Menu.PrintMenuMessage($"No orders were placed!");
                    Console.WriteLine();
                    DisplayMenu();
                }
                break;

            case 3:
                Time.GetGameTimeToScreen();
                DisplayMenu();
                break;

            default:
                break;
            }
        }
 public static void CheckQueue()
 {
     while (true)
     {
         if (ShopManager.CustomersOnHold.Count != 0)
         {
             ShopManager.ResumeWorkingWithCustomer(CustomerQueue <Customer> .Peek(ShopManager.CustomersOnHold));
         }
         if (ShopManager.Customers.Count == 0)
         {
             continue;
         }
         ShopManager.AcceptNewCustomer(CustomerQueue <Customer> .Peek(ShopManager.Customers));
     }
 }