Пример #1
0
        public void OpenGarage()
        {
            UI.eUserChoice choice        = new UI.eUserChoice();
            bool           v_closeGarage = false;

            Ui.PrintSignToUser(string.Format("Welcome to Brian O'Conner and Turto's garage"));

            do
            {
                try
                {
                    choice = (UI.eUserChoice)m_Ui.PrintAllEnumValuesGetUserChoice(choice, "Menu");
                    m_Ui.ClearConsole();

                    if (choice == UI.eUserChoice.InsertNewCar)
                    {
                        insertNewCar();
                    }
                    else if (choice == UI.eUserChoice.DisplayDriverLicenceNumberWithFilterByStatusOfFix)
                    {
                        displayDriverLicenceNumberWithFilterByStatusOfFix();
                    }
                    else if (choice == UI.eUserChoice.ChangeStatusOfFix)
                    {
                        changeStatusOfFix();
                    }
                    else if (choice == UI.eUserChoice.BlowWheelsToMaximum)
                    {
                        blowWheelsToMax();
                    }
                    else if (choice == UI.eUserChoice.ChargeVehicle)
                    {
                        chargeVehicle();
                    }
                    else if (choice == UI.eUserChoice.DisplayFullDetailsOfVehicleByLicenceNumber)
                    {
                        displayFullVehicleDataByLicenseNumber();
                    }
                    else if (choice == UI.eUserChoice.Exit)
                    {
                        v_closeGarage = true;
                    }
                    else
                    {
                        m_Ui.PrintInvalidErrorWithSpecificError("Chose Wrong Number");
                    }
                }
                catch (ArgumentException ae)
                {
                    m_Ui.PrintNatural(ae.Message);
                }
                catch (FormatException)
                {
                    m_Ui.PrintInvalidErrorWithSpecificError("You need to choose an integer");
                }
            }while (v_closeGarage == false);

            m_Ui.PrintSignToUser("Goodbye Brian O'Conner and Turto's garage It Was A good Time");
        }