Beispiel #1
0
        private void BindPlayers()
        {
            if (_list == null)
            {
                _list = PlayerStrip.GetClubPlayers(ClubID);

                foreach (var player in _list)
                {
                    if (player.CurrentGuid != null)
                    {
                        FormalPlayerCount++;
                    }

                    var playerLv = player.Shirt;

                    if (player.Shorts < playerLv)
                    {
                        playerLv = player.Shorts;
                    }

                    if (player.Sock < playerLv)
                    {
                        playerLv = player.Sock;
                    }

                    if (playerLv <= ConfigGlobal.PlayerMaxLv)
                    {
                        player.AdditionalData2 = playerLv;
                        player.AdditionalData  = playerLv * 20;
                    }
                    else
                    {
                        player.AdditionalData2 = ConfigGlobal.PlayerMaxLv;
                        player.AdditionalData  = ConfigGlobal.PlayerMaxLv * 20;
                        playerLv = ConfigGlobal.PlayerMaxLv + 1;
                    }

                    if (ClubPlayerLvCount.ContainsKey(playerLv))
                    {
                        ClubPlayerLvCount[playerLv]++;
                    }
                    else
                    {
                        ClubPlayerLvCount[playerLv] = 0;
                    }
                }
            }

            _list.Sort(new PlayerComparer());

            gvPlayers.DataSource = _list;
            gvPlayers.DataBind();
        }