예제 #1
0
        public Charity GetCharity(int charityId)
        {
            var reader = Reader.GetTableReader(RunnerRequest.Charity(charityId));

            reader.Read();
            return(new Charity(
                       reader["CharityId"].ToString(),
                       reader["CharityName"].ToString(),
                       reader["CharityDescription"].ToString(),
                       reader["CharityLogo"].ToString()
                       ));
        }
예제 #2
0
        public List <Sponsor> GetSponsorship(int runnerId)
        {
            var reader   = Reader.GetTableReader(RunnerRequest.Sponsorship(runnerId));
            var sponsors = new List <Sponsor>();

            while (reader.Read())
            {
                var sponsor = new Sponsor(
                    reader["SponsorshipId"].ToString(),
                    reader["SponsorName"].ToString(),
                    reader["RegistrationId"].ToString(),
                    reader["Amount"].ToString(),
                    reader["CharityId"].ToString()
                    );
                sponsors.Add(sponsor);
            }
            return(sponsors);
        }
예제 #3
0
        public List <RaceInfo> GetRaces(int runnerId)
        {
            var reader = Reader.GetTableReader(RunnerRequest.Races(runnerId));
            var races  = new List <RaceInfo>();

            while (reader.Read())
            {
                var race = new RaceInfo(
                    reader["Gender"].ToString(),
                    reader["DateOfBirth"].ToString(),
                    reader["RaceTime"].ToString(),
                    reader["CountryName"].ToString(),
                    reader["EventTypeName"].ToString(),
                    reader["YearHeld"].ToString()
                    );
                races.Add(race);
            }
            return(races);
        }