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

            PageUtils.CheckRequestParameter("PublishmentSystemID", "NodeID", "ContentID", "ReturnUrl");
            var nodeId = Body.GetQueryInt("NodeID");

            _contentId = Body.GetQueryInt("ContentID");
            _returnUrl = StringUtils.ValueFromUrl(Body.GetQueryString("ReturnUrl"));

            _nodeInfo = NodeManager.GetNodeInfo(PublishmentSystemId, nodeId);

            if (!IsPostBack)
            {
                BreadCrumb(AppManager.Cms.LeftMenu.IdContent, "内容管理", string.Empty);

                Operation.Items.Add(new ListItem("继续添加内容", EContentAddAfter.ContinueAdd.ToString()));
                Operation.Items.Add(new ListItem("返回管理界面", EContentAddAfter.ManageContents.ToString()));
                var isContribute = CrossSiteTransUtility.IsTranslatable(PublishmentSystemInfo, _nodeInfo);
                var isTransOk    = false;
                if (isContribute)
                {
                    var isAutomatic = CrossSiteTransUtility.IsAutomatic(_nodeInfo);
                    if (isAutomatic)
                    {
                        var targetPublishmentSystemId = 0;

                        if (_nodeInfo.Additional.TransType == ECrossSiteTransType.SpecifiedSite)
                        {
                            targetPublishmentSystemId = _nodeInfo.Additional.TransPublishmentSystemID;
                        }
                        else if (_nodeInfo.Additional.TransType == ECrossSiteTransType.SelfSite)
                        {
                            targetPublishmentSystemId = PublishmentSystemId;
                        }
                        else if (_nodeInfo.Additional.TransType == ECrossSiteTransType.ParentSite)
                        {
                            targetPublishmentSystemId = PublishmentSystemManager.GetParentPublishmentSystemId(PublishmentSystemId);
                        }

                        if (targetPublishmentSystemId > 0)
                        {
                            var targetPublishmentSystemInfo = PublishmentSystemManager.GetPublishmentSystemInfo(targetPublishmentSystemId);
                            if (targetPublishmentSystemInfo != null)
                            {
                                var targetNodeIdArrayList = TranslateUtils.StringCollectionToIntList(_nodeInfo.Additional.TransNodeIDs);
                                if (targetNodeIdArrayList.Count > 0)
                                {
                                    foreach (int targetNodeId in targetNodeIdArrayList)
                                    {
                                        CrossSiteTransUtility.TransContentInfo(PublishmentSystemInfo, _nodeInfo, _contentId, targetPublishmentSystemInfo, targetNodeId);
                                        isTransOk = true;
                                    }
                                }
                            }
                        }
                    }
                    else
                    {
                        Operation.Items.Add(new ListItem("转发到其他站点", EContentAddAfter.Contribute.ToString()));
                    }
                }
                SuccessMessage(isTransOk ? "内容添加成功并已转发到指定站点,请选择后续操作。" : "内容添加成功,请选择后续操作。");

                phPublishmentSystemID.Visible = phSubmit.Visible = false;
            }
        }
示例#2
0
        public void Page_Load(object sender, EventArgs e)
        {
            PageUtils.CheckRequestParameter("PublishmentSystemID", "NodeID", "ContentID", "ReturnUrl");
            var nodeID = int.Parse(Request.QueryString["NodeID"]);

            contentID = int.Parse(Request.QueryString["ContentID"]);
            returnUrl = StringUtils.ValueFromUrl(Request.QueryString["ReturnUrl"]);
            if (string.IsNullOrEmpty(returnUrl))
            {
                returnUrl = PageContent.GetRedirectUrl(PublishmentSystemId, nodeID);
            }

            nodeInfo = NodeManager.GetNodeInfo(PublishmentSystemId, nodeID);

            if (!IsPostBack)
            {
                BreadCrumb(AppManager.Wcm.LeftMenu.IdGovPublic, AppManager.Wcm.LeftMenu.GovPublic.IdGovPublicContent, "后续操作", AppManager.Wcm.Permission.WebSite.GovPublicContent);

                Operation.Items.Add(new ListItem("继续添加内容", EContentAddAfter.ContinueAdd.ToString()));
                Operation.Items.Add(new ListItem("返回管理界面", EContentAddAfter.ManageContents.ToString()));
                var isContribute = CrossSiteTransUtility.IsTranslatable(PublishmentSystemInfo, nodeInfo);
                var isTransOk    = false;
                if (isContribute)
                {
                    var isAutomatic = CrossSiteTransUtility.IsAutomatic(nodeInfo);
                    if (isAutomatic)
                    {
                        var targetPublishmentSystemID = 0;

                        if (nodeInfo.Additional.TransType == ECrossSiteTransType.SpecifiedSite)
                        {
                            targetPublishmentSystemID = nodeInfo.Additional.TransPublishmentSystemID;
                        }
                        else if (nodeInfo.Additional.TransType == ECrossSiteTransType.SelfSite)
                        {
                            targetPublishmentSystemID = PublishmentSystemId;
                        }
                        else if (nodeInfo.Additional.TransType == ECrossSiteTransType.ParentSite)
                        {
                            targetPublishmentSystemID = PublishmentSystemManager.GetParentPublishmentSystemId(PublishmentSystemId);
                        }

                        if (targetPublishmentSystemID > 0)
                        {
                            var targetPublishmentSystemInfo = PublishmentSystemManager.GetPublishmentSystemInfo(targetPublishmentSystemID);
                            if (targetPublishmentSystemInfo != null)
                            {
                                var targetNodeIDArrayList = TranslateUtils.StringCollectionToIntList(nodeInfo.Additional.TransNodeIDs);
                                if (targetNodeIDArrayList.Count > 0)
                                {
                                    foreach (int targetNodeID in targetNodeIDArrayList)
                                    {
                                        CrossSiteTransUtility.TransContentInfo(PublishmentSystemInfo, nodeInfo, contentID, targetPublishmentSystemInfo, targetNodeID);
                                        isTransOk = true;
                                    }
                                }
                            }
                        }
                    }
                    else
                    {
                        Operation.Items.Add(new ListItem("转发到其他站点", EContentAddAfter.Contribute.ToString()));
                    }
                }
                if (isTransOk)
                {
                    SuccessMessage("内容添加成功并已转发到指定站点,请选择后续操作。");
                }
                else
                {
                    SuccessMessage("内容添加成功,请选择后续操作。");
                }

                PublishmentSystemIDRow.Visible = NodeIDDropDownListRow.Visible = Submit.Visible = false;
            }
        }