Example #1
0
        public ClubDTO FindClubById(int id)
        {
            string query = "Select * from clubs where id=@id";
            List <KeyValuePair <string, string> > parameters = new List <KeyValuePair <string, string> >();

            parameters.Add(new KeyValuePair <string, string>("id", id.ToString()));

            DataSet results = ExecuteQuery(query, parameters);
            ClubDTO c       = new ClubDTO();

            if (results != null && results.Tables[0].Rows.Count > 0)
            {
                c = DataSetParser.DataSetToClub(results, 0);
            }
            return(c);
        }
Example #2
0
        public List <ClubDTO> GetAllClubs()
        {
            string query = "Select * from vereniging ";
            List <KeyValuePair <string, string> > parameters = new List <KeyValuePair <string, string> >();
            DataSet results = ExecuteQuery(query, parameters);

            List <ClubDTO> clubs = new List <ClubDTO>();

            if (results != null)
            {
                for (int x = 0; x < results.Tables[0].Rows.Count; x++)
                {
                    ClubDTO c = DataSetParser.DataSetToClub(results, x);
                    clubs.Add(c);
                }
            }
            return(clubs);
        }