PageRenderTime 19ms CodeModel.GetById 9ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/BlogEngine/BlogEngine.NET/admin/Comments/Spam.aspx.cs

#
C# | 61 lines | 31 code | 6 blank | 24 comment | 0 complexity | 483c698091019bd30e2f7319c0e07407 MD5 | raw file
 1namespace Admin.Comments
 2{
 3    using System;
 4    using System.Collections;
 5    using System.Web.Services;
 6    using BlogEngine.Core.Json;
 7    using App_Code;
 8
 9    /// <summary>
10    /// The spam settings.
11    /// </summary>
12    public partial class Spam : System.Web.UI.Page
13    {
14        protected override void OnLoad(EventArgs e)
15        {
16            base.OnLoad(e);
17            WebUtils.CheckRightsForAdminCommentsPages(false);
18        }
19
20        /// <summary>
21        /// Number of comments in the list
22        /// </summary>
23        protected static int CommentCounter { get; set; }
24
25        /// <summary>
26        /// Loads the comments.
27        /// </summary>
28        /// <param name="page">
29        /// The page number.
30        /// </param>
31        /// <returns>
32        /// An enumerable of comments.
33        /// </returns>
34        [WebMethod]
35        public static IEnumerable LoadComments(int page)
36        {
37            WebUtils.CheckRightsForAdminCommentsPages(false);
38
39            var commentList = JsonComments.GetComments(CommentType.Spam, page);
40            CommentCounter = commentList.Count;
41            return commentList;
42        }
43
44        /// <summary>
45        /// Loads the pager.
46        /// </summary>
47        /// <param name="page">
48        /// The page number.
49        /// </param>
50        /// <returns>
51        /// The pager.
52        /// </returns>
53        [WebMethod]
54        public static string LoadPager(int page)
55        {
56            WebUtils.CheckRightsForAdminCommentsPages(false);
57
58            return JsonComments.GetPager(page);
59        }
60    }
61}