コード例 #1
0
        private void insertNewVehicleTGarage()
        {
            Console.WriteLine("Please eneter your car license number: ");
            string licenseNumber = getNotEmptyInput();

            m_VehiclesDictionary["License number"] = licenseNumber;
            try
            {
                m_LogicManager.IsInGarage(licenseNumber);
                Console.WriteLine("Your car is already in the garage,the satus of the car changed to in in repair ");
            }
            catch
            {
                //   m_VehiclesDictionary["License number"] = licenseNumber;

                Console.WriteLine("Enter your name: ");
                //TODO: Onnly Letters, and noe empty string.
                string ownerName = getNotEmptyInput();
                m_VehiclesDictionary["Owner name"] = ownerName;

                Console.WriteLine("Enter your phone number: ");
                string ownerPhone = getIntInput().ToString();
                m_VehiclesDictionary["Owner phone number"] = ownerPhone;

                eSupportedVehicles typeOfVehicle = getTypeOfVehicle();
                m_VehiclesDictionary["Vechile type"] = typeOfVehicle;

                Console.WriteLine("Enter your vechile model name: ");
                //TODO:no empty string.
                string ModelName = getNotEmptyInput();
                m_VehiclesDictionary["Model name"] = ModelName;

                Console.WriteLine("Enter your wheels manufacturer name: ");
                //TODO:no empty string.
                string manufacturerName = getNotEmptyInput();
                m_VehiclesDictionary["Manufacturer name"] = manufacturerName;

                getSpacificDataForVehicle(typeOfVehicle);
            }
            finally
            {
                m_LogicManager.AddCarToGarage((string)m_VehiclesDictionary["License number"], m_VehiclesDictionary);
                Console.WriteLine("Thank you! press enetr to return main menu ");
                Console.ReadLine();
            }
        }