Beispiel #1
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            if (Body.IsQueryExists("Delete"))
            {
                var groupName = Body.GetQueryString("GroupName");

                try
                {
                    DataProvider.ChannelGroupDao.Delete(SiteId, groupName);

                    Body.AddSiteLog(SiteId, "删除栏目组", $"栏目组:{groupName}");
                }
                catch (Exception ex)
                {
                    FailDeleteMessage(ex);
                }
            }
            if (Body.IsQueryExists("SetTaxis"))
            {
                var groupName = Body.GetQueryString("GroupName");
                var direction = Body.GetQueryString("Direction");

                switch (direction.ToUpper())
                {
                case "UP":
                    DataProvider.ChannelGroupDao.UpdateTaxisToUp(SiteId, groupName);
                    break;

                case "DOWN":
                    DataProvider.ChannelGroupDao.UpdateTaxisToDown(SiteId, groupName);
                    break;
                }
                AddWaitAndRedirectScript(GetRedirectUrl(SiteId));
            }

            if (IsPostBack)
            {
                return;
            }

            VerifySitePermissions(ConfigManager.Permissions.WebSite.Configration);

            RptContents.DataSource     = DataProvider.ChannelGroupDao.GetGroupInfoList(SiteId);
            RptContents.ItemDataBound += RptContents_ItemDataBound;
            RptContents.DataBind();

            BtnAddGroup.Attributes.Add("onclick", ModalNodeGroupAdd.GetOpenWindowString(SiteId));
        }
Beispiel #2
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            if (Body.IsQueryExists("Delete"))
            {
                var groupName = Body.GetQueryString("GroupName");

                try
                {
                    DataProvider.NodeGroupDao.Delete(PublishmentSystemId, groupName);

                    Body.AddSiteLog(PublishmentSystemId, "删除栏目组", $"栏目组:{groupName}");
                }
                catch (Exception ex)
                {
                    FailDeleteMessage(ex);
                }
            }
            if (!IsPostBack)
            {
                BreadCrumb(AppManager.Cms.LeftMenu.IdConfigration, AppManager.Cms.LeftMenu.Configuration.IdConfigurationGroupAndTags, "栏目组管理", AppManager.Cms.Permission.WebSite.Configration);

                if (Body.IsQueryExists("SetTaxis"))
                {
                    var groupName = Body.GetQueryString("GroupName");
                    var direction = Body.GetQueryString("Direction");

                    switch (direction.ToUpper())
                    {
                    case "UP":
                        DataProvider.NodeGroupDao.UpdateTaxisToUp(PublishmentSystemId, groupName);
                        break;

                    case "DOWN":
                        DataProvider.NodeGroupDao.UpdateTaxisToDown(PublishmentSystemId, groupName);
                        break;
                    }
                    AddWaitAndRedirectScript(GetRedirectUrl(PublishmentSystemId));
                }

                DgContents.DataSource     = DataProvider.NodeGroupDao.GetDataSource(PublishmentSystemId);
                DgContents.ItemDataBound += DgContents_ItemDataBound;
                DgContents.DataBind();

                var showPopWinString = ModalNodeGroupAdd.GetOpenWindowString(PublishmentSystemId);
                BtnAddGroup.Attributes.Add("onclick", showPopWinString);
            }
        }
Beispiel #3
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            PageUtils.CheckRequestParameter("PublishmentSystemID");

            if (Body.IsQueryExists("IsContent"))
            {
                _isContent = Body.GetQueryBool("IsContent");
            }
            if (_isContent)
            {
                btnAddGroup.Text = " 新建内容组";
                _idsDictionary   = ContentUtility.GetIDsDictionary(Request.QueryString);
            }
            else
            {
                btnAddGroup.Text = " 新建栏目组";
                _nodeIdArrayList = TranslateUtils.StringCollectionToIntList(Body.GetQueryString("ChannelIDCollection"));
            }
            if (!IsPostBack)
            {
                if (_isContent)
                {
                    var contentGroupNameList = DataProvider.ContentGroupDao.GetContentGroupNameList(PublishmentSystemId);
                    foreach (var groupName in contentGroupNameList)
                    {
                        var item = new ListItem(groupName, groupName);
                        cblGroupNameCollection.Items.Add(item);
                    }
                    var showPopWinString = ModalContentGroupAdd.GetOpenWindowString(PublishmentSystemId);
                    btnAddGroup.Attributes.Add("onclick", showPopWinString);
                }
                else
                {
                    var nodeGroupNameList = DataProvider.NodeGroupDao.GetNodeGroupNameList(PublishmentSystemId);
                    foreach (var groupName in nodeGroupNameList)
                    {
                        var item = new ListItem(groupName, groupName);
                        cblGroupNameCollection.Items.Add(item);
                    }

                    var showPopWinString = ModalNodeGroupAdd.GetOpenWindowString(PublishmentSystemId);
                    btnAddGroup.Attributes.Add("onclick", showPopWinString);
                }
            }
        }
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            PageUtils.CheckRequestParameter("siteId");

            if (AuthRequest.IsQueryExists("isContent"))
            {
                _isContent = AuthRequest.GetQueryBool("isContent");
            }
            if (_isContent)
            {
                BtnAddGroup.Text = " 新建内容组";
                _idsDictionary   = ContentUtility.GetIDsDictionary(Request.QueryString);
            }
            else
            {
                BtnAddGroup.Text    = " 新建栏目组";
                _channelIdArrayList = TranslateUtils.StringCollectionToIntList(AuthRequest.GetQueryString("ChannelIDCollection"));
            }
            if (!IsPostBack)
            {
                if (_isContent)
                {
                    var contentGroupNameList = ContentGroupManager.GetGroupNameList(SiteId);
                    foreach (var groupName in contentGroupNameList)
                    {
                        var item = new ListItem(groupName, groupName);
                        CblGroupNameCollection.Items.Add(item);
                    }
                    var showPopWinString = ModalContentGroupAdd.GetOpenWindowString(SiteId);
                    BtnAddGroup.Attributes.Add("onclick", showPopWinString);
                }
                else
                {
                    var nodeGroupNameList = ChannelGroupManager.GetGroupNameList(SiteId);
                    foreach (var groupName in nodeGroupNameList)
                    {
                        var item = new ListItem(groupName, groupName);
                        CblGroupNameCollection.Items.Add(item);
                    }

                    var showPopWinString = ModalNodeGroupAdd.GetOpenWindowString(SiteId);
                    BtnAddGroup.Attributes.Add("onclick", showPopWinString);
                }
            }
        }
Beispiel #5
0
        private void RptContents_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType != ListItemType.Item && e.Item.ItemType != ListItemType.AlternatingItem)
            {
                return;
            }

            var groupInfo = (ChannelGroupInfo)e.Item.DataItem;

            var ltlNodeGroupName = (Literal)e.Item.FindControl("ltlNodeGroupName");
            var ltlDescription   = (Literal)e.Item.FindControl("ltlDescription");
            var hlUp             = (HyperLink)e.Item.FindControl("hlUp");
            var hlDown           = (HyperLink)e.Item.FindControl("hlDown");
            var ltlChannels      = (Literal)e.Item.FindControl("ltlChannels");
            var ltlEdit          = (Literal)e.Item.FindControl("ltlEdit");
            var ltlDelete        = (Literal)e.Item.FindControl("ltlDelete");

            ltlNodeGroupName.Text = groupInfo.GroupName;
            ltlDescription.Text   = groupInfo.Description;

            hlUp.NavigateUrl = PageUtils.GetCmsUrl(SiteId, nameof(PageNodeGroup), new NameValueCollection
            {
                { "GroupName", groupInfo.GroupName },
                { "SetTaxis", true.ToString() },
                { "Direction", "UP" }
            });
            hlDown.NavigateUrl = PageUtils.GetCmsUrl(SiteId, nameof(PageNodeGroup), new NameValueCollection
            {
                { "GroupName", groupInfo.GroupName },
                { "SetTaxis", true.ToString() },
                { "Direction", "DOWN" }
            });

            ltlChannels.Text =
                $@"<a href=""{PageChannelsGroup.GetRedirectUrl(SiteId, groupInfo.GroupName)}"">查看栏目</a>";

            ltlEdit.Text =
                $@"<a href=""javascript:;"" onClick=""{ModalNodeGroupAdd.GetOpenWindowString(SiteId,
                    groupInfo.GroupName)}"">修改</a>";

            ltlDelete.Text = $@"<a href=""{PageUtils.GetCmsUrl(SiteId, nameof(PageNodeGroup), new NameValueCollection
            {
                {"GroupName", groupInfo.GroupName},
                {"Delete", true.ToString()}
            })}"" onClick=""javascript:return confirm('此操作将删除栏目组“{groupInfo.GroupName}”,确认吗?');"">删除</a>";
        }
Beispiel #6
0
        public string GetEditHtml(string groupName)
        {
            var showPopWinString = ModalNodeGroupAdd.GetOpenWindowString(PublishmentSystemId, groupName);

            return($"<a href=\"javascript:;\" onClick=\"{showPopWinString}\">修改</a>");
        }