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

                dt.Clear();

                da = new MySqlDataAdapter(sql, conn);

                da.Fill(dt);

                report.DataSource = dt;

                report.DataBind();

                if (report.Rows.Count > 0)

                    player_id = Convert.ToInt32(report.Rows[0].Cells[0].Text);

                else throw new Exception();

                /*НАХОДИМ ВСЕХ ИГРОКОВ В ЛИГЕ ПО ЕГО ПОКАЗАТЕЛЮ И АМПЛУА И УЗНАЕМ ЕГО ПОЗИЦИЮ*/

                sql = "select " + table_players_stats + ".player, players.name,teams.abb,sum(" + table_players_stats + ".gp) as GP,sum(" + table_players_stats + ".g) as G,sum(" + table_players_stats + ".a) as A,sum(" + table_players_stats + ".p) as P,sum(" + table_players_stats + ".pl_mn) as PL_MN,sum(" + table_players_stats + ".pim) as PIM,ROUND(sum(" + table_players_stats + ".pim)/sum(" + table_players_stats + ".gp),2) as PIM_G,sum(" + table_players_stats + ".g_fs) as GFS,sum(" + table_players_stats + ".g_pp) as GPP,sum(" + table_players_stats + ".g_sh) as GSH,sum(" + table_players_stats + ".g_ot) as GOT,sum(" + table_players_stats + ".g_w) as GW,sum(" + table_players_stats + ".so) as SO,sum(" + table_players_stats + ".g_so) as GSO,ROUND(sum(" + table_players_stats + ".g_so)/sum(" + table_players_stats + ".so)*100,2) as SOR,sum(" + table_players_stats + ".g_wso) as GWSO,sum(" + table_players_stats + ".sh) as SH,ROUND(sum(" + table_players_stats + ".fo_w)/sum(" + table_players_stats + ".fo)*100,2) as FO_per,ROUND(sum(" + table_players_stats + ".toi)/sum(" + table_players_stats + ".gp),2) as TOI,ROUND(sum(" + table_players_stats + ".sft)/sum(" + table_players_stats + ".gp),2) as SFT from " + table_players_stats + " inner join players on players.id = " + table_players_stats + ".player inner join teams on teams.id = " + table_players_stats + ".team  " + search + " group by " + table_players_stats + ".player order by " + indicator + " DESC;";

                dt.Clear();

                da = new MySqlDataAdapter(sql, conn);

                da.Fill(dt);

                report.DataSource = dt;

                report.DataBind();

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

                {

                    if (Convert.ToInt32(report.Rows[i].Cells[0].Text) == player_id) pos = i+1;

                }

                /*ДОСТАЕМ ИГРОКА ЛИДЕРА КОМАНДЫ*/

                sql = "select " + table_players_stats + ".player, players.name,teams.abb,sum(" + table_players_stats + ".gp) as GP,sum(" + table_players_stats + ".g) as G,sum(" + table_players_stats + ".a) as A,sum(" + table_players_stats + ".p) as P,sum(" + table_players_stats + ".pl_mn) as PL_MN,sum(" + table_players_stats + ".pim) as PIM,ROUND(sum(" + table_players_stats + ".pim)/sum(" + table_players_stats + ".gp),2) as PIM_G,sum(" + table_players_stats + ".g_fs) as GFS,sum(" + table_players_stats + ".g_pp) as GPP,sum(" + table_players_stats + ".g_sh) as GSH,sum(" + table_players_stats + ".g_ot) as GOT,sum(" + table_players_stats + ".g_w) as GW,sum(" + table_players_stats + ".so) as SO,sum(" + table_players_stats + ".g_so) as GSO,ROUND(sum(" + table_players_stats + ".g_so)/sum(" + table_players_stats + ".so)*100,2) as SOR,sum(" + table_players_stats + ".g_wso) as GWSO,sum(" + table_players_stats + ".sh) as SH,ROUND(sum(" + table_players_stats + ".fo_w)/sum(" + table_players_stats + ".fo)*100,2) as FO_per,ROUND(sum(" + table_players_stats + ".toi)/sum(" + table_players_stats + ".gp),2) as TOI,ROUND(sum(" + table_players_stats + ".sft)/sum(" + table_players_stats + ".gp),2) as SFT from " + table_players_stats + " inner join players on players.id = " + table_players_stats + ".player and " + table_players_stats + ".player = " + player_id + " inner join teams on teams.id = " + table_players_stats + ".team group by " + table_players_stats + ".player;";