public ISportDetails GetSportDetail(string sportCode) { if (string.IsNullOrEmpty(sportCode)) { return(null); } Model.Interface.ISportOverview overview = Supervisor.GetSportOverview(sportCode); if (overview == null) { return(null); } SportDetails details = new SportDetails(); FillSportOverview(details, overview); foreach (var fixture in Supervisor.GetFixtures()) { if (string.Equals(fixture.Sport, sportCode)) { // do not include deleted or matchover fixtures if (fixture.ListenerOverview.IsDeleted.GetValueOrDefault() || (fixture.ListenerOverview.MatchStatus.HasValue && (int)fixture.ListenerOverview.MatchStatus.Value >= (int)Integration.Adapter.Model.Enums.MatchStatus.MatchOverUnConfirmed)) { continue; } details.AddFixture(CreateFixtureOverview(fixture)); } } return(details); }
private static void FillSportOverview(Model.Service.Model.SportOverview to, Model.Interface.ISportOverview from) { to.Name = from.Name; to.InErrorState = from.InErrorState; to.InPlay = from.InPlay; to.InPreMatch = from.InPreMatch; to.InSetup = from.InSetup; to.Total = from.Total; }
private void OnSportUpdate(Model.Interface.ISportOverview sport) { if (sport == null) { return; } SportDetails details = new SportDetails(); // we don't send out the entire list of fixtures as the // amount of data would be too big FillSportOverview(details, sport); Supervisor.Service.StreamingService.OnSportUpdate(details); }