Esempio n. 1
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            if (Body.IsQueryExists("Delete"))
            {
                var innerLinkName = Body.GetQueryString("InnerLinkName");

                try
                {
                    DataProvider.InnerLinkDao.Delete(innerLinkName, PublishmentSystemId);
                    Body.AddSiteLog(PublishmentSystemId, "删除站内链接", $"站内链接:{innerLinkName}");
                    SuccessDeleteMessage();
                }
                catch (Exception ex)
                {
                    FailDeleteMessage(ex);
                }
            }
            if (!IsPostBack)
            {
                BreadCrumb(AppManager.Cms.LeftMenu.IdFunction, AppManager.Cms.LeftMenu.Function.IdInnerLink, "站内链接管理", AppManager.Cms.Permission.WebSite.InnerLink);

                dgContents.DataSource = DataProvider.InnerLinkDao.GetDataSource(PublishmentSystemId);
                dgContents.DataBind();

                AddInnerLink.Attributes.Add("onclick", ModalInnerLinkAdd.GetOpenWindowStringToAdd(PublishmentSystemId));
            }
        }
Esempio n. 2
0
        public string GetEditHtml(string innerLinkName)
        {
            var retval  = string.Empty;
            var canEdit = false;

            if (PublishmentSystemId != 0)
            {
                if (DataProvider.InnerLinkDao.IsExactExists(innerLinkName, PublishmentSystemId))
                {
                    canEdit = true;
                }
            }
            else
            {
                canEdit = true;
            }
            if (canEdit)
            {
                retval =
                    $@"<a href=""javascript:;"" onclick=""{ModalInnerLinkAdd.GetOpenWindowStringToEdit(PublishmentSystemId,
				        innerLinkName)}"">修改</a>"                ;
            }
            return(retval);
        }