Esempio n. 1
0
        public void generateUser()
        {
            Console.WriteLine("Please write the new user's name");
            string username = Console.ReadLine();

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

            cmd.Connection = dbConfig.con;
            string query = "INSERT INTO USERS (USERNAME) VALUES ('" + username + "');";

            cmd.CommandText = query;
            cmd.ExecuteNonQuery();
            dbConfig.breakConnection();
        }
Esempio n. 2
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();
        }