public void Get(PlayerGameLogs players, string gameid)
        {
            Dictionary <string, string> values = new Dictionary <string, string>()
            {
                { "@game", gameid }
            };
            List <string[]> results   = SelectProc("GetAllPlayerGameStats", values);
            Player          player    = null;
            PlayerGameStats gameStats = null;

            foreach (string[] result in results)
            {
                if (player == null || player.player.playerid != result[0])
                {
                    if (player != null)
                    {
                        players.playergamelogs.Add(player);
                    }
                    player                 = new Player();
                    player.gameLogs        = new List <PlayerGameStats>();
                    player.player.playerid = result[0];
                    player.player.fname    = result[1];
                    player.player.lname    = result[2];
                    player.player.number   = result[3];
                    player.player.position = result[4];
                    player.team.abbr       = result[5];
                    player.team.city       = result[6];
                    player.team.name       = result[7];
                }
                gameStats                    = new PlayerGameStats();
                gameStats.game.gameid        = result[8];
                gameStats.game.date          = result[9];
                gameStats.game.time          = result[10];
                gameStats.game.homeTeam.abbr = result[11];
                gameStats.game.homeTeam.city = result[12];
                gameStats.game.homeTeam.name = result[13];
                gameStats.game.awayTeam.abbr = result[14];
                gameStats.game.awayTeam.city = result[15];
                gameStats.game.awayTeam.name = result[16];
                gameStats.stats.passAtt      = result[17];
                gameStats.stats.passComp     = result[18];
                gameStats.stats.passYds      = result[19];
                gameStats.stats.passTds      = result[20];
                gameStats.stats.intc         = result[21];
                gameStats.stats.rushAtt      = result[22];
                gameStats.stats.rushYds      = result[23];
                gameStats.stats.rushTds      = result[24];
                gameStats.stats.fum          = result[25];
                gameStats.stats.rec          = result[26];
                gameStats.stats.recYds       = result[27];
                gameStats.stats.recTds       = result[28];
                gameStats.stats.fgAtt        = result[29];
                gameStats.stats.fgMade       = result[30];
                gameStats.stats.xpAtt        = result[31];
                gameStats.stats.xpMade       = result[32];
                gameStats.stats.fgPct        = result[33];
                gameStats.stats.xpPct        = result[34];
                player.gameLogs.Add(gameStats);
            }
        }
Exemple #2
0
        public Object GetAllPlayerGameLogs(string gameid)
        {
            PlayerGameLogs    players = new PlayerGameLogs();
            PlayerGameService service = new PlayerGameService();

            try
            {
                service.Get(players, gameid);
            }
            catch (Exception e)
            {
                return(e);
            }
            return(players);
        }