Exemplo n.º 1
0
        private static matchResult EvaluateResult(ArrayOfMatchResult matchMatchResults)
        {
            matchResult result90Min = (from r in matchMatchResults where r.resultTypeId == 2 select r).FirstOrDefault();

            matchResult resultVerlaengerung = (from r in matchMatchResults where r.resultTypeId == 4 select r).FirstOrDefault();

            matchResult resultFinal = (from r in matchMatchResults where r.resultTypeId == 5 select r).FirstOrDefault();

            if (resultVerlaengerung == null)
            {
                if (resultFinal != null && result90Min != null)
                {
                    return(resultFinal);
                }

                if (result90Min != null)
                {
                    return(result90Min);
                }

                if (resultFinal != null)
                {
                    return(resultFinal);
                }
            }
            else
            {
                return(result90Min);
            }

            return(null);
        }
Exemplo n.º 2
0
        private static MatchDataModel Create(WMTippApp.SvcFussballDB.Matchdata match)
        {
            var matchModelObj = new MatchDataModel();

            matchModelObj.MatchId        = match.matchID;
            matchModelObj.GroupId        = match.groupOrderID;
            matchModelObj.KickoffTime    = match.matchDateTime;
            matchModelObj.KickoffTimeUTC = match.matchDateTimeUTC;
            matchModelObj.HomeTeamId     = match.idTeam1;
            matchModelObj.AwayTeamId     = match.idTeam2;
            matchModelObj.HomeTeamScore  = match.pointsTeam1;
            matchModelObj.AwayTeamScore  = match.pointsTeam2;
            matchModelObj.HomeTeamIcon   = match.iconUrlTeam1;
            matchModelObj.AwayTeamIcon   = match.iconUrlTeam2;
            matchModelObj.HomeTeam       = match.nameTeam1;
            matchModelObj.AwayTeam       = match.nameTeam2;
            matchModelObj.IsFinished     = match.matchIsFinished;
            matchModelObj.LeagueShortcut = match.leagueShortcut;

            if (match.matchResults != null && match.matchResults.Any())
            {
                matchResult result = EvaluateResult(match.matchResults);

                matchModelObj.HasVerlaengerung = false;

                if (result != null)
                {
                    matchModelObj.HomeTeamScore = result.pointsTeam1;
                    matchModelObj.AwayTeamScore = result.pointsTeam2;
                }
            }

            return(matchModelObj);
        }