private static void CreateMatchResultTable() { Awesome.Models.DB.Result result = new Awesome.Models.DB.Result(); foreach (Match match in TournamentUtility.CreateMatchList(new FootballApiClient().GetGroupStageMatches())) { MatchResult item = new MatchResult { HomeTeam = match.HomeTeam, AwayTeam = match.AwayTeam, HomeScore = match.HomeScore, AwayScore = match.AwayScore, MatchResultId = match.MatchId, Status = match.Status, ManuallyUpdated = false }; result.MatchResults.Add(item); } UserManager.AddResult(result, false); }
public static void AutomaticUpdateResults() { Awesome.Models.DB.Result currentResult = UserManager.GetResult(); if (currentResult == null) { CreateMatchResultTable(); } else { Awesome.ApiIntegration.JsonGroupStageResult.JsonGroupStageResult groupStageMatches = new FootballApiClient().GetGroupStageMatches(); if (groupStageMatches == null) { AutomaticUpdateResultsFromDb(currentResult); } else { Awesome.Models.DB.Result result = new Awesome.Models.DB.Result(); foreach (Match match in TournamentUtility.CreateMatchList(groupStageMatches)) { if (match.Status == "FINISHED") { MatchResult item = new MatchResult { HomeTeam = match.HomeTeam, AwayTeam = match.AwayTeam, HomeScore = match.HomeScore, AwayScore = match.AwayScore, MatchResultId = match.MatchId, Status = match.Status, ManuallyUpdated = false }; result.MatchResults.Add(item); } } UserManager.AddResult(result, false); } } }
public Bet(JsonGroupStageResult groupStageMatches) { Matches = TournamentUtility.CreateMatchList(groupStageMatches); }
public ReportedResult(JsonGroupStageResult groupStageMatches) { Matches = TournamentUtility.CreateMatchList(groupStageMatches); Result = UserManager.GetResult(); }