Skip to content
Permalink
Browse files

search fixed, working on fixing invoice

  • Loading branch information
Jeremy Mill
Jeremy Mill committed Dec 8, 2015
1 parent 032f9ac commit 9da7ec14f461ff9d39cf72bf7c34051c4bd84c28
Showing with 11 additions and 5 deletions.
  1. +11 −5 TeamDBAwesome/TeamDBAwesome/SqlService/MySqlService.cs
@@ -413,14 +413,14 @@ public int createInvoice(int custId, int payId, int orderId)
cmd.ExecuteNonQuery();

//NEED TO DELETE THE ORDER, AND ORDER TRACKS
string delete_order = "delete from orders where orderid = " + orderId;
cmd = new MySqlCommand(delete_order, SqlConn);
cmd.ExecuteNonQuery();

string delete_ordertracks = "delete from ordertracks where orderid = " + orderId;
cmd = new MySqlCommand(delete_ordertracks, SqlConn);
cmd.ExecuteNonQuery();

string delete_order = "delete from orders where orderid = " + orderId;
cmd = new MySqlCommand(delete_order, SqlConn);
cmd.ExecuteNonQuery();

return nextInvoice;
}
else
@@ -790,7 +790,13 @@ public SearchResult Search(Search search)
+ "where track.Composer like \'%" + search.Composer + "%\'";

queries.Add("Composer", composerQuery);
queries.Add("Genre", "select * from chinook.genre where name like \'%" + search.Genre + "%\' ");

string genreQuery = "select track.TrackId as trackid,track.Name as trackname,track.Composer as trackcomposer,track.Milliseconds,track.Bytes,track.UnitPrice,"
+ "Album.Title as albumtitle,MediaType.Name as mediatype,Genre.Name as genre, artist.Name as artist "
+ "from track left join Album on track.AlbumId = Album.AlbumId left join mediatype on track.MediaTypeId=mediatype.MediaTypeId left join genre on track.GenreId = genre.GenreId left join artist on album.ArtistID = artist.ArtistID "
+ "where Genre.Name like \'%" + search.Genre + "%\'";

queries.Add("Genre", genreQuery);

//declare theresult and init it
//SearchResult searchresult = new SearchResult();

0 comments on commit 9da7ec1

Please sign in to comment.
You can’t perform that action at this time.