Beispiel #1
0
        public static void modifier(Medecin unMedecin)
        {
            try
            {
                Connexion    uneConnexion = new Connexion();
                MySqlCommand maCommande;

                uneConnexion.getConnexion().Open();

                maCommande = new MySqlCommand("UPDATE medecin SET nom = '" + unMedecin.getlibelle() + "', prenom = '" + unMedecin.getPrenom() + "', adresse = " + unMedecin.getAdresse() + "' tel = '" + unMedecin.getTel() + " WHERE id = " + unMedecin.getID() + ";", uneConnexion.getConnexion());
                maCommande.ExecuteReader();
                uneConnexion.getConnexion().Close();
            }
            catch (MySqlException erreur)
            {
                throw erreur;
            }
        }
Beispiel #2
0
        public static void ajout(Medecin unMedecin)
        {
            try
            {
                Connexion    uneConnexion = new Connexion();
                MySqlCommand maCommande;

                uneConnexion.getConnexion().Open();

                maCommande = new MySqlCommand("INSERT INTO medecin (id, nom, prenom, adresse, tel) VALUES (" + unMedecin.getID() + ", '" + unMedecin.getlibelle() + "', '" + unMedecin.getPrenom() + "', '" + unMedecin.getAdresse() + "', '" + unMedecin.getTel() + "');", uneConnexion.getConnexion());
                maCommande.ExecuteReader();
                uneConnexion.getConnexion().Close();
            }
            catch (MySqlException erreur)
            {
                throw erreur;
            }
        }