Ejemplo n.º 1
0
        public string InsertAlerte(BDDAlerte alerte)
        {
            MySqlConnection conn = DBConf.GetDBConnection();

            try
            {
                conn.Open();
                MySqlCommand command = conn.CreateCommand();
                command.CommandText = "INSERT INTO alerte (alerte) VALUES (@alerte)";
                command.Parameters.AddWithValue("alerte", alerte.alerte);
                command.ExecuteNonQuery();
                return("Success !");
            }
            catch (Exception e)
            {
                return(e.ToString());

                throw;
            }
            finally
            {
                conn.Close();
                conn.Dispose();
                conn = null;
            }
        }
Ejemplo n.º 2
0
        public string InsertAlerte(BDDAlerte bddalerte)
        {
            BDDAlerte alerte = new BDDAlerte();

            return(alerte.InsertAlerte(bddalerte));
        }