コード例 #1
0
 public Voiture(int id, string marque, string modele, string type, string couleur, int annee, int idMoteur, string carburant, int cylindre, int puissance, int km)
 {
     this.id      = id;
     this.marque  = marque;
     this.modele  = modele;
     this.type    = type;
     this.couleur = couleur;
     this.annee   = annee;
     this.km      = km;
     m            = new Moteur(idMoteur, carburant, cylindre, puissance);
 }
コード例 #2
0
        //Ajout d'un Moteur dans la base de données.
        public static void AddMoteur(Moteur m)
        {
            TMoteur tMoteur = new TMoteur();

            tMoteur.puissance = m.puissance;
            tMoteur.carburant = m.carburant;
            tMoteur.cylindre  = m.cylindre;

            DB.TMoteur.InsertOnSubmit(tMoteur);
            DB.SubmitChanges();
        }
コード例 #3
0
 //Constructeur
 public Voiture()
 {
     m = new Moteur();
 }