Ejemplo n.º 1
0
        private static void changeVehicleStatus(string i_LicensePlateNumber, string i_NewStatus)
        {
            bool hasChangedStatus = m_Garage.ChangeVehicleStatus(i_LicensePlateNumber, i_NewStatus);

            if (hasChangedStatus)
            {
                Console.WriteLine("Vehicle's Status was set to '{0}'", i_NewStatus);
            }
            else
            {
                Console.WriteLine("Vehicle's Status was already set to '{0}'", i_NewStatus);
            }
        }
        private static void changeVehicleStatusAccordingThekey(GarageLogic.Garage i_Garage)
        {
            showVehiclesStatusOptions();
            GarageLogic.GarageVehicleStatus key = GarageLogic.GarageVehicleStatus.Parse(UserInputOutput.ReadLine());
            while (key.VehicleStatus == GarageLogic.eGarageVehicleStatus.AllStatuses)
            {
                UserInputOutput.ClearScreen();
                UserInputOutput.WriteLine(
                    @"
You can't change a vehicle's status to all statuses, choose only one statuse please!");
                showVehiclesStatusOptions();
                key = GarageLogic.GarageVehicleStatus.Parse(UserInputOutput.ReadLine());
            }

            string licenseNumber = getUserInputOfVehicleLicenceNumberIfItExistsInGarage(i_Garage);

            if (!s_InterruptCurrTask)
            {
                i_Garage.ChangeVehicleStatus(licenseNumber, key);
            }
        }