WaiterWindow.xaml.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows;
  7. using System.Windows.Controls;
  8. using System.Windows.Data;
  9. using System.Windows.Documents;
  10. using System.Windows.Input;
  11. using System.Windows.Media;
  12. using System.Windows.Media.Imaging;
  13. using System.Windows.Shapes;
  14. namespace TrainingBeforeExams
  15. {
  16. /// <summary>
  17. /// Interaction logic for WaiterWindow.xaml
  18. /// </summary>
  19. public partial class WaiterWindow : Window
  20. {
  21. testEntities entity;
  22. public Order currentInfo { get; set; }
  23. public WaiterWindow(string login, int id)
  24. {
  25. InitializeComponent();
  26. entity = new testEntities();
  27. currentLogin.Content = login;
  28. orderList.ItemsSource = entity.Order.Where(x => x.UserID == id).ToList();
  29. }
  30. private void Button_Click(object sender, RoutedEventArgs e)
  31. {
  32. currentInfo = (sender as Button).DataContext as Order;
  33. PreorderWindow preorderWindow = new PreorderWindow(currentInfo.PreorderID);
  34. preorderWindow.Show();
  35. this.Hide();
  36. }
  37. }
  38. }