コード例 #1
0
		protected ActionResult CommentIndex(CommentIndexModel model) {
			PagedData<PostComment> pagedData = model.Comments;

			pagedData.ToggleSort();

			if (!model.Root_ContentID.HasValue) {
				pagedData.TotalRecords = PostComment.GetCommentCountBySiteAndType(SiteData.CurrentSiteID, model.PageType, model.IsApproved, model.IsSpam);
			} else {
				pagedData.TotalRecords = PostComment.GetCommentCountByContent(model.Root_ContentID.Value, model.IsApproved, model.IsSpam);
			}

			if (!model.Root_ContentID.HasValue) {
				pagedData.DataSource = PostComment.GetCommentsBySitePageNumber(SiteData.CurrentSiteID, pagedData.PageNumberZeroIndex, pagedData.PageSize, pagedData.OrderBy, model.PageType, model.IsApproved, model.IsSpam);
			} else {
				pagedData.DataSource = PostComment.GetCommentsByContentPageNumber(model.Root_ContentID.Value, pagedData.PageNumberZeroIndex, pagedData.PageSize, pagedData.OrderBy, model.IsApproved, model.IsSpam);
			}

			ModelState.Clear();

			return View("CommentIndex", model);
		}
コード例 #2
0
		public ActionResult BlogPostCommentIndex(Guid? id) {
			CommentIndexModel model = new CommentIndexModel();
			model.Comments.PageSize = 25;
			model.PageType = ContentPageType.PageType.BlogEntry;
			model.Root_ContentID = id;

			return CommentIndex(model);
		}
コード例 #3
0
		public ActionResult BlogPostCommentIndex(CommentIndexModel model) {
			model.PageType = ContentPageType.PageType.BlogEntry;

			return CommentIndex(model);
		}
コード例 #4
0
		public ActionResult PageCommentIndex(CommentIndexModel model) {
			model.PageType = ContentPageType.PageType.ContentEntry;

			return CommentIndex(model);
		}