示例#1
0
 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);
 }
示例#2
0
 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);
         }
     }
 }
示例#3
0
 public Bet(JsonGroupStageResult groupStageMatches)
 {
     Matches = TournamentUtility.CreateMatchList(groupStageMatches);
 }
示例#4
0
 public ReportedResult(JsonGroupStageResult groupStageMatches)
 {
     Matches = TournamentUtility.CreateMatchList(groupStageMatches);
     Result  = UserManager.GetResult();
 }