Demka_kur/OknaRoley/StarshiyWindow.axaml.cs

57 lines
1.3 KiB
C#
Raw Permalink Normal View History

2025-02-11 10:23:14 +00:00
using Avalonia.Controls;
using Avalonia.Interactivity;
2025-03-05 09:12:58 +00:00
using Demka_Snova_1.Hardik.Conect.Dao;
using Demka_Snova_1.OknaFunciy;
using System.Collections.Generic;
2025-02-11 10:23:14 +00:00
namespace Demka_Snova_1.OknaRoley;
public partial class StarshiyWindow : Window
{
2025-03-05 09:12:58 +00:00
private List<ordersDao> ordersList;
2025-02-11 10:23:14 +00:00
public StarshiyWindow()
{
InitializeComponent();
2025-03-05 09:12:58 +00:00
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 = "<22> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
}
else
{
ShowError("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.");
}
}
private void Exitka(object sender, RoutedEventArgs e)
{
var login = new MainWindow();
login.Show();
this.Close();
2025-02-11 10:23:14 +00:00
}
2025-03-05 09:12:58 +00:00
async void ShowError(string mes)
{
var dialog = new Window
{
Title = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
Content = mes,
Width = 300,
Height = 200
};
await dialog.ShowDialog(this);
2025-02-11 10:23:14 +00:00
}
}