private static ObservableCollection <Genre> GetAllGenresFromBand(int genreID) { ObservableCollection <Genre> lijst = new ObservableCollection <Genre>(); ObservableCollection <Genre> genres = Genre.GetGenres(); String sSQL = "SELECT * FROM Genre WHERE ID = @ID"; DbParameter par1 = Database.AddParameter("@ID", genreID); DbDataReader reader = Database.GetData(sSQL, par1); while (reader.Read()) { Genre genre = new Genre(); foreach (Genre gen in genres) { if (genre.ID == reader["Genre"].ToString()) { gen.ID = genre.ID; gen.Name = genre.Name; } } lijst.Add(genre); } return(lijst); }
public static Genre GetJobeRoleByName(Genre g) { ObservableCollection <Genre> lijst = Genre.GetGenres(); return(lijst.Where(gg => gg == g).SingleOrDefault()); }
public static Genre GetGenreByID(String GenreID) { ObservableCollection <Genre> lijst = Genre.GetGenres(); return(lijst.Where(g => g._ID == GenreID).SingleOrDefault()); }