private void RegisterPlayer(StatusE statusID, TournamentUserStatusE tournamentUserStatusID) { string userIDs = string.Empty; int i = 0; foreach (DataGridViewRow row in dgvRegisterPlayer.Rows) { int chessTypeID = Convert.ToInt32(GridTable.Rows[i]["ChessTypeId"]); if (dgvRegisterPlayer[0, row.Index].Value != null) { if ((bool)dgvRegisterPlayer[0, row.Index].Value) { int userID = BaseItem.ToInt32(GridTable.Rows[i]["UserID"]); userIDs += "," + userID.ToString(); } } i++; } if (userIDs.Length > 0) { userIDs = userIDs.Remove(0, 1); } SocketClient.SaveTournamentRegisteredUsers(statusID, tournamentUserStatusID, this.Tournament.TournamentID, userIDs, TeamId, GetEloBeforeRating); TournamentRegisterPlayer TournamentRegisterPlayer = (TournamentRegisterPlayer)this.ParentForm; TournamentRegisterPlayer.DialogResult = DialogResult.OK; }
void UpdateReplacePlayer() { int userID2 = 0; userID2 = ValidateReplacePlayer(); if (userID2 == -1 || userID2 == 0) { MessageForm.Error(this.ParentForm, MsgE.ErrorReplacePlayerSelection, ""); return; } DataSet ds = SocketClient.UpdateReplacePlayer(this.Tournament.TournamentID, this.UserID, userID2); if (ds != null) { if (ds.Tables.Count > 0) { Kv kv = new Kv(ds.Tables[0]); if (kv.GetInt32("Result") > 0) { MessageForm.Error(this.ParentForm, (MsgE)kv.GetInt32("Result")); return; } } } TournamentRegisterPlayer TournamentRegisterPlayer = (TournamentRegisterPlayer)this.ParentForm; TournamentRegisterPlayer.DialogResult = DialogResult.OK; }
private void RegisterPlayer() { if (this.Tournament == null) { return; } if (this.Tournament.TournamentID == 0) { return; } if (this.Tournament.TournamentStatusIDE != TournamentStatusE.Scheduled) { return; } TournamentRegisterPlayer TournamentRegisterPlayer = new TournamentRegisterPlayer(this.Tournament, 0); DialogResult dr = TournamentRegisterPlayer.ShowDialog(this.ParentForm); if (dr == DialogResult.OK) { TournamentRegisterPlayer.Close(); RefreshGrid(); } }
private void tsbNewTeamPlayers_Click(object sender, EventArgs e) { if (this.Tournament == null) { return; } if (this.Tournament.TournamentID == 0) { return; } if (this.Tournament.TournamentStatusIDE != TournamentStatusE.Scheduled) { return; } TournamentRegisterPlayer frm = new TournamentRegisterPlayer(this.Tournament, SelectedTeamID); DialogResult dr = frm.ShowDialog(this.ParentForm); if (dr == DialogResult.OK) { frm.Close(); RefreshPlayerGrid(); } }
private void tsReplacedPlayer_Click(object sender, EventArgs e) { if (this.Tournament == null) { return; } if (this.Tournament.TournamentID == 0) { return; } if (this.Tournament.TournamentStatusIDE != TournamentStatusE.InProgress) { return; } TournamentRegisterPlayer Tru = new TournamentRegisterPlayer(this.Tournament, 0); int userID = ValidateReplacePlayer(); if (userID == -1 || userID == 0) { MessageForm.Error(this.ParentForm, MsgE.ErrorReplacePlayerSelection, ""); return; } Tru.UserID = userID; DialogResult dr = Tru.ShowDialog(this.ParentForm); if (dr == DialogResult.OK) { Tru.Close(); RefreshGrid(); } }