Esempio 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);
        }
Esempio 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;
        }