TrendToolList.aspx.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.UI;
  6. using System.Web.UI.WebControls;
  7. using CB.Framework;
  8. using CB.Entity;
  9. using CB.Data;
  10. using CB.Common;
  11. namespace CB.Admin
  12. {
  13. public partial class TrendToolList : AdminPage
  14. {
  15. protected int PageID = 0;
  16. protected void Page_Load(object sender, EventArgs e)
  17. {
  18. if (!IsPostBack)
  19. { BindRepeaterList(); }
  20. }
  21. protected override void BindRepeaterList()
  22. {
  23. PageID = WRequest.GetInt("Id", 0);
  24. IList<TrendToolInfo> lists = new List<TrendToolInfo>();
  25. if (PageID != 0)
  26. {
  27. lists = TrendToolService.ToList(new TrendToolInfo() { PageID = PageID, ParentID = -1 });
  28. }
  29. //lists = Caches.GetTrendToolList(new TrendToolInfo() { PageID = PageID, ParentID = -1 });
  30. repeaterList.DataSource = lists;
  31. repeaterList.DataBind();
  32. }
  33. protected void btnSearch_Click(object sender, EventArgs e)
  34. {
  35. BindRepeaterList();
  36. }
  37. protected void repeaterList_ItemCommand(object source, RepeaterCommandEventArgs e)
  38. {
  39. switch (e.CommandName)
  40. {
  41. case "dndel":
  42. {
  43. int id = TypeConverter.ObjectToInt(e.CommandArgument, 0);
  44. TrendToolService.Delete(id);
  45. BindRepeaterList();
  46. }
  47. break;
  48. }
  49. }
  50. protected void AspNetPager1_PageChanged(object sender, EventArgs e)
  51. {
  52. }
  53. }
  54. }