public async Task <Sportccbetdata> GetAllPlayersByCountry(Country country) { HttpClient client = GetClient(); Sportccbetdata SportCollection = new Sportccbetdata(); string te = country.Id; for (int i = 240; i < 260; i++) { string result = await client.GetStringAsync(Url + "PlayerList.aspx?tid=" + i + "&" + authID); if (result != null) { XmlSerializer Deserializer = new XmlSerializer(typeof(Sportccbetdata), new XmlRootAttribute("sportccbetdata")); var reader = new StringReader(result); SportCollection = (Sportccbetdata)Deserializer.Deserialize(reader); if (SportCollection.PlayerList != null && country.Id != null) { foreach (Player player in SportCollection.PlayerList.Player) { if (player.CountryId == country.Id) { players.Add(player); } } } } } SportCollection.PlayerList.Player = players; return(SportCollection); }
public async Task <Sportccbetdata> GetAllLeaguesByCountry(Country country) { HttpClient client = GetClient(); List <Subcontest> subC = new List <Subcontest>(); Sportccbetdata SportCollection = new Sportccbetdata(); string result = await client.GetStringAsync(Url + "SubContests.aspx?sport_id=1&" + authID); if (result != null) { XmlSerializer Deserializer = new XmlSerializer(typeof(Sportccbetdata), new XmlRootAttribute("sportccbetdata")); var reader = new StringReader(result); SportCollection = (Sportccbetdata)Deserializer.Deserialize(reader); if (SportCollection.SubContests != null && country.Id != null) { foreach (Subcontest SubC in SportCollection.SubContests.Subcontest) { if (SubC.Countryid == country.Id && SubC.Season == "2019/20") { subC.Add(SubC); } } } } SportCollection.SubContests.Subcontest = subC; return(SportCollection); }
async void Update() { Sportccbetdata scc = await dataManager.GetAllCountries(); foreach (Country country in scc.CountryList.Countries) { countries.Add(country); } }
private async Task Update() { Sportccbetdata scc = await dataManager.GetAllSports(); foreach (Sport sport in scc.SportList.Sport) { SportsCollection.Add(sport); } }
async void Update() { Sportccbetdata scc = await dataManager.GetAllCompetitorsByCountry(_country, _sport); foreach (Competitor comp in scc.Sport.Competitor) { clubs.Add(comp); } }
private async Task MakeCountriesList(Sport sportID) { Sportccbetdata matches = await dataManager.GetAllLiveMatchesForTodayForOneSport(sportID); foreach (Category cat in matches.Sports.Sport.Category) { if (Countries.Count == 0) { await GetCountries(); } var country1 = Countries.FirstOrDefault(x => x.Id == cat.Id); foreach (Tournament tour in cat.Tournaments) { var tournamentGroup = new TournamentGroup() { Name = tour.Name }; foreach (Match match in tour.Match) { var matchIndex = 0; Match obj = country1.Matches.FirstOrDefault(x => x.Id == match.Id); if (obj == null) { country1.Matches.Add(match); Matches.Add(match); match.CountryID = country1.Id; } else { Matches.Add(match); match.CountryID = country1.Id; matchIndex = country1.Matches.IndexOf(obj); country1.Matches[matchIndex].Result = match.Result; country1.Matches[matchIndex].Minutes = match.Minutes; } foreach (Competitor com in match.Competitors.Competitor) { if (com.Type == "1") { match.HomeTeam = com; } if (com.Type == "2") { match.AwayTeam = com; } } if (!Tournaments.Contains(tournamentGroup)) { Tournaments.Add(tournamentGroup); } } } CategoriesWithLiveGames.Add(cat); } }
public async Task <Sportccbetdata> GetAllCountries() { HttpClient client = GetClient(); string result = await client.GetStringAsync(Url + "CountryList.aspx?" + authID); XmlSerializer Deserializer = new XmlSerializer(typeof(Sportccbetdata), new XmlRootAttribute("sportccbetdata")); var reader = new StringReader(result); Sportccbetdata SportCollection = (Sportccbetdata)Deserializer.Deserialize(reader); return(SportCollection); }
public async Task <Sportccbetdata> GetAllCompetitorsByCountry(Country country, Sport _sport) { HttpClient client = GetClient(); string result = await client.GetStringAsync(Url + "CompetitorsInCountrySport.aspx?cid=" + country.Id + "&sport_id=" + _sport.Id + "&" + authID); XmlSerializer Deserializer = new XmlSerializer(typeof(Sportccbetdata), new XmlRootAttribute("sportccbetdata")); var reader = new StringReader(result); Sportccbetdata SportCollection = (Sportccbetdata)Deserializer.Deserialize(reader); return(SportCollection); }
public async Task <Sportccbetdata> GetLeagueTableByLeagueID(string sub) { HttpClient client = GetClient(); string result = await client.GetStringAsync(Url + "SportccLeagueTable.aspx?lid=" + sub + "&" + authID); XmlSerializer Deserializer = new XmlSerializer(typeof(Sportccbetdata), new XmlRootAttribute("sportccbetdata")); var reader = new StringReader(result); Sportccbetdata SportCollection = (Sportccbetdata)Deserializer.Deserialize(reader); return(SportCollection); }
private async void Update() { Sportccbetdata scc = await dataManager.GetAllPlayersByCountry(_country); if (scc.PlayerList != null) { foreach (Player player in scc.PlayerList.Player) { players.Add(player); } } }
private async void Update() { Sportccbetdata scc = await dataManager.GetAllLeaguesByCountry(_country); if (scc.SubContests != null) { foreach (Subcontest subC in scc.SubContests.Subcontest) { subContests.Add(subC); } } }
public async Task <Sportccbetdata> GetAllMatchesForTodayForOneSport(Sport sport, DateTime dt) { HttpClient client = GetClient(); string test = Url + "sportccfixtures.aspx?sport_id=" + sport.Id + "&" + authID + "&fromDate=" + dt.ToString("MM-dd-yy") + "&toDate=" + dt.ToString("MM-dd-yy"); string result = await client.GetStringAsync(Url + "sportccfixtures.aspx?sport_id=" + sport.Id + "&" + authID + "&fromDate=" + dt.ToString("MM-dd-yy") + "&toDate=" + dt.ToString("MM-dd-yy")); XmlSerializer Deserializer = new XmlSerializer(typeof(Sportccbetdata), new XmlRootAttribute("sportccbetdata")); var reader = new StringReader(result); Sportccbetdata SportCollection = (Sportccbetdata)Deserializer.Deserialize(reader); return(SportCollection); }
private async void Update() { //IEnumerable<Sport> sportCollection = await dataManager.GetAllSports(); //sport = await dataManager.GetAllSports(); Sportccbetdata scc = await dataManager.GetAllSports(); // SportList sportCollection = await dataManager.GetAllSports(); foreach (Sport sport in scc.SportList.Sport) { sports.Add(sport); } }
private async Task GetCountries() { Sportccbetdata scc = await dataManager.GetAllCountries(); foreach (Country country in scc.CountryList.Countries) { Country obj = Countries.FirstOrDefault(x => x.Id == country.Id); if (obj == null) { Countries.Add(country); } } CountriesWithLiveGamesToday = Countries; }
private async void Update() { Sportccbetdata scc = await dataManager.GetLeagueTableByLeagueID(_tournamentID); foreach (Tournament tour in scc.Category.Tournaments) { foreach (Competitor com in tour.Competitor) { Int32.TryParse(com.Place, out int a); com.PlaceInt = a; } SortedList = tour.Competitor.OrderBy(o => o.PlaceInt).ToList(); foreach (Competitor com in SortedList) { clubs.Add(com); } } }
private async void Update() { Sportccbetdata scc = await dataManager.GetAllVenues(); foreach (Venue venue in scc.VenueList.Venue) { Int32.TryParse(venue.Capacity, out int a); venue.IDToInt = a; } Unsorted = scc.VenueList.Venue.OrderByDescending(o => o.IDToInt).ToList(); foreach (Venue venue in Unsorted) { if (venue.Countryid == _country.Id) { venues.Add(venue); } } }
private async Task SetClubsForTournament() { Sportccbetdata scc = await dm.GetLeagueTableByLeagueID(Match.TournamentId); foreach (Tournament tour in scc.Category.Tournaments) { foreach (Competitor com in tour.Competitor) { Int32.TryParse(com.Place, out int a); com.PlaceInt = a; } // Clubs = tour.Competitor.OrderBy(o => o.PlaceInt).ToList(); var var = tour.Competitor.OrderBy(o => o.PlaceInt).ToList(); SortedList = tour.Competitor.OrderBy(o => o.PlaceInt).ToList(); foreach (Competitor com in var) { Clubs.Add(com); } } }
public async Task <Sportccbetdata> GetAllLiveMatchesForTodayForOneSport(Sport sport) { Sportccbetdata SportCollection = new Sportccbetdata(); HttpClient client = GetClient(); try { string result = await client.GetStringAsync(Url + "SportccLive.aspx?sport_id=" + sport.Id + "&" + authID); XmlSerializer Deserializer = new XmlSerializer(typeof(Sportccbetdata), new XmlRootAttribute("sportccbetdata")); var reader = new StringReader(result); SportCollection = (Sportccbetdata)Deserializer.Deserialize(reader); return(SportCollection); } catch (Exception e) { Console.WriteLine(e); } return(SportCollection); }