private void nextPage_Click(object sender, EventArgs e) { Date = dateTimePicker1.Text; Time = comboBox2.Text; if (countDate >= 1 && countTime >= 1) { RoomIndex = ManageRoom(); if (Age == "16") { Ticket tk = new Ticket(ReservedList[indexDay][indexTime], RoomIndex); this.Hide(); tk.ShowDialog(); this.Close(); } else { TicketIfNot16 tk16 = new TicketIfNot16(ReservedList[indexDay][indexTime], RoomIndex); this.Hide(); tk16.ShowDialog(); this.Close(); } } else { MessageBox.Show("Je moet nog een datum of tijd kiezen"); } }
private void previousPage_Click(object sender, EventArgs e) { foreach (var a in currentSeats.ToList()) { ReservedSeats.Remove(a); } if (Age == "16") { Ticket tk = new Ticket(ReservedSeats, dateTime.RoomIndex); this.Hide(); tk.ShowDialog(); this.Close(); } else { TicketIfNot16 tk16 = new TicketIfNot16(ReservedSeats, dateTime.RoomIndex); this.Hide(); tk16.ShowDialog(); this.Close(); } }