public static DisciplineSet getDisciplineSetById(int disciplineSetId)
        {
            Dictionary <string, object> result = querySingleSql(""
                                                                + "SELECT "
                                                                + "* "
                                                                + "FROM "
                                                                + "`" + tableName + "` "
                                                                + "WHERE "
                                                                + "`" + field_disciplineSetId + "` = " + disciplineSetId
                                                                );

            if (result == null)
            {
                return(null);
            }

            DisciplineSet disciplineSet = new DisciplineSet(
                Convert.ToInt32(result[field_disciplineSetId])
                );

            foreach (Discipline discipline in DisciplineSetDisciplineMappingProvider.getDisciplinesByDisciplineSet(disciplineSet))
            {
                disciplineSet.addDiscipline(discipline);
            }

            foreach (Competition competition in CompetitionProvider.getCompetitionsByDisciplineSet(disciplineSet))
            {
                disciplineSet.addCompetition(competition);
            }

            foreach (DisciplineSetDisciplineMapping disciplineSetDisciplineMapping in DisciplineSetDisciplineMappingProvider.getDisciplineSetDisciplineMappingsByDisciplineSet(disciplineSet))
            {
                disciplineSet.addDisciplineSetDisciplineMapping(disciplineSetDisciplineMapping);
            }

            return(disciplineSet);
        }
 public static List <DisciplineSet> getDisciplineSetsByDisciplineId(Discipline discipline)
 {
     return(DisciplineSetDisciplineMappingProvider.getDisciplineSetsByDiscipline(discipline));
 }
 public static List <Discipline> getDisciplinesByDisciplineSetId(DisciplineSet disciplineSet)
 {
     return(DisciplineSetDisciplineMappingProvider.getDisciplinesByDisciplineSet(disciplineSet));
 }
        public static Discipline getDisciplineById(int disciplineId)
        {
            Dictionary <string, object> result = querySingleSql(""
                                                                + "SELECT "
                                                                + "* "
                                                                + "FROM "
                                                                + "`" + tableName + "` "
                                                                + "WHERE "
                                                                + "`" + field_disciplineId + "` = " + disciplineId
                                                                );

            if (result == null)
            {
                return(null);
            }

            Discipline discipline = new Discipline(
                Convert.ToInt32(result[field_disciplineId]),
                Convert.ToString(result[field_name]),
                MeasureProvider.getMeasureById(Convert.ToInt32(result[field_measureId])),
                CategoryProvider.getCategoryById(Convert.ToInt32(result[field_categoryId]))
                );

            foreach (DisciplineSetDisciplineMapping disciplineSetDisciplineMapping in DisciplineSetDisciplineMappingProvider.getDisciplineSetDisciplineMappingsByDiscipline(discipline))
            {
                discipline.addDisciplineSetDisciplineMapping(disciplineSetDisciplineMapping);
            }

            List <Variant> variants = VariantProvider.getVariantsByDiscipline(discipline);

            foreach (Variant variant in variants)
            {
                discipline.addVariant(variant);
            }

            return(discipline);
        }