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); }
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); }
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); }