Exemple #1
0
 public Module(Guid id, string modLibele, Gamme modGamme, Matiere modMatiere, double prixBase)
 {
     this.modLibele  = modLibele;
     this.modGamme   = modGamme;
     this.modMatiere = modMatiere;
     this.prixBase   = prixBase;
     this.modId      = id;
 }
Exemple #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="modLibele"></param>
 /// <param name="modGamme"></param>
 /// <param name="modMatiere"></param>
 /// <param name="prixBase"></param>
 /// <param name="modParametres"></param>
 public Module(Guid modId, string modLibele, Gamme modGamme, Matiere modMatiere, double prixBase, List <Parametre> modParametres, string uniteUsage)
 {
     this.modLibele     = modLibele;
     this.modGamme      = modGamme;
     this.modMatiere    = modMatiere;
     this.prixBase      = prixBase;
     this.modParametres = modParametres;
     this.modId         = modId;
     this.uniteUsage    = uniteUsage;
 }
Exemple #3
0
 public static Boolean AjouterGamme(Gamme maGamme)
 {
     try
     {
         NpgsqlConnection conn;
         conn = new NpgsqlConnection(chaineConnection);
         conn.Open();
         NpgsqlCommand MyCmd = null;
         // id , nom , prenom, nomRue,codePostal,ville,tel,email,numRue
         string query = @"INSERT INTO ""Gamme"" VALUES ('" + maGamme.gamId.ToString() + "','" + maGamme.gamLibelle + "')";
         Debug.WriteLine(query);
         MyCmd = new NpgsqlCommand(query, conn);
         MyCmd.ExecuteNonQuery(); //Exécution
         conn.Close();
         return(true);
     }
     catch (Exception ex)
     {
         Debug.WriteLine(ex.Message);
         return(false);
     }
 }
Exemple #4
0
        public static Gamme GetGamme(string id)
        {
            NpgsqlConnection conn;

            conn = new NpgsqlConnection(chaineConnection);
            conn.Open();

            string query = @"SELECT id,nom FROM ""Gamme"" where id ='" + id + "'";

            Debug.WriteLine(query);

            NpgsqlCommand    command = new NpgsqlCommand(query, conn);
            NpgsqlDataReader dr      = command.ExecuteReader();

            while (dr.Read())
            {
                Gamme OneGamme = new Gamme(new Guid(dr[0].ToString()), dr[1].ToString());
                conn.Close();
                return(OneGamme);
            }
            conn.Close();
            return(null);
        }
Exemple #5
0
 /// <summary>
 /// Changer la gamme d'un module
 /// </summary>
 /// <param name="g">La gamme</param>
 public void changerGamme(Gamme g)
 {
     this.modGamme = g;
 }