Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            Kinosaal kinosaal = new Kinosaal();

            do
            {
                kinosaal.SitzplaetzeAusgeben();
                int row           = RowSelection(kinosaal);
                int numberOfSeats = RequestedNumberOfSeats(kinosaal);
                kinosaal.SitzplatzBuchen(row, numberOfSeats);

                Console.ReadKey();
            } while (true);
        }
Ejemplo n.º 2
0
        private static int RequestedNumberOfSeats(Kinosaal k)
        {
            int requestedSeats;

            Console.WriteLine("Wie viele Sitze möchten Sie reservieren?");
            string requestedSeatsInput = Console.ReadLine();

            try
            {
                requestedSeats = ParseStringToInt(requestedSeatsInput);
                if (!k.IsValidSeat(requestedSeats))
                {
                    requestedSeats = RequestedNumberOfSeats(k);
                }
            }
            catch (ArgumentException)
            {
                requestedSeats = RequestedNumberOfSeats(k);
            }
            return(requestedSeats);
        }
Ejemplo n.º 3
0
        public static int RowSelection(Kinosaal k)
        {
            int    row;
            string input;

            Console.WriteLine("Please Type in the seat of row where you want to sit. ");

            try
            {
                input = Console.ReadLine();
                row   = ParseStringToInt(input);
                if (!k.IsValidRow(row))
                {
                    row = RowSelection(k);
                }
            }
            catch (ArgumentException)
            {
                Console.WriteLine("Please insert a valid number!");
                row = RowSelection(k);
            }

            return(row);
        }