Exemple #1
0
 /******************************************************************
 *               OPERATIONS - WRITE OUT LEAGUE DATA                *
 ******************************************************************/
 public static void writeLeague(StreamWriter writingOutFootball, League thisLeague)
 {
     //write out all its details
     writingOutFootball.WriteLine(thisLeague.getLeagueName());
     writingOutFootball.WriteLine(thisLeague.getLeagueSponsor());
     writingOutFootball.WriteLine(thisLeague.getLeaguePrize());
     writingOutFootball.WriteLine(thisLeague.getNumLeagueFixtures());
 }
 /******************************************************************
 *               ADD TEAM - POPULATE THE LEAGUE BOX                *
 ******************************************************************/
 private void populateLeagueBox()
 {
     // loop through each league in the all leagues arraylist...
     foreach (League League in frmMainMenu.allLeagues)
     {
         string option;
         option = League.getLeagueName();
         cboLeagueName.Items.Add(option);
     }
 }
        /******************************************************************
        *       EDIT LEAGUE - GET THE DETAILS OF THE SELECTED LEAGUE      *
        ******************************************************************/
        private void getLeagueDetails()
        {
            // get the current league...
            League currentLeague = (League)frmMainMenu.allLeagues[frmMainMenu.leagueSelected];

            // set the forms values to the current leagues values...
            txtLeagueName.Text        = currentLeague.getLeagueName();
            txtLeagueSponsor.Text     = currentLeague.getLeagueSponsor();
            txtLeaguePrize.Text       = currentLeague.getLeaguePrize();
            txtLeagueNumFixtures.Text = currentLeague.getNumLeagueFixtures().ToString();
        }
Exemple #4
0
        /******************************************************************
        *             EDIT FIXTURE - GET THE FIXTURE DETAILS              *
        ******************************************************************/
        private void getFixtureDetails()
        {
            try
            {
                // local variables...
                int       selectedLeague  = frmMainMenu.leagueSelected;
                int       selectedFixture = frmMainMenu.fixtureSelected;
                ArrayList allOfTheLeagues = frmMainMenu.allLeagues;

                League  currentLeague  = (League)allOfTheLeagues[selectedLeague];
                Fixture currentFixture = (Fixture)currentLeague.getAllLeagueFixtures()[selectedFixture];


                // set input fields to the currentFixture details...
                cboLeagues.Text         = currentLeague.getLeagueName();
                txtFixtureDate.Text     = currentFixture.getFixtureDate();
                txtFixtureTime.Text     = currentFixture.getFixtureTime();
                txtFixtureLocation.Text = currentFixture.getFixtureLocation();
                cboHomeTeam.Text        = currentFixture.getFixtureHomeTeam();
                cboAwayTeam.Text        = currentFixture.getFixtureAwayTeam();


                // loop through each team in allTeams...
                foreach (Team t in frmMainMenu.allTeams)
                {
                    // check to see if the right home team has been selected...
                    if (t.getTeamName().ToString() == cboHomeTeam.Text)
                    {
                        // render the left panel using t's details...
                        renderHome(t);
                    }

                    // check to see if the right away team is selected
                    if (t.getTeamName().ToString() == cboAwayTeam.Text)
                    {
                        // render the left panel using t's details...
                        renderAway(t);
                    }
                }
            }

            catch (IndexOutOfRangeException)
            { }

            catch (Exception)
            {
                MessageBox.Show("Please select a fixture from the list before trying to edit one.", "Operation Failed");
            }
        }