private void ShowBookings() { if (fpnBookings.Controls.Count > 0) { fpnBookings.Controls.Clear(); } bookings = new BookingBLL().RetrieveALL(); BookingPanel[] booking = new BookingPanel[bookings.Count]; for (int i = 0; i < booking.Length; i++) { booking[i] = new BookingPanel(table.Size.Width, table.Size.Height); booking[i].ID = bookings[i].ID.ToString(); booking[i].MovieName = bookings[i].Schedule.Movie.Title; booking[i].HallName = bookings[i].Schedule.Hall.Name;; booking[i].StartTime = bookings[i].Schedule.StartTime.ToString("dd-MM-yyyy HH:mm"); booking[i].EndTime = bookings[i].Schedule.EndTime.ToString("dd-MM-yyyy HH:mm"); booking[i].ClientName = bookings[i].Client.UserName; booking[i].Chair = bookings[i].Chair.Row + " , " + bookings[i].Chair.Column; fpnBookings.Controls.Add(booking[i]); } }
private void ShowBookings(string moviename) { if (fpnBookings.Controls.Count > 0) { fpnBookings.Controls.Clear(); } if (this.bookings == null) { this.bookings = new BookingBLL().RetrieveALL(); } var all = this.bookings; List <Booking> bookings = new List <Booking>(); foreach (var item in all) { if (System.Text.RegularExpressions.Regex.IsMatch(item.Schedule.Movie.Title, moviename)) { bookings.Add(item); } } bookings = new BookingBLL().RetrieveALL(); BookingPanel[] booking = new BookingPanel[bookings.Count]; for (int i = 0; i < booking.Length; i++) { booking[i] = new BookingPanel(table.Size.Width, table.Size.Height); booking[i].ID = bookings[i].ID.ToString(); booking[i].MovieName = bookings[i].Schedule.Movie.Title; booking[i].HallName = bookings[i].Schedule.Hall.Name;; booking[i].StartTime = bookings[i].Schedule.StartTime.ToString("dd-MM-yyyy HH:mm"); booking[i].EndTime = bookings[i].Schedule.EndTime.ToString("dd-MM-yyyy HH:mm"); booking[i].ClientName = bookings[i].Client.UserName; booking[i].Chair = bookings[i].Chair.Row + " , " + bookings[i].Chair.Column; fpnBookings.Controls.Add(booking[i]); } }