/// <summary> /// This event handler will display the results /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void uxResult_Click(object sender, EventArgs e) { string nameOfTeam = ""; foreach (string x in _teamInfo.Keys) { if (_teamInfo[x].ToString().Equals(comboBox1.Text)) { nameOfTeam = x; } } string dateOfGame = uxDateTimePicker.Value.Year.ToString() + uxDateTimePicker.Value.Month.ToString().PadLeft(2, '0') + uxDateTimePicker.Value.Day.ToString().PadLeft(2, '0'); TeamAndDate hold = new TeamAndDate(nameOfTeam, dateOfGame); if (_gameLog.ContainsKey(hold)) { foreach (GameData a in _gameLog[hold]) { GameInformationcs game = new GameInformationcs(); game.Show(); game.Text = a.gameData.ToShortDateString(); game.uxHome.Text = a.homeTeam; game.uxVisitor.Text = a.visitingTeam; game.uxWin.Text = a.winningPitcher; game.uxLose.Text = a.losingPitcher; game.uxSave.Text = a.save; game.uxMvp.Text = a.mvp; game.uxVisitScore.Text = a.visitScore.ToString(); game.uxHomeScore.Text = a.homeScore.ToString(); } } else { MessageBox.Show("No results for that team on that date"); } }
/// <summary> /// This event handler will display the results /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void uxResult_Click(object sender, EventArgs e) { string nameOfTeam=""; foreach(string x in _teamInfo.Keys) { if (_teamInfo[x].ToString().Equals(comboBox1.Text)) nameOfTeam = x; } string dateOfGame = uxDateTimePicker.Value.Year.ToString() + uxDateTimePicker.Value.Month.ToString().PadLeft(2, '0') + uxDateTimePicker.Value.Day.ToString().PadLeft(2, '0'); TeamAndDate hold = new TeamAndDate(nameOfTeam, dateOfGame); if (_gameLog.ContainsKey(hold)) { foreach (GameData a in _gameLog[hold]) { GameInformationcs game = new GameInformationcs(); game.Show(); game.Text = a.gameData.ToShortDateString(); game.uxHome.Text = a.homeTeam; game.uxVisitor.Text = a.visitingTeam; game.uxWin.Text = a.winningPitcher; game.uxLose.Text = a.losingPitcher; game.uxSave.Text = a.save; game.uxMvp.Text = a.mvp; game.uxVisitScore.Text = a.visitScore.ToString(); game.uxHomeScore.Text = a.homeScore.ToString(); } } else { MessageBox.Show("No results for that team on that date"); } }