/// <summary> Description of the Method /// /// </summary> /// <param name="section"> Description of the Parameter /// </param> public virtual void update(TournamentSection section) { // cards = section.getCards(); removed to clean up errors, need to look at flags = section.Flags; byePoints = section.ByePoints; numRounds = section.NumRounds; // roundNumber = section.getRoundNumber(); removed to clean up errors, need to look at }
public static void CreateRound(int tournamentID) { SqlConnection cn = new SqlConnection("Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=InfiChess;Data Source=ARSALANATA\\SQLEXPRESS"); SqlCommand cmd = new SqlCommand("select * from Tournament where tournamentid = 265", cn); cmd.CommandType = CommandType.Text; DataSet ds = new DataSet(); SqlDataAdapter adp = new SqlDataAdapter(); adp.SelectCommand = cmd; adp.Fill(ds); SqlCommand cmdUser = new SqlCommand("GetTournamentRegisteredUsers", cn); cmdUser.CommandType = CommandType.StoredProcedure; cmdUser.Parameters.Add("@TournamentID", SqlDbType.Int, 4).Value = tournamentID; DataSet dsuser = new DataSet(); SqlDataAdapter adpUser = new SqlDataAdapter(); adpUser.SelectCommand = cmdUser; adpUser.Fill(dsuser); //dataGridView1.DataSource = dsuser.Tables[0]; // txtName.Text = ds.Tables[0].Rows[0]["Name"].ToString(); //currentTournament = new Tournament(); //currentTournament.Name = txtName.Text; //t.NumSections = 1; //t.NumRatedSections = 1; TournamentSection ts = new TournamentSection(); ts.Name = "1st"; ts.ByePoints = 1; ts.Marked = true; ts.NumRounds = 3; foreach (DataRow dr in dsuser.Tables[0].Rows) { Player p = new Player(); p.FullName = dr["UserName"].ToString(); p.QuickRating = Convert.ToInt32(dr["Rating"].ToString()); p.MemberNumber = dr["No"].ToString(); p.Team = ""; ts.addPlayer(p); } //Card c = new Card(p); Engine e = new Engine(); }
public virtual void removeSection(TournamentSection v) { System.Object temp_object; System.Boolean temp_boolean; temp_object = v; temp_boolean = sections.Contains(temp_object); sections.Remove(temp_object); bool generatedAux = temp_boolean; }
public virtual void updatePlayer(Player p) { int i; int n = sections.Count; TournamentSection ts = null; for (i = 0; i < n; i++) { ts = (TournamentSection)sections[i]; ts.updatePlayer(p); } }
/// <summary> Gets the section attribute of the Tournament object /// /// </summary> /// <param name="name"> Description of the Parameter /// </param> /// <returns> The section value /// </returns> public virtual TournamentSection getSection(System.String name) { int i; int n = sections.Count; TournamentSection ts = null; for (i = 0; i < n; i++) { ts = (TournamentSection)sections[i]; if (ts.Name.Equals(name)) { return(ts); } } return(null); }
public virtual TournamentSection getRatedSection(int idx) { int n = NumSections; for (int i = 0; i < n; i++) { TournamentSection s = (TournamentSection)sections[i]; if (!s.isFlag(4)) { if (idx == 0) { return(s); } idx--; } } return(null); }
/// <summary> Adds a feature to the Section attribute of the Tournament object /// /// </summary> /// <param name="v"> The feature to be added to the Section attribute /// </param> public virtual void addSection(TournamentSection v) { sections.Add(v); }