public ShowScreeningReservationsForm(Screening screening) { this.FormBorderStyle = FormBorderStyle.FixedDialog; this._screening = screening; this._reservedTickets = TicketService.GetTickets(screening).Where(t => !t.isPaid).ToList(); this._reservationsHolder = new ScreeningReservationsHolder(); InitializeComponent(); }
public void RenderReservationsHolder() { if (this._reservedTickets.Count == 0) { ClearReservationHolder(); return; } var location = new Point(this.searchByUsernameLabel.Location.X, this.searchByUsernameTextBox.Location.Y + 40); var width = this.Size.Width - 100; var size = new Size(width, 200); if (this.Controls.Contains(this._reservationsHolder)) { var reservationsHolderIndex = this.Controls.IndexOf(this._reservationsHolder); this.Controls.RemoveAt(reservationsHolderIndex); } this._reservationsHolder = new ScreeningReservationsHolder(location, size, _reservedTickets); this.Controls.Add(this._reservationsHolder); this.Refresh(); }