//Returns info for all exhibitions (for Carousel) //Displays the top 30 most recently created if more than 30 exist public static List <Exhibition> getRecentExhibitions() { List <Exhibition> exhibitionList = new List <Exhibition>(); string sql; DataTable exhibitionIDs; try{ sql = "getRecentExhibitionIDs"; exhibitionIDs = SqlComm.SqlDataTable(sql); foreach (DataRow row in exhibitionIDs.Rows) { exhibitionList.Add(Exhibition.retrieve((int)row[0])); } }catch { exhibitionList.Add(new Exhibition()); exhibitionList.Add(new Exhibition()); exhibitionList.Add(new Exhibition()); exhibitionList.Add(new Exhibition()); } return(exhibitionList); }
//Returns a list of all exhibitions created by given user public List <Exhibition> getExhibitionArray() { if (artistID < 1) { return(null); } List <Exhibition> exhibitionList = new List <Exhibition>(); string sql; DataTable exhibitionIDs; try{ sql = "getExhibitionIDs @artistID=" + artistID; exhibitionIDs = SqlComm.SqlDataTable(sql); foreach (DataRow row in exhibitionIDs.Rows) { exhibitionList.Add(Exhibition.retrieve((int)row[0])); } }catch { exhibitionList.Add(new Exhibition()); exhibitionList.Add(new Exhibition()); } return(exhibitionList); }