예제 #1
0
파일: Module.cs 프로젝트: Raidez/PFR-Madera
 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;
 }
예제 #2
0
파일: Module.cs 프로젝트: Raidez/PFR-Madera
 /// <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;
 }
예제 #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);
     }
 }
예제 #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);
        }
예제 #5
0
파일: Module.cs 프로젝트: Raidez/PFR-Madera
 /// <summary>
 /// Changer la gamme d'un module
 /// </summary>
 /// <param name="g">La gamme</param>
 public void changerGamme(Gamme g)
 {
     this.modGamme = g;
 }