Demka_kur/OknaRoley/StarshiyWindow.axaml.cs
2025-03-05 12:12:58 +03:00

57 lines
1.3 KiB
C#

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<ordersDao> 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);
}
}