public static Medecin retournerMedecin(String unCode) { Medecin med = null; OracleDataReader dr = selectionner("Select * from MEDECIN where CODEMED='" + unCode + "';"); if (dr.HasRows) { while (dr.Read()) { string cod = dr.GetString(0); string nom = dr.GetString(1); string pre = dr.GetString(2); string adr = dr.GetString(3); string cp = dr.GetString(4); Localite uneLoc = retournerLocalite(cp); string tel = dr.GetString(5); string pot = dr.GetString(6); string spe = dr.GetString(7); med = new Medecin(cod, nom, pre, adr, uneLoc, tel, pot, spe); } } else { Console.WriteLine("No rows found."); } dr.Close(); return(med); }
public Visite(string reference, DateTime date, string commentaire, Medecin unMedecin, Visiteur unVisiteur) { this.Reference = reference; this.Date = date; this.Commentaire = commentaire; this.UnMedecin = unMedecin; this.UnVisiteur = unVisiteur; }
public static List <Visite> retournerListVisite() { List <Visite> lstVis = new List <Visite>(); OracleDataReader dr = selectionner("Select * from visite"); if (dr.HasRows) { while (dr.Read()) { String reference = dr.GetString(0); DateTime date = dr.GetDateTime(1); String com = dr.GetString(2); Visiteur vis = retournerVisiteur(dr.GetString(3)); Medecin med = retournerMedecin(dr.GetString(4)); Visite uneVisite = new Visite(reference, date, com, med, vis); lstVis.Add(uneVisite); } } dr.Close(); conn.Dispose(); return(lstVis); }