Пример #1
0
        private void RESETbtn_Click(object sender, EventArgs e)
        {
            foreach (TextBox t in textBoxes)
            {
                t.Text = "";
            }

            TextBoxNrOfTeams.Text = "";
            listManagement.REMOVE_ALL();

            TeamsTable.Rows.Clear();
            TeamsTable.Columns.Clear();
            TeamsTable.Update();
            TeamsTable.Refresh();
        }
        public IMatchup saveTeamScore(IMatchup matchup)
        {
            List <ITeam> allTeams   = TeamsTable.GetAll(dbConn);
            ITeam        firstTeam  = allTeams.Find(x => x.TeamId == matchup.MatchupEntries[0].TheTeam.TeamId);
            ITeam        secondTeam = allTeams.Find(x => x.TeamId == matchup.MatchupEntries[1].TheTeam.TeamId);

            if (matchup.MatchupEntries[0].Score > matchup.MatchupEntries[1].Score)
            {
                firstTeam.Wins++;
                secondTeam.Losses++;
            }
            else
            {
                firstTeam.Losses++;
                secondTeam.Wins++;
            }

            ITeam team1 = TeamsTable.Update(firstTeam, dbConn);
            ITeam team2 = TeamsTable.Update(secondTeam, dbConn);

            return(matchup);
        }