TeamDetail.xaml.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. using NBAManagment.Entities;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Collections.ObjectModel;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using System.Windows;
  9. using System.Windows.Controls;
  10. using System.Windows.Data;
  11. using System.Windows.Documents;
  12. using System.Windows.Input;
  13. using System.Windows.Media;
  14. using System.Windows.Media.Imaging;
  15. using System.Windows.Shapes;
  16. namespace NBAManagment
  17. {
  18. /// <summary>
  19. /// Логика взаимодействия для TeamDetail.xaml
  20. /// </summary>
  21. public partial class TeamDetail : Window
  22. {
  23. public static PracticeNBAEntities DataEntitiesEmployee { get; set; }
  24. public static ObservableCollection<PlayerInTeam> ListEmployee;
  25. public static PracticeNBAEntities DataEntitiesEmploye1 { get; set; }
  26. public static ObservableCollection<MatchupDetail> ListEmployee1;
  27. public TeamDetail()
  28. {
  29. DataEntitiesEmployee = new PracticeNBAEntities();
  30. DataEntitiesEmploye1 = new PracticeNBAEntities();
  31. InitializeComponent();
  32. ListEmployee = new ObservableCollection<PlayerInTeam>();
  33. ListEmployee1 = new ObservableCollection<MatchupDetail>();
  34. }
  35. private void Page_Loaded(object sender, RoutedEventArgs e)
  36. {
  37. var querryEmployee = DataEntitiesEmployee.PlayerInTeam.OrderBy(Employee => Employee.IdPlayerInTeam);
  38. foreach(PlayerInTeam emp in querryEmployee)
  39. {
  40. ListEmployee.Add(emp);
  41. }
  42. DataGridEmployee.ItemsSource = ListEmployee;
  43. var querryEmployee1 = DataEntitiesEmployee.MatchupDetail.OrderBy(Employee => Employee.IdMatchupDetail);
  44. foreach (MatchupDetail emp1 in querryEmployee1)
  45. {
  46. ListEmployee1.Add(emp1);
  47. }
  48. DataGridEmployee1.ItemsSource = ListEmployee1;
  49. }
  50. }
  51. }