private void buttonViewSessionDetails_Click(object sender, RoutedEventArgs e) { SessionToView sessionToView = listViewFutureSessions.SelectedItem as SessionToView; WindowObserveSession windowObserveSession = new WindowObserveSession(sessionToView); windowObserveSession.ShowDialog(); }
public TicketElement(Ticket ticketToSet, WindowObserveSession windowObserveSessionToSet) { ticket = ticketToSet; InitializeComponent(); using (SQLiteConnection connection = new SQLiteConnection(SharedData.DatabaseLocation)) { connection.CreateTable <Place>(); placeName = connection.Query <Place>("SELECT * FROM Place WHERE PlaceId = ?", ticket.PlaceNumber).FirstOrDefault().PlaceName; } LabelTicketName.Content = placeName; if (ticket.SellDate != "") { OuterStackPanel.Background = sold; MenuItemMarkSold.IsEnabled = false; MenuItemMarkBooked.IsEnabled = false; } else if (ticket.IsBooked == 1) { OuterStackPanel.Background = booked; MenuItemDemarkBooked.IsEnabled = true; MenuItemMarkSold.IsEnabled = false; MenuItemMarkBooked.IsEnabled = false; } else { OuterStackPanel.Background = availableToPurchase; } windowObserveSession = windowObserveSessionToSet; }
public TicketsToSessionViewer(List <Ticket> ticketsToSet, WindowObserveSession windowObserveSession) { tickets = ticketsToSet; InitializeComponent(); using (SQLiteConnection connection = new SQLiteConnection(SharedData.DatabaseLocation)) { connection.CreateTable <Auditorium>(); auditorium = connection.Query <Auditorium>("SELECT * FROM Auditorium WHERE AuditoriumId = ?", tickets[0].AuditoriumNumber).FirstOrDefault(); } int countRows = auditorium.CountRows, placesPerRow = auditorium.CountPlaces / auditorium.CountRows; for (int i = 0; i < countRows; ++i) { StackPanel horizontalStackPanel = new StackPanel(); horizontalStackPanel.Orientation = Orientation.Horizontal; for (int j = 0; j < placesPerRow; ++j) { TicketElement ticketElement = new TicketElement(tickets[placesPerRow * i + j], windowObserveSession); horizontalStackPanel.Children.Add(ticketElement); } StackPanelOuter.Children.Add(horizontalStackPanel); } }