PageRenderTime 24ms CodeModel.GetById 13ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

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

#
C# | 40 lines | 31 code | 6 blank | 3 comment | 0 complexity | 12b53bab893fed26b12b8d4bde1dc43f 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    public partial class Approved : System.Web.UI.Page
10    {
11        protected override void OnLoad(EventArgs e)
12        {
13            base.OnLoad(e);
14            WebUtils.CheckRightsForAdminCommentsPages(false);
15        }
16
17        /// <summary>
18        /// Number of comments in the list
19        /// </summary>
20        protected static int CommentCounter { get; set; }
21
22        [WebMethod]
23        public static IEnumerable LoadComments(int page)
24        {
25            WebUtils.CheckRightsForAdminCommentsPages(false);
26
27            var commentList = JsonComments.GetComments(CommentType.Approved, page);
28            CommentCounter = commentList.Count;
29            return commentList;
30        }
31
32        [WebMethod]
33        public static string LoadPager(int page)
34        {
35            WebUtils.CheckRightsForAdminCommentsPages(false);
36
37            return JsonComments.GetPager(page);
38        }
39    }
40}