public void GetTopFavourites() { clsDataConnection DB = new clsDataConnection(); DB.Execute("sproc_tblFavouriteFilms_GetTopFavourites"); Int32 recordCount = DB.Count; Int32 index = 0; while (index < recordCount) { clsFavouriteFilm aFavouriteFilm = new clsFavouriteFilm(); aFavouriteFilm.FilmId = Convert.ToInt32(DB.DataTable.Rows[index]["FilmId"]); mTopFavourites.Add(aFavouriteFilm); index++; } }
public clsFavouriteFilmCollection() { clsDataConnection DB = new clsDataConnection(); DB.Execute("sproc_tblFavouriteFilms_SelectAll"); Int32 recordCount = DB.Count; Int32 index = 0; while (index < recordCount) { clsFavouriteFilm aFavouriteFilm = new clsFavouriteFilm(); aFavouriteFilm.UserId = Convert.ToInt32(DB.DataTable.Rows[index]["UserId"]); aFavouriteFilm.FilmId = Convert.ToInt32(DB.DataTable.Rows[index]["FilmId"]); mAllFavourites.Add(aFavouriteFilm); index++; } }