}//fin getIdDiplome()

            protected UniteEnseignement getUE(String IdModule, SqlCommand sqlCommand)
            {
                var select = "SELECT ue.Intitule, ue.Descriptif, ue.Semestre ";
                var from = "FROM formation.UE ue ";
                var where = "WHERE ue.IdUE = '{0}'";

                var id = getIdUE(IdModule, sqlCommand);
                var diplomes = getDiplomes(id, sqlCommand);

                sqlCommand.CommandText = String.Format(select + from + where, id);

                SqlDataReader reader = sqlCommand.ExecuteReader();
                reader.Read();

                String intitule = null; 
                String descriptif = null; 
                int semestre = -1; 

                if (!reader.IsDBNull(1))
                {
                    intitule = (String)reader["Intitule"];
                }
                if (!reader.IsDBNull(2))
                {
                    descriptif = (String)reader["Descriptif"];
                } 
                if (!reader.IsDBNull(3))
                {
                    semestre = (int)reader["Semestre"];
                } 
                reader.Close();
                var ue = new UniteEnseignement
                {
                    IdUE = id,
                    Intitule = intitule,
                    Descriptif = descriptif,
                    Semestre = semestre,
                    Diplomes = diplomes
                };

                return ue;

            }//fin get UE
            }//fin getUE()


            public List<UniteEnseignement> getAllUEs()
            {

                List<UniteEnseignement> ues = null;
                List<Diplome> diplomes = null;

                using (var dbConnection = new SqlConnection(MasterProgramDbConnectionString))
                {
                    dbConnection.Open();

                    using (SqlCommand sqlCommand = dbConnection.CreateCommand())
                    {
                        sqlCommand.CommandText = "SELECT * FROM formation.UE";
                        SqlDataReader reader = sqlCommand.ExecuteReader();

                        ues = new List<UniteEnseignement>();
                        String intitule = null;
                        String descriptif = null;
                        int semestre = -1; 

                        while (reader.Read())
                        {
                            var id = (String)reader["IdUE"];

                            if (!reader.IsDBNull(1))
                            {
                                intitule = (String)reader["Intitule"];
                            }
                            else
                            {
                                intitule = null; 
                            }

                            if (!reader.IsDBNull(2))
                            {
                                descriptif = (String)reader["Descriptif"];
                            }
                            else
                            {
                                descriptif = null;
                            }

                            if (!reader.IsDBNull(3))
                            {
                                semestre = (int)reader["Semestre"];
                            }
                            else
                            {
                                semestre = -1;
                            }

                            var ue = new UniteEnseignement
                            {
                                IdUE = (String)reader["IdUE"],
                                Intitule = intitule,
                                Descriptif = descriptif,
                                Semestre = semestre,
                                Diplomes = diplomes
                            };

                            ues.Add(ue);
                        }// fin While
                        reader.Close();
                        foreach (UniteEnseignement ue in ues)
                        {
                            var id = ue.IdUE;
                            ue.Diplomes = getDiplomes(id, sqlCommand);
                        }
                    }//fin SqlCommand
                    dbConnection.Close();
                }
                return ues;
            }//fin getAllUEs()
            }//fin getMatiere ()

        #endregion

        #region Helper Methods
            protected List<UniteEnseignement> getUEs(String IdDiplome, SqlCommand sqlCommand)
            {
                var select = "SELECT ue.Intitule, ue.Descriptif, ue.Semestre ";
                var from = "FROM formation.UE ue ";
                var where = "WHERE ue.IdUE = '{0}'";

                var IdUEs = new List<String>();
                IdUEs = getIdUEs(IdDiplome, sqlCommand);

                var UEs = new List<UniteEnseignement>();

                String intitule = null; 
                String descriptif = null; 
                int semestre = -1; 

                foreach (String id in IdUEs)
                {
                    sqlCommand.CommandText = String.Format(select + from + where, id);
                    SqlDataReader reader = sqlCommand.ExecuteReader();
                    reader.Read();

                    if (!reader.IsDBNull(1))
                    {
                        intitule = (String)reader["Intitule"];
                    }
                    else
                    {
                        intitule = null; 
                    }

                    if (!reader.IsDBNull(2))
                    {
                        descriptif = (String)reader["Intitule"];
                    }
                    else 
                    {
                        descriptif = null; 
                    }

                    if (!reader.IsDBNull(3))
                    {
                        semestre = (int)reader["Intitule"];
                    }
                    else 
                    {
                        semestre = -1; 
                    }

                    var ue = new UniteEnseignement
                    {
                        IdUE = id,
                        Intitule = intitule,
                        Descriptif =descriptif,
                        Semestre = semestre,
                        Diplomes = null
                    };
                    reader.Close();
                    if (ue != null)
                    {
                        UEs.Add(ue);
                    }
                }//fin foreach
                return UEs;
            }//fin getUEs()
            }//fin getMatiere ()


            public UniteEnseignement getUE(String IdUE)
            {
                var select = "SELECT ue.IdUE, ue.Intitule, ue.Descriptif, ue.Semestre " + "\n";
                var from = "FROM formation.UE ue " + "\n";
                var where = "WHERE ue.IdUE = '{0}'";

                var ue = new UniteEnseignement();
                List<Diplome> diplomes = null;

                using (var dbConnection = new SqlConnection(MasterProgramDbConnectionString))
                {
                    dbConnection.Open();

                    using (SqlCommand sqlCommand = dbConnection.CreateCommand())
                    {
                        diplomes = getDiplomes(IdUE, sqlCommand);
                        sqlCommand.CommandText = String.Format(select + from + where, IdUE);

                        SqlDataReader reader = sqlCommand.ExecuteReader();
                        String intitule = null;
                        String descriptif = null;
                        int semestre = -1;
                        reader.Read();

                        String id = (String)reader["IdUE"];

                        if (!reader.IsDBNull(1))
                        {
                            intitule = (String)reader["Intitule"];
                        }

                        if (!reader.IsDBNull(2))
                        {
                            descriptif = (String)reader["Descriptif"];
                        }

                        if (!reader.IsDBNull(3))
                        {
                            semestre = (int)reader["Semestre"];
                        }

                        reader.Close();

                        ue.IdUE = id;
                        ue.Intitule = intitule;
                        ue.Descriptif = descriptif;
                        ue.Semestre = semestre;
                        ue.Diplomes = diplomes;

                    }//fin SqlCommand

                    dbConnection.Close();
                }//fin dbConnection

                return ue;
            }//fin getUE()