public ManyScoresPacket GetTopScores() { List <ScoresInfo> retrievedInfo = SQLConnection.GetTopTeams(); // make into json a packet with the top teams info to return back ManyScoresPacket multipleScoresPacket = new ManyScoresPacket(); multipleScoresPacket.topTeamInfos = retrievedInfo; multipleScoresPacket.currentTeamInfo = null; var convertedInfo = JsonConvert.SerializeObject(multipleScoresPacket); Send(convertedInfo); return(multipleScoresPacket); }
protected ManyScoresPacket PutScores(ScoresInfo scores) { // add the scores to the database and retrieve the team information including the current team SQLConnection.AddTeamScore(scores); Tuple <List <ScoresInfo>, ScoresInfo> retrievedInfo = SQLConnection.GetTopTeamsAndCurrentTeam(scores.teamName); // make into json a packet with the top teams info and current team info to return back ManyScoresPacket multipleScoresPacket = new ManyScoresPacket(); multipleScoresPacket.topTeamInfos = retrievedInfo.Item1; multipleScoresPacket.currentTeamInfo = retrievedInfo.Item2; var convertedInfo = JsonConvert.SerializeObject(multipleScoresPacket); Send(convertedInfo); return(multipleScoresPacket); }