Ejemplo n.º 1
0
        static void showModel(Garage myGarage)
        {
            int model = 0;

            Console.WriteLine("Model's year to display :");
            while (true)
            {
                if (getInputInt(ref model) == true)
                {
                    break;
                }
                else
                {
                    Console.WriteLine("Invalid input, try entering Model's year again\n");
                }
            }

            List<string> tmp = myGarage.Show(model);

            if (tmp.Count == 0)
            {
                Console.WriteLine("No vehicles with such model year");
            }
            else
            {
                int counter = 0;
                foreach (string str in tmp)
                {
                    if (counter >= 2)
                    {
                        Console.WriteLine("\nPress Enter to continue\n");
                        Console.ReadLine();
                        counter = 0;
                    }
                    Console.WriteLine();
                    Console.WriteLine(str);
                    counter++;
                }
                if (counter != 0)
                {
                    Console.WriteLine("\nPress Enter to Finish\n");
                    Console.ReadLine();
                }
            }
        }
Ejemplo n.º 2
0
        static void showType(Garage myGarage)
        {
            string type;

            Console.WriteLine("Type to display (Motorcycle, Automobile, Small Truck) :");
            type = Console.ReadLine();

            List<string> tmp = myGarage.Show(type);

            if (tmp.Count == 0)
            {
                Console.WriteLine("No " + type);
            }
            else
            {
                int counter = 0;
                foreach (string str in tmp)
                {
                    if (counter >= 2)
                    {
                        Console.WriteLine("\nPress Enter to continue\n");
                        Console.ReadLine();
                        counter = 0;
                    }
                    Console.WriteLine();
                    Console.WriteLine(str);
                    counter++;
                }
                if (counter != 0)
                {
                    Console.WriteLine("\nPress Enter to Finish\n");
                    Console.ReadLine();
                }
            }
        }
Ejemplo n.º 3
0
        static void showAll(Garage myGarage)
        {
            List<string> tmp = myGarage.Show();

            if (tmp.Count == 0)
            {
                Console.WriteLine("No vehicles");
            }
            else
            {
                int counter = 0;
                foreach (string str in tmp)
                {
                    if (counter >= 2)
                    {
                        Console.WriteLine("\nPress Enter to continue\n");
                        Console.ReadLine();
                        counter = 0;
                    }
                    Console.WriteLine();
                    Console.WriteLine(str);
                    counter++;
                }
                if (counter != 0)
                {
                    Console.WriteLine("\nPress Enter to Finish\n");
                    Console.ReadLine();
                }
            }
        }