Esempio n. 1
0
 public Song()
 {
     TrackId = string.Empty;
     Title = string.Empty;
     Release = string.Empty;
     Duration = string.Empty;
     Year = string.Empty;
     Artist = null;
 }
Esempio n. 2
0
 public Song(string szTrackId,
         string szTitle,
         string szRelease,
         string szDuration,
         string szYear,
         Artist artist)
 {
     TrackId = szTrackId;
     Title = szTitle;
     Release = szRelease;
     Duration = szDuration;
     Year = szYear;
     Artist = artist;
 }
Esempio n. 3
0
 public static Artist CreateArtist(string szArtistId)
 {
     Artist artist = null;
     string szQuery = "SELECT * FROM songs WHERE artist_id='" + szArtistId + "'";
     try
     {
         METADATA_DB.Open();
         SQLiteCommand command = new SQLiteCommand(szQuery, METADATA_DB);
         METADATA_DB.Close();
         SQLiteDataReader reader = command.ExecuteReader();
         if (reader.Read())
         {
             artist = new Artist(reader["artist_id"].ToString(),
                                     reader["artist_name"].ToString(),
                                     Convert.ToDouble(reader["artist_familiarity"].ToString()),
                                     Convert.ToDouble(reader["artist_hotttnesss"].ToString()));
         }
     }
     catch (Exception e)
     {
         Console.WriteLine(e.ToString());
     }
     return artist;
 }