Пример #1
0
        public MainWindow()
        {
            InitializeComponent();
            FilePath = new DBProcessing(_myConnectionString);
            var teams   = FilePath.GetTeams();
            var players = FilePath.GetBasketballPlayers();
            var image   = new MenuImagesProcessing();

            foreach (var item in teams)
            {
                item.BasketballPlayers = players;
            }
            var basketballPlayer = new BasketballPlayers();
            var team             = new Teams();

            foreach (var item in players)
            {
                basketballPlayer.CheckPlayerPicture(item);
            }
            foreach (var item in teams)
            {
                team.CheckTeamPicture(item);
            }
            foreach (var item in teams)
            {
                item.BasketballPlayers = basketballPlayer.RelatePlayerToATeam(item, players);;
            }
            _teamsList   = teams;
            _teamsToSort = teams;
            connection   = new MySqlConnection(_myConnectionString);
            _positions   = FilePath.GetPositions();

            //_menuImages = image.GetImagesFromFile();
        }
Пример #2
0
        private void UpdateInterface()
        {
            _toCompleteEvent = true;
            var teams   = FilePath.GetTeams();
            var players = FilePath.GetBasketballPlayers();

            foreach (var item in players)
            {
                item.CheckPlayerPicture(item);
            }
            foreach (var item in teams)
            {
                item.BasketballPlayers = players;
            }
            var basketballPlayer = new BasketballPlayers();

            foreach (var item in teams)
            {
                item.BasketballPlayers = basketballPlayer.RelatePlayerToATeam(item, players);;
            }
            lvTeamsOutput.ItemsSource = null;
            lvTeamsOutput.ItemsSource = teams;
            _toCompleteEvent          = false;
        }