Esempio n. 1
0
        public async Task <IList <Tournament> > FetchTournamentsFromServerAsync(string sessionId, DateTime startDate, DateTime endDate)
        {
            DataFetcher fetcher = new DataFetcher(sessionId);

            var startDateString = startDate.Year + "-" + startDate.Month + "-" + startDate.Day;

            fetcher.StartDate = startDateString;

            var endDateString = endDate.Year + "-" + endDate.Month + "-" + endDate.Day;

            fetcher.EndDate = endDateString;

            var data = await fetcher.GetTournamentsAsync();

            DataParser parser = new DataParser(data);

            var tournaments = parser.ParseTournaments();

            return(tournaments);
        }
Esempio n. 2
0
        public async Task <IList <Session> > FetchSessionsFromServer(string sessionId, DateTime startDate, DateTime endDate)
        {
            DataFetcher fetcher = new DataFetcher(sessionId);

            var startDateString = startDate.Year + "-" + startDate.Month + "-" + startDate.Day;

            fetcher.StartDate = startDateString;

            var endDateString = endDate.Year + "-" + endDate.Month + "-" + endDate.Day;

            fetcher.EndDate = endDateString;

            var data = await fetcher.GetCashSessionsAsync();

            DataParser dp = new DataParser(data);

            var sessions = dp.ParseSessions();

            return(sessions);
        }