BlogThreadQuery /**////<summary> /// Provides consistent/simple access to the various blog thread views ///</summary> publicclass BlogThreadQuery { public BlogThreadQuery() { } /**////<summary> /// Blog to filer by ///</summary> publicint BlogID =-1; /**////<summary> /// BlogGroup to filter by ///</summary> publicint BlogGroupID =-1; /**////<summary> /// Current Page ///</summary> publicint PageIndex =0; /**////<summary> /// # of threads per request ///</summary> publicint PageSize =20; /**////<summary> /// CategoryID to filter by ///</summary> publicint CategoryID =0; /**////<summary> /// User to filter by ///</summary> publicint UserID =0; /**////<summary> /// Date to filter by. Generally relies on BlogThreadType property ///</summary> public DateTime DateFilter = DateTime.MinValue; /**////<summary> /// Require posts be marked as Published/Acitve ///</summary> publicbool IsPublished =true; /**////<summary> /// Filter by if the blog is current enabled ///</summary> publicbool IsBlogEnable =true; /**////<summary> /// Type of post to filter by ///</summary> public BlogPostType BlogPostType = BlogPostType.Post; /**////<summary> /// Type of thread (date, recent, etc) ///</summary> public BlogThreadType BlogThreadType = BlogThreadType.Recent; /**////<summary> /// How to sort ///</summary> public SortOrder SortOrder = SortOrder.Ascending; /**////<summary> /// Column to sort by ///</summary> public BlogThreadSortBy SortBy = BlogThreadSortBy.MostRecent; /**////<summary> /// Filter by specific PostConfigurations ///</summary> public BlogPostConfig PostConfig = BlogPostConfig.Empty; /**////<summary> /// Should the category data be returned as a seperate table. ///</summary> publicbool IncludeCategories =false; public ArrayList FilterByList =null; publicbool IgnorePaging =false; /**////<summary> /// Flag to let a data provider know it is safe to /// serve the request from a secondary datasource ///</summary> publicbool IsCacheable =true; /**////<summary> /// Flag to let the data provider know this is a request for aggregate /// data ///</summary> publicbool IsAggregate =false; /**////<summary> /// Are we filtering by a date? ///</summary> publicbool HasDate { get{return DateFilter > DateTime.MinValue;} } /**////<summary> /// Are we filtering by a category? ///</summary> publicbool HasCategory { get{return CategoryID >0;} } /**////<summary> /// Are we filtering by a specific blog? ///</summary> publicbool HasBlog { get{return BlogID >-1;} } /**////<summary> /// Are we filtering by a specific group? ///</summary> publicbool HasGroup { get{return BlogGroupID >-1;} } string _filterKey =null; publicstring FilterKey { get { if(_filterKey ==null) if(FilterByList !=null&& FilterByList.Count >0) { string[] ids =newstring[FilterByList.Count]; for(int i =0; i < FilterByList.Count; i++) ids[i] = ((Section)FilterByList[i]).SectionID.ToString(); _filterKey =string.Join(",", ids); } else _filterKey =string.Empty; return _filterKey; } } /**////<summary> /// Unquie key represeting the current query ///</summary> publicstring Key { get { returnstring.Format("B:{0}-PI{1}-PS:{2}-C:{3}-DF:{4}-IP:{5}-BPT:{6}-BTT:{7}-BSB:{8}-SO:{9}-PC:{10}-IC:{11}-GID:{12}-F:{13}-IC:{14}", BlogID,PageIndex,PageSize,CategoryID,DateFilter,IsPublished,BlogPostType,BlogThreadType,SortBy,SortOrder,PostConfig,IncludeCategories,BlogGroupID,FilterKey,IgnorePaging); } }
posted on
2005-10-19 21:35Konimeter
阅读(305)
评论(0)
收藏举报