public static List <TournamentListItem> getTournaments() { List <TournamentListItem> list = new List <TournamentListItem>(); MySQL c = new MySQL(""); data dbs = c.select("SELECT TABLE_SCHEMA, COLUMN_NAME FROM information_schema.COLUMNS WHERE TABLE_NAME = 'admin' AND COLUMN_NAME IN ('dnazwa', 'teamcnt') ORDER BY TABLE_SCHEMA;"); while (dbs.Read()) { TournamentListItem item = new TournamentListItem(); item.Name = dbs.GetString(0); item.Type = "dnazwa".Equals(dbs.GetString(1)) ? Tournament.TYPE_PARY : Tournament.TYPE_TEAMY; item.Label = MySQLTournament.getLabel(item.Name, item.Type); list.Add(item); } dbs.Close(); return(list); }
public override string ToString() { return(MySQLTournament.getLabel(this.name, this.type)); }