Создание веб-приложения, сочетающего в себе проектирование и создание баз данных, работу со сторонними форматами данных, программирование в NET и веб-разработку, страница 104

                show_players_stats();

            }

            else if (((DropDownList)sender).SelectedItem.Text.Equals("Командная статистика"))

            {

                topplayers.Visible = false;

                teams_stats.Visible = true;

                players_stats.Visible = false;

                show_teams_stats();

            }

        }

        private void show_topplayers()

        {

            bomb();

            snip();

            ass();

            goalk_per();

            def_bomb();

            def_snip();

            plus_minus();

            goalk_kf();

        }

        private void show_teams_stats()

        {

            stats_teams();

        }

        private void show_players_stats()

        {

            stats_players();

        }

    }

}

Е.8 Файл games.aspx.cs

namespace powerplay.account.office

{

    public partial class games : System.Web.UI.Page

    {

        GridView GridView2 = new GridView();

        GridView GridView1 = new GridView();

        GridView allteams = new GridView();

        string team = "";

        protected void Page_Load(object sender, EventArgs e)

        {

            GridView2.Visible = false;

            GridView2.AutoGenerateColumns = true;

            GridView1.Visible = false;

            GridView1.AutoGenerateColumns = true;

            team = PowerPlayUserProvider.getTeamByUsername(Page.User.Identity.Name)[0];

            if (Page.User.Identity.IsAuthenticated)

            {

                if (filtr_stats.Items.Count == 0)

                {

                    filtr_stats.Items.Add("Все");

                    filtr_stats.Items.Add("Сыгранные");

                    filtr_stats.Items.Add("Несыгранные");

                    PowerPlayUserProvider.getGames(GridView2, null, -1, null, "khl20122013_1");

                    build_table();

                }

                if (filtr_teams.Items.Count == 0)

                {

                    PowerPlayUserProvider.getTeamsByLeague(allteams, "khl");

                    filtr_teams.Items.Add("Все");

                    for (int i = 0; i < allteams.Rows.Count; i++)

                    {

                        filtr_teams.Items.Add(allteams.Rows[i].Cells[2].Text);

                    }

                }

                PlaceHolder1.Visible = true;

            }

            else

            {

                filtr_stats.Items.Clear();

                filtr_stats.Items.Add("Вы не авторизированы");

                filtr_stats.Enabled = false;

                filtr_teams.Visible = false;

                filtr_teams.Enabled = false;

                //filtr_stats.Text = "<select disabled><option value=\"Вы не авторизованы\">Вы не авторизованы</option></select>";

                PlaceHolder1.Visible = false;

            }

        }

        protected void build_table()

        {

            // Total number of rows.

            int rowCnt;

            rowCnt = GridView2.Rows.Count;

            FileUpload tab = null;

            Button but = null;

            TableRow tRow = new TableRow();

            Table1.Rows.Add(tRow);

            TableCell tCell = new TableCell();

            tCell.Text = "Игра";

            tRow.Cells.Add(tCell);

            tCell = new TableCell();

            tCell.Text = "Раунд";

            tRow.Cells.Add(tCell);

            tCell = new TableCell();

            tCell.Text = "Хозяева";

            tRow.Cells.Add(tCell);

            tCell = new TableCell();

            tCell.Text = "";

            tRow.Cells.Add(tCell);

            tCell = new TableCell();

            tCell.Text = "Гости";

            tRow.Cells.Add(tCell);