/// <summary> /// Create new ArtWorkCollection, fetch the artworks list and bind to 'artWorkList' repeater. /// </summary> /// <param name="ac">The data source</param> protected void DataAccess() { ArtWorkCollection awc = new ArtWorkCollection(); awc.FetchArtWorksList(); artWorkList.DataSource = awc; artWorkList.DataBind(); }
/// <summary> /// Set the data source and bind it to the repeater. /// No need to error check odc since the worst case scenario /// is that nothing is displayed. /// </summary> private void SetUpRepeater() { ArtWorkCollection awc = new ArtWorkCollection(); awc.FetchNewArtworks(HowMany); rptNewAdditions.DataSource = awc; rptNewAdditions.DataBind(); }
/// <summary> /// Set the data source and bind it to the repeater. /// No need to error check odc since the worst case scenario /// is that nothing is displayed. /// </summary> private void SetUpRepeater() { ArtWorkCollection awc = new ArtWorkCollection(); awc.FetchTopSellingArtWorks(HowMany); repeaterRelated.DataSource = awc; repeaterRelated.DataBind(); }
/// <summary> /// Set the data source and bind it to the repeater /// </summary> /// <param name="r">The repeater to bind to</param> /// <param name="ac">The data source</param> private void SetUpRepeaterArtWorks(ArtWorkCollection aw) { if (aw == null || aw.Count <= 0) { DataError(); } else { repeaterArtWorks.DataSource = aw; repeaterArtWorks.DataBind(); } }
/// <summary> /// Set the data source and bind it to the repeater /// </summary> /// <param name="r">The repeater to bind to</param> /// <param name="ac">The data source</param> private void PairRepeaterSimilarGenre(Repeater r, ArtWorkCollection awc) { if (awc == null || awc.Count <= 0) { //Nothing to display } else { r.DataSource = awc; r.DataBind(); } }
private ArtWorkCollection FetchSimilarArtworks(string genre) { ArtWorkCollection awc = null; int g = 0; bool success = Int32.TryParse(genre, out g); if (success) { awc = new ArtWorkCollection(false); awc.FetchForGenre(g); } return(awc); }
/// <summary> /// Get the DataTable for the artists art works /// </summary> /// <param name="id">The artist ID</param> /// <returns>The resulting ArtWorkCollection</returns> private ArtWorkCollection FetchArtistArtWorkData(int id) { ArtWorkCollection aw = null; if (id <= 0) { DataError(); } else { aw = new ArtWorkCollection(); aw.FetchForArtist(id); } return(aw); }
/// <summary> /// Makes an art work collection from the ArrayList of artwork IDs /// </summary> /// <returns></returns> private ArtWorkCollection GetArtWorkCollection(bool asc, int sortOn) { ArtWorkCollection awc = new ArtWorkCollection(); awc.CreateFromArrayList(SessionHandler.GetUsersSession(SessionHandler.ArtWork)); switch (sortOn) { case SORT_ON_TITLE: awc.SortByTitle(asc); break; case SORT_ON_MSRP: awc.SortByMSRP(asc); break; case SORT_ON_YEAR: awc.SortByYear(asc); break; } return(awc); }