using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace LYFZ.WeixinServers.WeiXinAPP { public partial class AuthorizationInfoLis : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { CommonHandler.CheckLoginJump(this); if (!IsPostBack) { if (Request.QueryString["Keyword"] != null) { Keyword = Request.QueryString["Keyword"].ToString().Trim(); } if (Request.QueryString["type"] != null) { if (Request.QueryString["type"].ToString().Trim() == "refresh") { Global.RefreshLoadAuthorizationInfoDaTable(); } } if (Request.QueryString["del"] != null && Request.QueryString["del"].ToString().Length>0) { try { if (CommonHandler.CheckAdmin(this)) { int delID = Convert.ToInt32(Request.QueryString["del"].ToString()); deleteAuthorization_info(delID); } } catch (Exception ex){ showMsegesBox("删除失败,请重试.错误原因:"+ex.Message); } } } bindUserList(); } string Keyword = ""; public string PagingInfoHtml = ""; void deleteAuthorization_info(int id) { if (Authorization_infoDal.Delete(id)) { this.Response.Redirect("AuthorizationInfoLis.aspx"); } else { showMsegesBox("删除失败,请重试."); } } void showMsegesBox(string msg) { Response.Write(""); return; } LYFZ.WeixinServiceDate.DAL.DAL_Authorization_info Authorization_infoDal = new WeixinServiceDate.DAL.DAL_Authorization_info(); public System.Text.StringBuilder Authorization_infoListHtmlTb = new System.Text.StringBuilder(); void bindUserList() { string whereStr = ""; if (Keyword.Length > 0) { whereStr = " [JMGDomainName] like '%" + Keyword + "%' or [CompanyName] like '%" + Keyword + "%' or [authorizer_appid] like '%" + Keyword + "%' "; } DataRow[] cacheRows = Global.AuthorizationInfoDaTable.Select(whereStr.Trim(), "id desc"); int sumCount = cacheRows.Length; string countInfo = "当前缓存共" + sumCount.ToString() + "条记录"; PagingInfoHtml = LYFZ.WXLibrary.PageTabList.GetPagingInfo_Web(1, 1, countInfo); DataTable authorizationInfoDaTable = Global.AuthorizationInfoDaTable;// Authorization_infoDal.GetList("1=1"); for (int i = 0; i < cacheRows.Length; i++) { DataRow row = cacheRows[i];//authorizationInfoDaTable.Rows[i]; string AuthorizeStatus = row["AuthorizeStatus"].ToString() == "0" ? "已取消授权" : "已授权"; Authorization_infoListHtmlTb.Append("