Continuing work on the Genre and Year API functionality. It is now working, just need to add it to the api #41 #42
This commit is contained in:
@@ -34,9 +34,9 @@ namespace Icarus.Models.Context
|
||||
conn.Open();
|
||||
string query = "INSERT INTO Song(Title, AlbumTitle, Artist," +
|
||||
" Year, Genre, Duration, Filename, SongPath, AlbumId, " +
|
||||
"ArtistId) VALUES(@Title, @AlbumTitle, @Artist, @Year, " +
|
||||
"@Genre, @Duration, @Filename, @SongPath, @AlbumId, " +
|
||||
"@ArtistId)";
|
||||
"ArtistId, GenreId, YearId) VALUES(@Title, @AlbumTitle, " +
|
||||
"@Artist, @Year, @Genre, @Duration, @Filename, @SongPath, " +
|
||||
"@AlbumId, @ArtistId, @GenreId, @YearId)";
|
||||
using (MySqlCommand cmd = new MySqlCommand(query, conn))
|
||||
{
|
||||
cmd.Parameters.AddWithValue("@Title", song.Title);
|
||||
@@ -49,6 +49,8 @@ namespace Icarus.Models.Context
|
||||
cmd.Parameters.AddWithValue("@SongPath", song.SongPath);
|
||||
cmd.Parameters.AddWithValue("@AlbumId", song.AlbumId);
|
||||
cmd.Parameters.AddWithValue("@ArtistId", song.ArtistId);
|
||||
cmd.Parameters.AddWithValue("@GenreId", song.GenreId);
|
||||
cmd.Parameters.AddWithValue("@YearId", song.YearId);
|
||||
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user