コード例 #1
0
        public void AddNewElectricCar()
        {
            TypeOfCar electric = new TypeOfCar();

            Console.WriteLine("What is the Make of you car?");
            electric.CarType = Console.ReadLine();

            Console.WriteLine("What is the Color of your car?");
            electric.CarColor = Console.ReadLine();

            Console.WriteLine("What is the Year of your car?");
            electric.YearOfCar = int.Parse(Console.ReadLine());


            _carRepo.AddElectricCar(electric);
        }
コード例 #2
0
        public void AddNewGasCar()
        {
            TypeOfCar gasCar = new TypeOfCar();

            Console.WriteLine("What is the Make of you car?");
            gasCar.CarType = Console.ReadLine();

            Console.WriteLine("What is the Color of your car?");
            gasCar.CarColor = Console.ReadLine();

            Console.WriteLine("What is the Year of your car?");
            gasCar.YearOfCar = int.Parse(Console.ReadLine());


            _carRepo.AddGasCar(gasCar);
        }
コード例 #3
0
        public void UpdateElectricCar()
        {
            ViewElectricCars();
            Console.WriteLine("Would you like to Update your account:" +
                              "1. Yes\n" +
                              "2. No.");
            int    number   = int.Parse(Console.ReadLine());
            string carType  = null;
            string carColor = null;
            int    carYear  = 0;

            if (number == 1)
            {
                Console.WriteLine("Please Enter the Make of the car.");
                carType = Console.ReadLine();
                Console.WriteLine("Please Enter the Color of the car");
                carColor = Console.ReadLine();
                Console.WriteLine("Please Enter Car Year.");
                carYear = int.Parse(Console.ReadLine());

                _carRepo.RemoveUpdateElectricCarBySpecifications(carType, carColor, carYear);
            }
            else
            {
                Console.WriteLine("thanks come again.");
            }

            TypeOfCar electric = new TypeOfCar();

            electric.CarType   = carType;
            electric.CarType   = carColor;
            electric.YearOfCar = carYear;
            Console.WriteLine("What is the Make of you car?");
            electric.CarType = Console.ReadLine();

            Console.WriteLine("What is the Color of your car?");
            electric.CarColor = Console.ReadLine();

            Console.WriteLine("What is the Year of your car?");
            electric.YearOfCar = int.Parse(Console.ReadLine());

            _carRepo.AddElectricCar(electric);
        }
コード例 #4
0
 public void RemoveGasCarInformation(TypeOfCar gasCar)
 {
     _gasCar.Remove(gasCar);
 }
コード例 #5
0
 public void AddGasCar(TypeOfCar gasCar)
 {
     _gasCar.Add(gasCar);
 }
コード例 #6
0
 public void RemoveHybridCarInformation(TypeOfCar hybridCar)
 {
     _electricCar.Remove(hybridCar);
 }
コード例 #7
0
 public void AddHybridCar(TypeOfCar hybridCar)
 {
     _hybridCar.Add(hybridCar);
 }
コード例 #8
0
 public void RemoveElectricCarInformation(TypeOfCar electricCar)
 {
     _electricCar.Remove(electricCar);
 }
コード例 #9
0
 public void AddElectricCar(TypeOfCar electricCar)
 {
     _electricCar.Add(electricCar);
 }