report.Rows[i].Cells[0].Text = (i + 1).ToString();
if (i % 2 == 0) report.Rows[i].BackColor = System.Drawing.Color.Beige;
else report.Rows[i].BackColor = System.Drawing.Color.LightGray;
if (report.Rows[i].Cells[1].Text == team)
{
report.Rows[i].BackColor = System.Drawing.Color.Pink;
}
}
if (report != null)
{
report.HeaderRow.BackColor = System.Drawing.Color.LightBlue;
report.HeaderRow.ForeColor = System.Drawing.Color.Black;
report.ForeColor = System.Drawing.Color.DimGray;
report.HeaderRow.Cells[0].Text = "#";
report.HeaderRow.Cells[11].Text = "p%";
report.HeaderRow.Cells[20].Text = "pp%";
report.HeaderRow.Cells[22].Text = "pk%";
report.HeaderRow.Cells[24].Text = "s/g";
report.HeaderRow.Cells[25].Text = "sa/g";
report.HeaderRow.Cells[26].Text = "g1w%";
report.HeaderRow.Cells[27].Text = "ga1w%";
report.HeaderRow.Cells[28].Text = "os%";
report.HeaderRow.Cells[29].Text = "osa%";
report.HeaderRow.Cells[30].Text = "fo%";
}
conn.Close();
}
catch (MySqlException exp)
{
conn.Close();
}
}
public static void getStatsOfPlayers(GridView report, string team, string position, string player, string season)
{
string database = "powerplay";
string password_db = "admin";
string user_db = "root";
string server_db = "localhost";
connectionString = ("server=" + server_db + "; user id=" + user_db + "; password=" + password_db + "; database=" + database + "");
MySqlConnection conn = null;
try
{
//ОБЪЯВЛЕНИЕ
string table_players_stats = season+"_playersstats";
conn = new MySqlConnection(connectionString);
conn.Open();
string sql;
string team_filter = "";
string player_filter = "";
int num = 0;
string search = "";
MySqlDataAdapter da = null;
DataTable dt = new DataTable();
//ВЫБИРАЕМ СТРОКУ ИЗ ТАБЛИЦЫ
if (team != null && team != "")
{
team_filter = " AND teams.name = '" + team + "' ";
}
else
{
team_filter = "";
}
if (player != null && player != "")
{
player_filter = " AND players.name = '" + player + "' ";
}
else
{
team_filter = "";
}
if (position != null)
{
if (position.Contains("LW") || position.Contains("RW") || position.Contains("C") || position.Contains("DD") || position.Contains("OD"))
{
search += " AND (";
for (int i = 0; i < position.Split(',').Length; i++)
{
if (i == 0)
Уважаемый посетитель!
Чтобы распечатать файл, скачайте его (в формате Word).
Ссылка на скачивание - внизу страницы.