//String foreignGoals; public TeamOfLeague(String tm, String league) { t = tm; l = league; players = TeamsConnection.displayPlayers(t); pastTeams = TeamsConnection.loadPastTeams(); team = TeamsConnection.displayCurrentTeam(t, l); loaned = TeamsConnection.LoanedPlayers(t); currentAppearances = TeamsConnection.top5Appearances(t, l, true); currentGoals = TeamsConnection.Top5goalscorers(t, l, true); overallAppearances = TeamsConnection.top5Appearances(t, l, false); overallGoals = TeamsConnection.Top5goalscorers(t, l, false); avHeight = TeamsConnection.averageHeight(t); avAge = TeamsConnection.averageAge(t); travellers = TeamsConnection.top3travellers(t); formerPlayers = TeamsConnection.FormerPlayers(t); foreigners = TeamsConnection.foreigners(t); info = TeamsConnection.teamInfo(t); //foreignGoals = TeamsConnection.TeamGoalsFromForeigners(t, l); }
private void createControls(String team, Panel panel, bool home) { String prefix; if (home) { prefix = "h"; } else { prefix = "a"; } List <String> teamPlayers = TeamsConnection.displayPlayers(team, 23); TextBox[] goals = new TextBox[teamPlayers.Count]; TextBox score; TextBox[] apps = new TextBox[teamPlayers.Count]; String[] names = new String[teamPlayers.Count]; table = new Table(); table.CssClass = "players"; TableCell cell; TableCell cell2; TableCell cell3; TableRow row; TextBox c; Label l; TextBox t; cell = new TableCell(); cell2 = new TableCell(); row = new TableRow(); cell.Text = "SCORE"; cell.ColumnSpan = 2; score = new TextBox(); score.ID = prefix + "_score"; score.Width = 15; score.Text = "0"; cell2.Controls.Add(score); row.Cells.Add(cell); row.Cells.Add(cell2); table.Rows.Add(row); cell = new TableCell(); cell2 = new TableCell(); cell3 = new TableCell(); row = new TableRow(); cell.Text = "PLAYED"; cell2.Text = "NAME"; cell3.Text = "GOALS"; row.Cells.Add(cell); row.Cells.Add(cell2); row.Cells.Add(cell3); table.Rows.Add(row); int counter = 0; foreach (String pl in teamPlayers) { row = new TableRow(); cell = new TableCell(); cell2 = new TableCell(); cell3 = new TableCell(); c = new TextBox(); c.ID = prefix + "_app_" + counter.ToString(); if (prefix.Equals("h")) { c.TextChanged += new EventHandler(onHomePlayerNumber_Change); } else { c.TextChanged += new EventHandler(onAwayPlayerNumber_Change); } c.Text = "0"; c.Width = 10; //c.AutoPostBack = true; l = new Label(); l.Text = pl; l.CssClass = "playerName"; t = new TextBox(); t.ID = prefix + "_goals_" + counter.ToString(); t.Width = 10; t.Text = "0"; t.CssClass = "playerGoals"; cell.Controls.Add(c); cell2.Controls.Add(l); cell3.Controls.Add(t); goals[counter] = t; apps[counter] = c; names[counter] = pl; row.Cells.Add(cell); row.Cells.Add(cell2); row.Cells.Add(cell3); table.Rows.Add(row); counter++; } panel.Controls.Add(table); if (home) { happs = apps; hgoals = goals; hnames = names; hscore = score; } else { aapps = apps; agoals = goals; anames = names; ascore = score; } }