private void Page_Loaded(object sender, RoutedEventArgs e) { foreach (Performance performance in cashbox.GetPerformances()) { performanceComboBox.Items.Add(performance.name); } }
private void PerformanceList_Loaded(object sender, RoutedEventArgs e) { foreach (Performance performance in cashbox.GetPerformances()) // В xaml соеденить 3 столбца rowspan и сделать стэкпанель по горизонт. { TextBlock nameBlock = new TextBlock(); TextBlock ticketBlock = new TextBlock(); TextBlock dateBlock = new TextBlock(); nameBlock.Text = performance.name; dateBlock.Text = performance.date.ToLongDateString(); ticketBlock.Text = "Партерр: " + performance.GetTicketsInfo()[0] + "\n" + "Балкон: " + performance.GetTicketsInfo()[1] + "\n" + "Ложа: " + performance.GetTicketsInfo()[2]; nameBlock.Width = column1.Width; nameBlock.Height = 60; ticketBlock.Width = column2.Width; ticketBlock.Height = 60; dateBlock.Width = column3.Width; dateBlock.Height = 60; column1.Children.Add(nameBlock); column2.Children.Add(ticketBlock); column3.Children.Add(dateBlock); } }
private void Calendar_SelectedDatesChanged(object sender, SelectionChangedEventArgs e) { DateTime date = (DateTime)calendar.SelectedDate; performanceInDateBlock.Text = ""; foreach (Performance performance in cashbox.GetPerformances(date)) { performanceInDateBlock.Text += "\"" + performance.name + "\", осталось билетов: " + performance.CountOfTickets() + "\n"; } }
private void PerformanceBox_Changed(object sender, SelectionChangedEventArgs e) { comboDateBox.Items.Clear(); comboTypeBox.Items.Clear(); foreach (Performance performance in cashbox.GetPerformances()) { if (String.Equals(performance.name.ToLower(), comboPerformanceBox.SelectedItem.ToString().ToLower())) { comboDateBox.Items.Add(performance.date.ToShortDateString()); } } comboDateBox.SelectedItem = comboDateBox.Items[0]; }