using Avalonia.Controls; using Avalonia.Interactivity; using Demka_Snova_1.Hardik.Conect.Dao; using Demka_Snova_1.OknaFunciy; using System.Collections.Generic; namespace Demka_Snova_1.OknaRoley; public partial class StarshiyWindow : Window { private List ordersList; public StarshiyWindow() { InitializeComponent(); OrdersListBox.ItemsSource = ordersList; } private void FormatZakaz_Click(object sender, RoutedEventArgs e) { var login = new AddZakazWindow(); login.Show(); this.Close(); } private void PrinatZakaz_Click(object sender, RoutedEventArgs e) { var selectedOrder = OrdersListBox.SelectedItem as ordersDao; if (selectedOrder != null) { selectedOrder.Status = "В прокате"; } else { ShowError("Выберите заказ для изменения статуса."); } } private void Exitka(object sender, RoutedEventArgs e) { var login = new MainWindow(); login.Show(); this.Close(); } async void ShowError(string mes) { var dialog = new Window { Title = "Ошибка", Content = mes, Width = 300, Height = 200 }; await dialog.ShowDialog(this); } }