using LYFZ.WeixinServiceDate.DAL; using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace LYFZ.WeixinServers.WxAuthorize { public partial class OfficialAccountList : System.Web.UI.Page { public string table = ""; DAL_CustomerInterfaces officialAccountDal = new DAL_CustomerInterfaces(); public string eid = ""; protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["eid"] != null) { eid = Request.QueryString["eid"]; } if (Request.QueryString["delid"] == null) { string strWhere = String.Format("Token='{0}'", eid); System.Data.DataTable officialAccountTb = officialAccountDal.GetOfficialAccountList(eid); if (officialAccountTb != null) { foreach (System.Data.DataRow dr in officialAccountTb.Rows) { string AuthorizeStatus = "未授权"; if (dr["AuthorizeStatus"] != null) { AuthorizeStatus = (dr["AuthorizeStatus"].ToString() == "1" ? "已授权" : "未授权"); } table += ""; table += " " + dr["OfficialAccountName"] + ""; table += " " + dr["AppSecret"] + ""; table += " " + dr["AppID"] + ""; table += " http://wx.lyfz.net/WxInterface.aspx?eid=" + eid + "&appid=" + dr["AppID"] + " "+ " "; table += " " + AuthorizeStatus + ""; table += " " + " 编辑" + " 授权" + " 删除" + ""; table += ""; } } } else { delOfficialAccount(eid); } } void delOfficialAccount(string eid) { try { int delid = -1; if (Request.QueryString["delid"] != null) { if (!String.IsNullOrEmpty(Request.QueryString["delid"])) { delid = Convert.ToInt32(Request.QueryString["delid"]); } } if (delid > 0) { officialAccountDal.Delete(delid); } Response.Redirect(String.Format("OfficialAccountList.aspx?eid={0}", eid)); } catch { } } /// /// 获取微信接口授权并绑定URL /// /// /// /// public static string GetAuthorizationAndBindUrl(string appid, string yuname) { return "http://wx.lyfz.net/Authorize.aspx?appid=" + appid + "&yuname=" + LYFZ.WinAPI.SDKSecurity.Encode(yuname); } } }