public void Page_Load(object sender, System.EventArgs e) { if (IsForbidden) { return; } if (!IsPostBack) { BreadCrumb(AppManager.WeiXin.LeftMenu.IdAccounts, AppManager.WeiXin.LeftMenu.Function.IdInfo, string.Empty, AppManager.WeiXin.Permission.WebSite.Info); LtlWelcome.Text = "欢迎使用 SiteServer CMS 微信站点"; var bindingUrl = PageAccountBinding.GetRedirectUrl(PublishmentSystemId, GetRedirectUrl(PublishmentSystemId)); var accountInfo = WeiXinManager.GetAccountInfo(PublishmentSystemId); var isBinding = WeiXinManager.IsBinding(accountInfo); if (isBinding) { LtlBinding.Text = $@"<a href=""{bindingUrl}"" class=""btn btn-success"">已绑定微信</a>"; } else { LtlBinding.Text = $@"<a href=""{bindingUrl}"" class=""btn btn-danger"">未绑定微信</a>"; } LtlUrl.Text = PageUtilityWX.API.GetMPUrl(PublishmentSystemId); LtlToken.Text = accountInfo.Token; var deleteUrl = PagePublishmentSystemDelete.GetRedirectUrl(PublishmentSystemId); LtlDelete.Text = $@"<a href=""{deleteUrl}"" class=""btn btn-danger"">删除当前站点</a>"; } }
void dgContents_ItemDataBound(object sender, DataGridItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { var publishmentSystemId = (int)e.Item.DataItem; var publishmentSystemInfo = PublishmentSystemManager.GetPublishmentSystemInfo(publishmentSystemId); if (publishmentSystemInfo != null) { var ltlPublishmentSystemName = e.Item.FindControl("ltlPublishmentSystemName") as Literal; var ltlPublishmentSystemDir = e.Item.FindControl("ltlPublishmentSystemDir") as Literal; var ltlAddDate = e.Item.FindControl("ltlAddDate") as Literal; var ltlManage = e.Item.FindControl("ltlManage") as Literal; var ltlBinding = e.Item.FindControl("ltlBinding") as Literal; var ltlDelete = e.Item.FindControl("ltlDelete") as Literal; ltlPublishmentSystemName.Text = publishmentSystemInfo.PublishmentSystemName; ltlPublishmentSystemDir.Text = publishmentSystemInfo.PublishmentSystemDir; ltlAddDate.Text = DateUtils.GetDateString(NodeManager.GetAddDate(publishmentSystemId, publishmentSystemId)); var manageUrl = PageMain.GetRedirectUrl(publishmentSystemId, string.Empty); ltlManage.Text = $@"<a href=""{manageUrl}"" target=""top"">管理</a>"; var bindingUrl = PageAccountBinding.GetRedirectUrl(publishmentSystemId, GetRedirectUrl()); var accountInfo = WeiXinManager.GetAccountInfo(publishmentSystemId); var isBinding = WeiXinManager.IsBinding(accountInfo); if (isBinding) { ltlBinding.Text = $@"<a href=""{bindingUrl}"" class=""btn btn-success"">已绑定微信</a>"; } else { ltlBinding.Text = $@"<a href=""{bindingUrl}"" class=""btn btn-danger"">未绑定微信</a>"; } var urlDelete = PagePublishmentSystemDelete.GetRedirectUrl(publishmentSystemId); ltlDelete.Text = $@"<a href=""{urlDelete}"">删除</a>"; } } }