partial void DeleteSeasonWeeks(SeasonWeeks instance);
partial void InsertSeasonWeeks(SeasonWeeks instance);
partial void UpdateSeasonWeeks(SeasonWeeks instance);
private static void GetPayloadOwners(Payload payload, PlayerStatsController playerStatsController, OwnersController ownerController, OwnerTeamsController ownerTeamsController, PlayersController playersController, SeasonWeeks seasonWeek) { var leaguePoints = ownerTeamsController.GetLeaguePoints(seasonWeek.SeasonWeekId); payload.PayloadOwners = new List<PayloadOwner>(); foreach (var owner in ownerController.GetOwners()) { payload.PayloadOwners.Add(new PayloadOwner { Owner = owner, OwnerPoints = leaguePoints.Where(lp => lp.UniqueId == owner.UniqueId).First(), OwnerPlayerStats = playerStatsController.GetPlayerStatsForOwnerWeek(owner.UniqueId, seasonWeek.SeasonWeekId), OwnerTeam = playersController.GetOwnersTeamSimulatedWeek(owner.UniqueId, seasonWeek.SeasonWeekId) }); } }
private static void GetPayloadRanks(Payload payload, RanksController ranksController, SeasonWeeks seasonWeek) { payload.Ranks = ranksController.GetRanks(seasonWeek.SeasonWeekId); }
private static void GetPayloadGames(Payload payload, GamesController gamesController, SeasonWeeks seasonWeek) { payload.PayloadGames = new PayloadGames { Games = gamesController.GetGamesThisWeek(seasonWeek.SeasonWeekId), Byes = gamesController.GetByes(string.Empty, seasonWeek.SeasonWeekId) }; }
private static void GetPayloadCurrentOwner(Payload payload, PlayerStatsController playerStatsController, OwnersController ownerController, OwnerTeamsController ownerTeamsController, PlayersController playersController, SeasonWeeks seasonWeek, string uniqueId) { payload.CurrentOwner = ownerController.GetOwnerByUniqueId(uniqueId); payload.CurrentTeam = playersController.GetOwnersTeamSimulatedWeek(uniqueId, seasonWeek.SeasonWeekId); payload.CurrentOwnerPlayerStats = playerStatsController.GetPlayerStatsForOwnerWeek(uniqueId, seasonWeek.SeasonWeekId); payload.Owners = ownerController.GetOwners(); }
public string GetWeeksPayload(string uniqueId, int seasonWeekId, string weeks) { var payload = new Payload(); WeeksController weeksController = new WeeksController(); var ownerExists = context.Owners.Where(o => o.UniqueId == uniqueId).First(); var seasonWeek = new SeasonWeeks(); if (seasonWeekId == -1) { seasonWeek = weeksController.GetSeasonWeek(DateTime.Now.ToShortDateString()); } else { seasonWeek = weeksController.GetSeasonWeek(seasonWeekId); } GetPayloadWeeks(payload, weeksController); return Compression.Compress(JsonConvert.SerializeObject(payload)); }
public string GetUpdatePayload(string uniqueId, int seasonWeekId, string update) { var payload = new Payload(); PlayerStatsController playerStatsController = new PlayerStatsController(); PositionLimitsController positionLimitsController = new PositionLimitsController(); OwnersController ownerController = new OwnersController(); OwnerTeamsController ownerTeamsController = new OwnerTeamsController(); WeeksController weeksController = new WeeksController(); GamesController gamesController = new GamesController(); PlayersController playersController = new PlayersController(); RanksController ranksController = new RanksController(); var ownerExists = context.Owners.Where(o => o.UniqueId == uniqueId).First(); var seasonWeek = new SeasonWeeks(); if (seasonWeekId == -1) { seasonWeek = weeksController.GetSeasonWeek(DateTime.Now.ToShortDateString()); } else { seasonWeek = weeksController.GetSeasonWeek(seasonWeekId); } GetPayloadCurrentOwner(payload, playerStatsController, ownerController, ownerTeamsController, playersController, seasonWeek, uniqueId); GetPayloadOwners(payload, playerStatsController, ownerController, ownerTeamsController, playersController, seasonWeek); //GetPayloadPositionLimits(payload, positionLimitsController); //GetPayloadWeeks(payload, weeksController); GetPayloadGames(payload, gamesController, seasonWeek); //GetPayloadPlayers(payload, playersController, ownerExists); GetPayloadRanks(payload, ranksController, seasonWeek); return Compression.Compress(JsonConvert.SerializeObject(payload)); }
public string GetCurrentOwnerPayload(string uniqueId, int seasonWeekId, string owner) { var payload = new Payload(); PlayerStatsController playerStatsController = new PlayerStatsController(); OwnersController ownerController = new OwnersController(); OwnerTeamsController ownerTeamsController = new OwnerTeamsController(); WeeksController weeksController = new WeeksController(); PlayersController playersController = new PlayersController(); var ownerExists = context.Owners.Where(o => o.UniqueId == uniqueId).First(); var seasonWeek = new SeasonWeeks(); if (seasonWeekId == -1) { seasonWeek = weeksController.GetSeasonWeek(DateTime.Now.ToShortDateString()); } else { seasonWeek = weeksController.GetSeasonWeek(seasonWeekId); } GetPayloadCurrentOwner(payload, playerStatsController, ownerController, ownerTeamsController, playersController, seasonWeek, uniqueId); return Compression.Compress(JsonConvert.SerializeObject(payload)); }