private void schAddPerfButton_Click(object sender, RoutedEventArgs e) { addEditPerformances addWindow = new addEditPerformances(thisTheatre); addWindow.ShowDialog(); initialiseBookingUpcoming(); }
private void schEditPerfButton_Click(object sender, RoutedEventArgs e) { if (schSearchPerformanceResultListBox.Items.Count == 0) { if (schUpcomingListBox.Items.Count != 0) { if (schUpcomingListBox.SelectedIndex >= 0) { ListBoxItem selected = (ListBoxItem)schUpcomingListBox.Items[schUpcomingListBox.SelectedIndex]; string id = selected.ToolTip.ToString().Split(':')[0]; addEditPerformances editWindow = new addEditPerformances(id, thisTheatre); editWindow.ShowDialog(); initialiseBookingUpcoming(); } else { ListBoxItem selected = (ListBoxItem)schUpcomingListBox.Items[0]; string id = selected.ToolTip.ToString().Split(':')[0]; addEditPerformances editWindow = new addEditPerformances(id, thisTheatre); editWindow.ShowDialog(); initialiseBookingUpcoming(); } } } else { if (schUpcomingListBox.SelectedIndex >= 0) { ListBoxItem selected = (ListBoxItem)schSearchPerformanceResultListBox.Items[schSearchPerformanceResultListBox.SelectedIndex]; string id = selected.ToolTip.ToString().Split(':')[0]; addEditPerformances editWindow = new addEditPerformances(id, thisTheatre); editWindow.ShowDialog(); initialiseBookingUpcoming(); } else { ListBoxItem selected = (ListBoxItem)schSearchPerformanceResultListBox.Items[0]; string id = selected.ToolTip.ToString().Split(':')[0]; addEditPerformances editWindow = new addEditPerformances(id, thisTheatre); editWindow.ShowDialog(); initialiseBookingUpcoming(); } } }