using NBAManagment.Entities; using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Shapes; namespace NBAManagment { /// /// Логика взаимодействия для TeamDetail.xaml /// public partial class TeamDetail : Window { public static PracticeNBAEntities DataEntitiesEmployee { get; set; } public static ObservableCollection ListEmployee; public static PracticeNBAEntities DataEntitiesEmploye1 { get; set; } public static ObservableCollection ListEmployee1; public TeamDetail() { DataEntitiesEmployee = new PracticeNBAEntities(); DataEntitiesEmploye1 = new PracticeNBAEntities(); InitializeComponent(); ListEmployee = new ObservableCollection(); ListEmployee1 = new ObservableCollection(); } private void Page_Loaded(object sender, RoutedEventArgs e) { var querryEmployee = DataEntitiesEmployee.PlayerInTeam.OrderBy(Employee => Employee.IdPlayerInTeam); foreach(PlayerInTeam emp in querryEmployee) { ListEmployee.Add(emp); } DataGridEmployee.ItemsSource = ListEmployee; var querryEmployee1 = DataEntitiesEmployee.MatchupDetail.OrderBy(Employee => Employee.IdMatchupDetail); foreach (MatchupDetail emp1 in querryEmployee1) { ListEmployee1.Add(emp1); } DataGridEmployee1.ItemsSource = ListEmployee1; } } }