public EditMatchSelectionWindow(Season season)
        {
            this.InitializeComponent();
            this.season = season;

            this.updateEditMatchesView();
        }
 public TransferPlayerForm(Season season)
 {
     InitializeComponent();
     this.Season = season;
     this.setTeamLists();
     this.updatePlayerList();
 }
        public MatchCreator(Season tournament)
        {
            this.InitializeComponent();
            this.tournament = tournament;
            var teamSource = new Dictionary<int, string>();
            foreach (var team in this.tournament.Teams)
            {
                teamSource.Add(this.tournament.Teams.IndexOf(team), team.Name);
            }
            this.drpdwnHome.DataSource = new BindingSource(teamSource, null);
            this.drpdwnAway.DataSource = new BindingSource(teamSource, null);

            this.drpdwnHome.DisplayMember = "Value";
            this.drpdwnAway.DisplayMember = "Value";

            this.lblTimeAt.Visible = false;
            this.matchDateTimePicker.Visible = false;

            this.matchTimePicker.Visible = false;
            this.matchTimePicker.Format = DateTimePickerFormat.Custom;
            this.matchTimePicker.CustomFormat = @"HH:mm";
            this.matchTimePicker.ShowUpDown = true;

            this.btnCreateMatch.DialogResult = DialogResult.OK;
            this.btnCancel.DialogResult = DialogResult.Cancel;
        }
 public PlayMatchWindow(Season season, Match match)
 {
     this.InitializeComponent();
     this.lblHomeTeamName.Text = match.HomeTeam.Name;
     this.UpdateMatchScore(match);
     this.lblAwayTeamName.Text = match.AwayTeam.Name;
     this.Season = season;
     this.Match = match;
 }
        public Season CreateSeason()
        {
            Season season = null;

            if (!this.GetSeasonName().Equals(""))
            {
                season = new Season(this.GetSeasonName());
            }

            return season;
        }
        /// <summary>
        ///     Initializes a new instance of the <see cref="EditTeamWindow" /> class.
        /// </summary>
        /// <param name="season">The season.</param>
        public EditTeamWindow(Season season)
        {
            this.InitializeComponent();
            this.season = season;

            var teamSource = new Dictionary<int, string>();
            foreach (var team in this.season.Teams)
            {
                teamSource.Add(this.season.Teams.IndexOf(team), team.Name);
            }
            this.drpDwnTeamName.DataSource = new BindingSource(teamSource, null);
            this.drpDwnTeamName.DisplayMember = "Value";
        }
        public TransferPlayerForm(Season season, Team originalTeam, Player player)
        {
            InitializeComponent();
            this.Season = season;
            this.OriginalTeam = originalTeam;
            this.Player = player;

            var teamSource = new Dictionary<int, string>();
            foreach (var team in this.Season.Teams)
            {
                teamSource.Add(this.Season.Teams.IndexOf(team), team.Name);
            }

            this.cmbBoxOriginalTeam.DataSource = new BindingSource(teamSource, null);
            this.cmbBoxNewTeam.DataSource = new BindingSource(teamSource, null);

            this.cmbBoxOriginalTeam.DisplayMember = "Value";
            this.cmbBoxNewTeam.DisplayMember = "Value";
            this.cmbBoxPlayer.DisplayMember = "Value";
        }
        public EditMatchEditWindow(Season tournament, int matchIndex)
        {
            this.InitializeComponent();
            this.tournament = tournament;
            this.matchIndex = matchIndex;

            this.lblHomeTeamName.Text = this.tournament.GetMatch(this.matchIndex).HomeTeam.Name;
            this.lblAwayTeamName.Text = this.tournament.GetMatch(this.matchIndex).AwayTeam.Name;

            this.numHomeScore.Value = this.tournament.GetMatch(this.matchIndex).HomeTeamScore;
            this.numAwayScore.Value = this.tournament.GetMatch(this.matchIndex).AwayTeamScore;

            this.chkDateTime.Enabled = false;

            this.matchTimePicker.Format = DateTimePickerFormat.Custom;
            this.matchTimePicker.CustomFormat = @"HH:mm";
            this.matchTimePicker.ShowUpDown = true;

            this.matchDateTimePicker.Visible = false;
            this.matchTimePicker.Visible = false;
            this.lblTimeAt.Visible = false;
        }
 private void openFile()
 {
     var openFileDialog = new OpenFileDialog
     {
         DefaultExt = ".bin",
         Filter = @"Bin Files (*.bin)|*.bin"
     };
     openFileDialog.ShowDialog();
     this.saveFilePath = openFileDialog.FileName;
     if (!this.saveFilePath.Equals(""))
     {
         Stream stream = new FileStream(this.saveFilePath, FileMode.Open, FileAccess.Read, FileShare.None);
         IFormatter formatter = new BinaryFormatter();
         this.tournament = (Season)formatter.Deserialize(stream);
         stream.Close();
     }
 }
        private void newTournamentToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.seasonCreator = new SeasonCreator();
            this.seasonCreator.ShowDialog();

            if (this.seasonCreator.DialogResult == DialogResult.OK &&
                !this.seasonCreator.GetSeasonName().Equals(""))
            {
                this.tournament = this.seasonCreator.CreateSeason();
                this.newTournamentMenuItem.Enabled = false;

                this.enableMenuItems();

                this.updateAllDataGridViews();
            }

            this.seasonCreator.Close();
        }