PageRenderTime 42ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

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

#
C# | 42 lines | 32 code | 7 blank | 3 comment | 0 complexity | 49b876c2a0590b4662687806bd6796df MD5 | raw file
Possible License(s): LGPL-2.1, Apache-2.0, BSD-3-Clause
  1. namespace Admin.Comments
  2. {
  3. using System;
  4. using System.Collections;
  5. using System.Web.Services;
  6. using BlogEngine.Core;
  7. using BlogEngine.Core.Json;
  8. using App_Code;
  9. public partial class Pending : System.Web.UI.Page
  10. {
  11. protected override void OnLoad(EventArgs e)
  12. {
  13. base.OnLoad(e);
  14. WebUtils.CheckRightsForAdminCommentsPages(false);
  15. }
  16. /// <summary>
  17. /// Number of comments in the list
  18. /// </summary>
  19. protected static int CommentCounter { get; set; }
  20. [WebMethod]
  21. public static IEnumerable LoadComments(int page)
  22. {
  23. WebUtils.CheckRightsForAdminCommentsPages(false);
  24. var commentList = JsonComments.GetComments(CommentType.Pending, page);
  25. CommentCounter = commentList.Count;
  26. return commentList;
  27. }
  28. [WebMethod]
  29. public static string LoadPager(int page)
  30. {
  31. WebUtils.CheckRightsForAdminCommentsPages(false);
  32. return JsonComments.GetPager(page);
  33. }
  34. }
  35. }