Page 650 - IT2
P. 650

}

                       public override bool Equals(object obj)
                       {
                           Patient p = (Patient)obj;
                           if (p == null)
                               return false;
                           return   this.Cin ==p.Cin ;
                       }
                 }
                   4.  Classe Transport:
               class Transport
                   {
                       public List<Patient> lp;
                       Ambulance ambulance;
                       DateTime datetransport;
                       int dureeEstimee;

                       public Transport()
                       {
                           lp = new List<Patient>();

                       }

                       public void ajouter(Patient s)
                       {
                           Console.WriteLine("Confirmer l'ajout en tappant le chiffre 1");
                          int rep=Convert.ToInt32( Console.ReadLine());
                           if (rep==1)
                               lp.Add(s);
                       }
                       public void Afficher()
                       {
                           foreach (Patient s in lp)
                               s.ToString();

                       }

                       public void supprimer(Patient pat)
                       {
                           foreach (Patient p in lp)
                           {
                               if (p.Equals(pat))
                               {
                                   Console.WriteLine("Confirmer la suppression en tappant le chiffre 1");
                                   int rep = Convert.ToInt32(Console.ReadLine());

                      Filière                   Epreuve                        Session              9/13
                 TDI (CDS de 2 à 3)       Synthèse V2 (Correction)           Juillet 2014
                                           www.itlearning-settat.com

                                   Email: admission@itlearning-settat.com
                                                    Tél.:0661077812
   645   646   647   648   649   650   651   652   653   654   655