private static Specialite MapperLigneSpecialite(MySqlDataReader reader) { string id, spe; id = (string)reader["id"]; spe = (string)reader["specialite"]; Specialite laSpecialite = new Specialite(id, spe); return(laSpecialite); }
public static Specialite GetSpeMedecin(string idMed) { Specialite specialite = null; MySqlConnection cnx = InitConnection(); if (cnx != null) { string query = "Select specialite.* from specialite, medecin where medecin.idSpecialite = specialite.id AND medecin.id = @id"; MySqlCommand cmd = new MySqlCommand(query, cnx); cmd.Parameters.AddWithValue("@id", idMed); MySqlDataReader dataReader = cmd.ExecuteReader(); if (dataReader.HasRows) { while (dataReader.Read()) { specialite = MapperLigneSpecialite(dataReader); } } dataReader.Close(); } return(specialite); }
public Medecin(string Id, string Nom, string Prenom, string Adresse, string Tel, int Departement, Specialite LaSpecialite) : base(Id, Nom, Prenom, Adresse) { tel = Tel; departement = Departement; specialite = Specialite; }