public static SportsFestivalSubscription getSportsFestivalSubscriptionById(int sportsFestivalSubscriptionId)
        {
            Dictionary <string, object> result = querySingleSql(""
                                                                + "SELECT "
                                                                + "* "
                                                                + "FROM "
                                                                + "`" + tableName + "` "
                                                                + "WHERE "
                                                                + "`" + field_sportsFestivalSubscriptionId + "` = " + sportsFestivalSubscriptionId
                                                                );

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

            SportsFestivalSubscription sportsFestivalSubscription = new SportsFestivalSubscription(
                Convert.ToInt32(result[field_sportsFestivalSubscriptionId]),
                SportsFestivalProvider.getSportsFestivalById(Convert.ToInt32(result[field_sportsFestivalId])),
                StudentProvider.getStudentById(Convert.ToInt32(result[field_studentId])),
                Convert.ToString(result[field_classShortcut])
                );

            return(sportsFestivalSubscription);
        }
Ejemplo n.º 2
0
        public static List <Student> getStudentsBySportsFestival(SportsFestival sportsFestival)
        {
            List <Dictionary <string, object> > results = querySql(""
                                                                   + "SELECT "
                                                                   + "* "
                                                                   + "FROM "
                                                                   + "`" + tableName + "` "
                                                                   + "WHERE "
                                                                   + "`" + field_sportsFestivalId + "` = " + sportsFestival.SportsFestivalId
                                                                   );

            List <Student> students = new List <Student>();

            foreach (var row in results)
            {
                students.Add(StudentProvider.getStudentById((int)row[field_studentId]));
            }

            return(students);
        }