Exemple #1
0
 public Prevision(int idPrev,int idProj,Qualification qualification, short nbJ)
 {
     CodePrevision = idPrev;
     CodeProjet = idProj;
     LaQualif = qualification;
     NbJours = nbJ;
 }
Exemple #2
0
        public static List<Qualification> GetAllQualifications()
        {
            using (SqlConnection sqlConnect = ConnectSQLServ())
            {
                using (SqlCommand sqlCde = new SqlCommand())
                {
                    try
                    {
                        // Ouvre la connection. 
                        sqlConnect.Open();
                        // Création de la commande  
                        SqlDataReader sqlRdr;
                        sqlCde.Connection = sqlConnect;
                        // Constitution Requête SQL  

                        //sqlCde.CommandText = strSql;
                        sqlCde.CommandType = System.Data.CommandType.StoredProcedure;
                        sqlCde.CommandText = "GetAllQualifications";
                        // Exécution de la commande  
                        sqlRdr = sqlCde.ExecuteReader();
                        Qualifications = new List<Qualification>();
                        while (sqlRdr.Read())
                        {
                            Qualification qualif = new Qualification()
                            {
                                CodeQualif = (sbyte)sqlRdr.GetByte(0),
                                Libelle = sqlRdr.GetString(1),
                                PvJournee=sqlRdr.GetDecimal(2)
                            };
                            Qualifications.Add(qualif);
                        }
                        sqlRdr.Close();

                        return Qualifications;




                    }
                    catch (Exception ex)
                    {
                        throw new DaoException("Récupération des qualifications impossible  : " + ex.Message, ex);
                    }
                    finally { sqlConnect.Close(); }
                }
            }
        }