Ejemplo n.º 1
0
        public static List <CourseProgrammePart> readCourseProgrammePart(Programme programme)
        {
            List <CourseProgrammePart> courseProgrammePartList = new List <CourseProgrammePart>();
            String readCSECoursesStatement = "SELECT * FROM CourseProgrammePart WHERE PROGRAMMEID = '" + programme.id + "'";

            try
            {
                dbConnection.Open();
                sqlCommand = new SQLiteCommand(readCSECoursesStatement, dbConnection);
                dataReader = sqlCommand.ExecuteReader();

                while (dataReader.Read())
                {
                    CourseProgrammePart courseProgrammePart = new CourseProgrammePart(dataReader["COURSEID"].ToString(), dataReader["PART"].ToString(), dataReader["PROGRAMMEID"].ToString());
                    courseProgrammePartList.Add(courseProgrammePart);
                }
                dbConnection.Close();
            }
            catch (Exception e)
            {
                Logger.Error("DatabaseConnection::readCourseProgrammePart() " + e.Message);
            }

            return(courseProgrammePartList);
        }
Ejemplo n.º 2
0
        public static List<CourseProgrammePart> readCourseProgrammePart(Programme programme)
        {
            List<CourseProgrammePart> courseProgrammePartList = new List<CourseProgrammePart>();
            String readCSECoursesStatement = "SELECT * FROM CourseProgrammePart WHERE PROGRAMMEID = '" + programme.id + "'";

            try
            {
                dbConnection.Open();
                sqlCommand = new SQLiteCommand(readCSECoursesStatement, dbConnection);
                dataReader = sqlCommand.ExecuteReader();

                while (dataReader.Read())
                {
                    CourseProgrammePart courseProgrammePart = new CourseProgrammePart(dataReader["COURSEID"].ToString(), dataReader["PART"].ToString(), dataReader["PROGRAMMEID"].ToString());
                    courseProgrammePartList.Add(courseProgrammePart);
                }
                dbConnection.Close();
            }
            catch (Exception e)
            {
                Logger.Error("DatabaseConnection::readCourseProgrammePart() " + e.Message);
            }

            return courseProgrammePartList;
        }