Exemplo n.º 1
0
        public void generateWorkout()
        {
            Console.WriteLine("Please write the  new workout's name");
            string workoutname = Console.ReadLine();

            dbConfig = new SqlDBConfig();
            dbConfig.connectToDB();
            MySqlCommand cmd = new MySqlCommand();

            cmd.Connection = dbConfig.con;
            string query = "INSERT INTO WORKOUTS (NAME) VALUES('" + workoutname + "');";

            cmd.CommandText = query;
            cmd.ExecuteNonQuery();
            dbConfig.breakConnection();
        }
Exemplo n.º 2
0
 public Generator()
 {
     dbConfig = new SqlDBConfig();
     rnd      = new Random();
 }