public bool UpdateGameDataAll(string gamedataall) { GameCenterController gController = new GameCenterController(); foreach (var gd in context.Games) { gd.GameData = new ASCIIEncoding().GetBytes(gController.GetGameCenterJson(gd.GameId)); } context.SubmitChanges(); return true; }
public bool UpdateGameData(string gamedata) { GameCenterController gController = new GameCenterController(); var currentWeek = context.SeasonWeeks.Where(sw => sw.StartDtm <= DateTime.Now && sw.EndDtm >= DateTime.Now).FirstOrDefault(); if (currentWeek == null) { currentWeek = context.SeasonWeeks.Where(sw => sw.SeasonYear == 2015 && sw.SeasonType == "REG" && sw.SeasonWeekNum == 17).FirstOrDefault(); } foreach (var gd in currentWeek.Games) { gd.GameData = new ASCIIEncoding().GetBytes(gController.GetGameCenterJson(gd.GameId)); } context.SubmitChanges(); return true; }