コード例 #1
0
        static void delete()
        {
            int deleteType;

            Console.WriteLine("Choose the type of vehicle to be deleted:\n1.Car\n2.Truck\n");
            deleteType = Convert.ToInt32(Console.ReadLine());
            if (deleteType == 1)
            {
                TeslaCar car1 = new TeslaCar();
                car1.CarDelete();
            }
            else
            {
                TeslaTruck truck1 = new TeslaTruck();
                truck1.TruckDelete();
            }
        }
コード例 #2
0
        static void insert()
        {
            int vechicalType;

            Console.WriteLine("Please choose the type of vehical:\n1.Car\n2.Truck\n");
            vechicalType = Convert.ToInt16(Console.ReadLine());
            if (vechicalType == 1)
            {
                TeslaCar car1 = new TeslaCar();
                car1.GetValue();
                car1.CarTypeChoose();
                car1.TypeAssign();
                car1.CarFileSave();
            }
            else
            {
                TeslaTruck truck1 = new TeslaTruck();
                truck1.GetValue();
                truck1.TruckTypeChoose();
                truck1.TypeAssign();
                truck1.TruckFileSave();
            }
        }