public WinsLosses GetWinsLosses(NPGGFFLDataContext context, int teamId, int seasonWeekId) { var seasonWeek = context.SeasonWeeks.Where(sw => sw.SeasonWeekId == seasonWeekId).FirstOrDefault(); var query = NPGGFFLApi.queries.WinsLossesQuery; query = query.Replace("{{:TeamFilter}}", string.Format("t.teamid = {0}", teamId.ToString() )); query = query.Replace("{{:SeasonWeekFilter}}", string.Format("and sw.SeasonYear = {0} and sw.SeasonTypeId = {1} and sw.WeekNum <= {2}", new string[] { seasonWeek.SeasonYear.ToString(), seasonWeek.SeasonTypeId.ToString(), seasonWeek.WeekNum.ToString() })); return context.ExecuteQuery<WinsLosses>(query).FirstOrDefault(); }
public static IEnumerable<PlayerRanks> GetPlayerRankings(NPGGFFLDataContext context, int seasonYear, int seasonTypeId) { var query = NPGGFFLApi.queries.PlayerRankingsQuery; query = query.Replace("{{:PlayerPointsQuery}}", NPGGFFLApi.queries.PlayerPointsQuery); query = query.Replace("{{:GameFilter}}", string.Empty); query = query.Replace("{{:PlayerFilter}}", string.Empty); query = query.Replace("{{:SeasonWeekFilter}}", string.Format("pp.SeasonYear = {0} and pp.SeasonTypeId = {1}", seasonYear, seasonTypeId)); return context.ExecuteQuery<PlayerRanks>(query); }
public static IEnumerable<PlayerPointsLine> GetPlayerPoints(NPGGFFLDataContext context, int gameId) { var query = NPGGFFLApi.queries.PlayerPointsQuery; query = query.Replace("{{:GameFilter}}", string.Format("and g.gameid = {0}", gameId)).Replace("{{:PlayerFilter}}", string.Empty); return context.ExecuteQuery<PlayerPointsLine>(query); }
public static PlayerPointsLine GetPlayerPoints(NPGGFFLDataContext context, int playerId, int gameId) { var query = NPGGFFLApi.queries.PlayerPointsQuery; query = query.Replace("{{:GameFilter}}", string.Format("and g.gameid = {0}", gameId)).Replace("{{:PlayerFilter}}", string.Format("and p.playerid = {0}", playerId)); return context.ExecuteQuery<PlayerPointsLine>(query).FirstOrDefault(); }
public static IEnumerable<DefensivePlayerRanks> GetDefensiveRanks(NPGGFFLDataContext context, int seasonYear, int seasonTypeId) { var query = NPGGFFLApi.queries.DefensiveRanksQuery; query = query.Replace("{{:PlayerPointsQuery}}", NPGGFFLApi.queries.PlayerPointsQuery); query = query.Replace("{{:GameFilter}}", string.Empty); query = query.Replace("{{:PlayerFilter}}", string.Empty); query = query.Replace("{{:SeasonWeekFilter}}", string.Format("and dpp.SeasonYear = {0} and dpp.SeasonTypeId = {1}", seasonYear, seasonTypeId)); query = query.Replace("{{:PlayerPositionFilter}}", "and dpp.PositionName = 'DST' and pop.PositionName <> 'DST'"); return context.ExecuteQuery<DefensivePlayerRanks>(query); }
public static IEnumerable<PlayerPointsLine> GetAllPlayerPoints(NPGGFFLDataContext context) { var query = NPGGFFLApi.queries.PlayerPointsQuery; query = query.Replace("{{:GameFilter}}", string.Empty).Replace("{{:PlayerFilter}}", string.Empty); return context.ExecuteQuery<PlayerPointsLine>(query); }