CustomerCacheList.aspx.cs 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Data;
  4. using System.Linq;
  5. using System.Web;
  6. using System.Web.UI;
  7. using System.Web.UI.WebControls;
  8. namespace LYFZ.WeixinServers.WeiXinAPP
  9. {
  10. public partial class CustomerCacheList : System.Web.UI.Page
  11. {
  12. LYFZ.WeixinServiceDate.DAL.DAL_CustomerInterfaces cusDal = new WeixinServiceDate.DAL.DAL_CustomerInterfaces();
  13. protected void Page_Load(object sender, EventArgs e)
  14. {
  15. CommonHandler.CheckLoginJump(this);
  16. if (!IsPostBack)
  17. {
  18. if (Request.QueryString["Keyword"] != null)
  19. {
  20. Keyword = Request.QueryString["Keyword"].ToString().Trim();
  21. }
  22. if (Request.QueryString["type"] != null)
  23. {
  24. if (Request.QueryString["type"].ToString().Trim() == "refresh") {
  25. Global.RefreshLoadCustDaTable();
  26. }
  27. }
  28. bindCustomerList();
  29. }
  30. }
  31. string Keyword = "";
  32. public string PagingInfoHtml = "";
  33. public System.Text.StringBuilder CustomerListHtmlTb = new System.Text.StringBuilder();
  34. void bindCustomerList()
  35. {
  36. try
  37. {
  38. string whereStr = "";
  39. if (Keyword.Length > 0)
  40. {
  41. whereStr = " [JMGDomainName] like '%" + Keyword + "%' or [ShellDomainName] like '%" + Keyword + "%' or [IPAddress] like '%" + Keyword + "%' or [CompanyName] like '%" + Keyword + "%' ";
  42. }
  43. DataRow[] cacheRows = Global.CustDaTable.Select(whereStr.Trim(), "id desc");
  44. int sumCount = cacheRows.Length;
  45. string countInfo = "当前缓存共" + sumCount.ToString() + "条记录";
  46. PagingInfoHtml = LYFZ.WXLibrary.PageTabList.GetPagingInfo_Web(1, 1, countInfo);
  47. for (int i = 0; i < cacheRows.Length; i++)
  48. {
  49. DataRow row = cacheRows[i];
  50. string ISEnabled = "禁用";
  51. string iconName = "lock";
  52. if (row["ISEnabled"].ToString() == "1")
  53. {
  54. ISEnabled = "启用";
  55. iconName = "ok";
  56. }
  57. string thisUrl = row["ShellDomainName"].ToString();
  58. CustomerListHtmlTb.Append("<tr>"
  59. + " <td>" + (i + 1).ToString() + "</td>"
  60. + " <td>" + row["CompanyName"].ToString() + "</td>"
  61. + " <td>" + row["JMGDomainName"].ToString() + "</td>"
  62. + " <td>" + row["ShellDomainName"].ToString() + "</td>"
  63. + " <td>" + row["AppSecret"].ToString() + "</td>"
  64. + " <td>" + row["CallFrequency"].ToString() + "</td>"
  65. + "<td>" + Convert.ToDateTime(row["RefreshTime"]).ToString("yyyy-MM-dd HH:mm") + "</td>"
  66. + "<td>" + Convert.ToDateTime(row["CreateTime"]).ToString("yyyy-MM-dd HH:mm") + "</td>"
  67. + " <td>" + ISEnabled + "</td>"
  68. + " <td>"
  69. + "<a target=\"_blank\" href=\"" + thisUrl + "/WebMobile/Login.aspx\" style=\"margin-right:10px;\"><i class=\"icon-home\"></i></a>"
  70. + "<a style=\"margin-right:10px;\"><i class=\"icon-" + iconName + "\"></i></a>"
  71. + "</td>"
  72. + " </tr>");
  73. }
  74. }
  75. catch
  76. {
  77. Global.RefreshLoadCustDaTable();
  78. }
  79. }
  80. }
  81. }