Ejemplo n.º 1
0
        private Kalender CreateKalenderMatch(Reeks reeks, TeamMatchEntryType frenoyMatch, string thuisPloegCode)
        {
            var kalender = new Kalender
            {
                FrenoyMatchId = frenoyMatch.MatchId,
                Datum = frenoyMatch.Date,
                Uur = new TimeSpan(frenoyMatch.Time.Hour, 0, 0),
                ThuisClubID = GetClubId(frenoyMatch.HomeClub),
                ThuisPloeg = ExtractTeamCodeFromFrenoyName(frenoyMatch.HomeTeam),
                UitClubID = GetClubId(frenoyMatch.AwayClub),
                UitPloeg = ExtractTeamCodeFromFrenoyName(frenoyMatch.AwayTeam),
                Week = int.Parse(frenoyMatch.WeekName)
            };

            kalender.ThuisClubPloegID = GetClubPloegId(reeks.ID, kalender.ThuisClubID.Value, kalender.ThuisPloeg);
            kalender.UitClubPloegID = GetClubPloegId(reeks.ID, kalender.UitClubID.Value, kalender.UitPloeg);

            // In the db the ThuisClubId is always Erembodegem
            kalender.Thuis = kalender.ThuisClubID == _thuisClubId && kalender.ThuisPloeg == thuisPloegCode ? 1 : 0;
            if (kalender.Thuis == 0)
            {
                var thuisClubId = kalender.ThuisClubID;
                var thuisPloeg = kalender.ThuisPloeg;
                var thuisClubPloegId = kalender.ThuisClubPloegID;

                kalender.ThuisClubID = kalender.UitClubID;
                kalender.ThuisPloeg = kalender.UitPloeg;
                kalender.ThuisClubPloegID = kalender.UitClubPloegID;

                kalender.UitClubID = thuisClubId;
                kalender.UitPloeg = thuisPloeg;
                kalender.UitClubPloegID = thuisClubPloegId;
            }
            return kalender;
        }
Ejemplo n.º 2
0
        private Reeks CreateReeks(TeamEntryType frenoyTeam)
        {
            var reeks = new Reeks();
            reeks.Competitie = _options.Competitie;
            reeks.ReeksType = _options.ReeksType;
            reeks.Jaar = _options.Jaar;
            reeks.LinkID = $"{frenoyTeam.DivisionId}_{frenoyTeam.Team}";

            if (_isVttl)
            {
                var reeksMatch = VttlReeksRegex.Match(frenoyTeam.DivisionName);
                reeks.ReeksNummer = reeksMatch.Groups[1].Value;
                reeks.ReeksCode = reeksMatch.Groups[2].Value;
            }
            else
            {
                var reeksMatch = SportaReeksRegex.Match(frenoyTeam.DivisionName.Trim());
                reeks.ReeksNummer = reeksMatch.Groups[1].Value;
                reeks.ReeksCode = reeksMatch.Groups[2].Value;
            }

            reeks.FrenoyDivisionId = int.Parse(frenoyTeam.DivisionId);
            reeks.FrenoyTeamId = frenoyTeam.TeamId;
            return reeks;
        }
Ejemplo n.º 3
0
 private ClubPloeg CreateClubPloeg(Reeks reeks, RankingEntryType frenoyTeam)
 {
     var clubPloeg = new ClubPloeg();
     clubPloeg.ReeksId = reeks.ID;
     clubPloeg.ClubId = GetClubId(frenoyTeam.TeamClub);
     clubPloeg.Code = ExtractTeamCodeFromFrenoyName(frenoyTeam.Team);
     return clubPloeg;
 }