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

# · C# · 40 lines · 31 code · 6 blank · 3 comment · 0 complexity · 12b53bab893fed26b12b8d4bde1dc43f MD5 · raw file

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