public frmCheckIn(bool newMeeting) { InitializeComponent(); if (newMeeting) { meeting = new clsChessClubMeeting(); meeting.MeetingDate = DateTime.Today; InitializePlayerLists(); EnableControls(true); lblCheckIn.Text = "Check-In " + DateTime.Today.ToShortDateString(); btnStart.Visible = false; dateCheckIn.Visible = false; lblGo.Visible = false; } }
private void btnStart_Click(object sender, EventArgs e) { meeting = dataStore.GetMeetingByDate(dateCheckIn.Value); if (meeting == null) { frmMessage message = new frmMessage(); message.SetMessageText("Meeting not found."); message.ShowDialog(); return; // meeting = new clsChessClubMeeting(); // meeting.MeetingDate = dateCheckIn.Value; } InitializePlayerLists(); EnableControls(true); if (meeting.initialRankings.Count == 0) { clsChessClubMeeting previousMeeting = dataStore.GetPreviousMeetingFromDataStore(meeting.MeetingDate); if (previousMeeting == null) { List <clsPlayer> playerList = dataStore.LoadPlayersFromDataStore(); foreach (clsPlayer player in playerList) { clsPlayerRanking playerRanking = new clsPlayerRanking(); playerRanking.PlayerID = player.PlayerID; playerRanking.Rank = player.Rank; playerRanking.PlayerFullName = player.FullName; meeting.initialRankings.Add(playerRanking); } meeting.initialRankings.Sort(rankComparer); } else { meeting.initialRankings = previousMeeting.finalRankings; } } }
public frmChallengeGames(clsChessClubMeeting meeting) { currentMeeting = meeting; InitializeComponent(); InitializeGameGrid(); }