Beispiel #1
0
        public static List <Subscription> getAllSubscriptions()
        {
            List <Dictionary <string, object> > results = querySql(""
                                                                   + "SELECT "
                                                                   + "* "
                                                                   + "FROM "
                                                                   + "`" + tableName + "`"
                                                                   );

            List <Subscription> subscriptions = new List <Subscription>();

            foreach (var row in results)
            {
                Competition competition = CompetitionProvider.getCompetitionById(Convert.ToInt32(row[field_competitionId]));

                Discipline discipline = DisciplineProvider.getDisciplineById(Convert.ToInt32(row[field_disciplineId]));

                subscriptions.Add(getSubscriptionByPrimaryKey(
                                      Convert.ToInt32(row[field_sportsFestivalSubscriptionId]),
                                      competition,
                                      discipline
                                      ));
            }

            return(subscriptions);
        }
        public static List <Competition> getCompetitionsBySportsFestival(SportsFestival sportsFestival)
        {
            List <Dictionary <string, object> > results = querySql(""
                                                                   + "SELECT "
                                                                   + "* "
                                                                   + "FROM "
                                                                   + "`" + tableName + "` "
                                                                   + "WHERE "
                                                                   + "`" + field_sportsFestivalId + "` = " + sportsFestival.SportsFestivalId
                                                                   );

            List <Competition> competitions = new List <Competition>();

            foreach (var row in results)
            {
                competitions.Add(CompetitionProvider.getCompetitionById(Convert.ToInt32(row[field_competitionId])));
            }

            return(competitions);
        }
Beispiel #3
0
        public static List <Competition> getCompetitionsByDisciplineSet(DisciplineSet disciplineSet)
        {
            List <Dictionary <string, object> > results = querySql(""
                                                                   + "SELECT "
                                                                   + "* "
                                                                   + "FROM "
                                                                   + "`" + tableName + "` "
                                                                   + "WHERE "
                                                                   + "`" + field_disciplineSetId + "` = " + disciplineSet.DisciplineSetId
                                                                   );

            List <Competition> competitions = new List <Competition>();

            foreach (var row in results)
            {
                competitions.Add(CompetitionProvider.getCompetitionById(Convert.ToInt32(row[field_competitionId])));
            }

            return(competitions);
        }