Esempio n. 1
0
        public int Ajouter(Reglage reglage, int idProfil)
        {
            string query = "INSERT INTO reglage (duree,lumiere,temperatureInterieur,humidite,vent,id_profil) VALUES('"
                           + reglage.Duree.Days + "','" + reglage.Lumiere.ToString("F", CultureInfo.InvariantCulture) + "','" + reglage.TemperatureInterieur.ToString("F", CultureInfo.InvariantCulture) + "','" + reglage.Humidite.ToString("F", CultureInfo.InvariantCulture) + "','" + reglage.Vent.ToString("F", CultureInfo.InvariantCulture) + "','" + idProfil + "'); SELECT LAST_INSERT_ID();";

            return(connection.Ajouter(query));
        }
Esempio n. 2
0
        public int Ajouter(Profil profil)
        {
            string query = "INSERT INTO projet_serre.profil (nom) VALUES ('" + profil.Nom + "'); SELECT LAST_INSERT_ID();";

            return(connection.Ajouter(query));
        }