Page 485 - IT2
P. 485

Classe "Ville"

                             using System;

                             namespace Société_informatique
                             {
                                 public class Ville
                                 {
                                     private uint IdVille;
                                     private string NomVille;
                                     private uint CodePostal;
                                     private Pays pays;

                                     private static uint auto;

                                     public Ville(string NomVille, uint CodePostal, Pays pays)
                                     {
                                         this.NomVille = NomVille;
                                         this.CodePostal = CodePostal;
                                         this.pays = pays;
                                         auto++;
                                         IdVille = auto;
                                     }

                                     public uint pIdVille
                                     {
                                         get { return IdVille; }
                                     }

                                     public string pNomVille
                                     {
                                         get { return NomVille; }
                                         set { NomVille = value; }
                                     }

                                     public uint pCodePostal
                                     {
                                         get { return CodePostal; }
                                         set { CodePostal = value; }
                                     }

                                     public Pays ppays
                                     {
                                         get { return pays; }
                                         set { pays = value; }
                                     }

                                     public new string ToString()
                                     {
                                         return NomVille + " " + CodePostal + ". " + pays.ToString();
                                     }
                                 }
                             }

                            Classe "Catégorie"


                             using System;

                             namespace Société_informatique
                             {
                                 public class Catégorie
                                 {
                                     private uint IdCatégorie;
                                     private string NomCatégorie;
                                     private Catégorie catégorie;


                     Filière                    Epreuve                        Session              8/13
                      TDI                 Synthèse V1(Correction)            Juillet 2014
   480   481   482   483   484   485   486   487   488   489   490