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
{
    /// <summary>
    /// Логика взаимодействия для TeamDetail.xaml
    /// </summary>
    public partial class TeamDetail : Window
    {
        public static PracticeNBAEntities DataEntitiesEmployee { get; set; }

        public static ObservableCollection<PlayerInTeam> ListEmployee;

        public static PracticeNBAEntities DataEntitiesEmploye1 { get; set; }
        public static ObservableCollection<MatchupDetail> ListEmployee1;
        public TeamDetail()
        {
            DataEntitiesEmployee = new PracticeNBAEntities();
            DataEntitiesEmploye1 = new PracticeNBAEntities();
            InitializeComponent();
            ListEmployee = new ObservableCollection<PlayerInTeam>();
            ListEmployee1 = new ObservableCollection<MatchupDetail>();
        }
        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;
        }
    
       
    }
}
