Пример #1
0
        public void addNewVehicle()
        {
            DataInputScreen      dataInputScreen      = r_Screens[eUIScreens.DataInput] as DataInputScreen;
            NumericalInputScreen numericalInputScreen = r_Screens[eUIScreens.NumericalInput] as NumericalInputScreen;

            ScreenUtils.Clear();

            dataInputScreen.SetMassageToDisplay("Enter Vehicle License Number");
            dataInputScreen.Display(out string licenseNumber);
            r_GarageManager.AddVehicle(licenseNumber);

            VehicleInfo vehicleInfo = r_GarageManager.GetVehicleInfo(licenseNumber);

            try
            {
                string userData;

                dataInputScreen.SetMassageToDisplay("Enter Vehicle Owner Name");
                dataInputScreen.Display(out userData);
                vehicleInfo.VehicleOwnerName = userData;

                numericalInputScreen.SetMassageToDisplay("Enter Vehicle Owner Phone Number");
                numericalInputScreen.Display(out userData);
                vehicleInfo.VehicleOwnerPhoneNumber = userData;

                vehicleInfo.Vehicle = getNewVehicleFromUser(licenseNumber);
            }
            catch (Exception i_Exception)
            {
                ScreenUtils.Display(i_Exception.ToString());
                ScreenUtils.Freeze();
            }
        }
Пример #2
0
        // $G$ DSN-002 (-5) The UI should not know Car\Truck\Motorcycle
        private void getMotorcycleDataFromUser(ref Motorcycle io_Motorcycle)
        {
            string               userInput;
            MenuScreen           licenseTypeScreen    = r_Screens[eUIScreens.LicenseType] as MenuScreen;
            NumericalInputScreen numericalInputScreen = r_Screens[eUIScreens.NumericalInput] as NumericalInputScreen;

            licenseTypeScreen.Display(out userInput);
            eLicenseType licenseType = (eLicenseType)parseMenuOption(userInput);

            io_Motorcycle.LicenseType = licenseType;

            numericalInputScreen.SetMassageToDisplay("Enter Engine Capacity");
            numericalInputScreen.Display(out userInput);
            int engineCapacity = parseMenuOption(userInput);

            io_Motorcycle.EngineCapacity = engineCapacity;
        }