예제 #1
0
파일: NodeManager.cs 프로젝트: wl147/mycms
        public static bool IsExists(int nodeId)
        {
            var list = PublishmentSystemManager.GetPublishmentSystemIdList();

            foreach (var publishmentSystemId in list)
            {
                var nodeInfo = GetNodeInfo(publishmentSystemId, nodeId);
                if (nodeInfo != null)
                {
                    return(true);
                }
            }

            return(false);
        }
예제 #2
0
        public static int GetCurrentPublishmentSystemId()
        {
            int publishmentSystemId;
            var publishmentSystemIdList = PublishmentSystemManager.GetPublishmentSystemIdList();

            if (publishmentSystemIdList.Count == 1)
            {
                publishmentSystemId = publishmentSystemIdList[0];
            }
            else
            {
                var publishmentSystemDir = GetCurrentSiteDir();
                publishmentSystemId = !string.IsNullOrEmpty(publishmentSystemDir) ? DataProvider.PublishmentSystemDao.GetPublishmentSystemIdByPublishmentSystemDir(publishmentSystemDir) : DataProvider.PublishmentSystemDao.GetPublishmentSystemIdByIsHeadquarters();

                if (publishmentSystemId == 0)
                {
                    publishmentSystemId = DataProvider.PublishmentSystemDao.GetPublishmentSystemIdByIsHeadquarters();
                }
            }
            return(publishmentSystemId);
        }
예제 #3
0
        public static void LoadPublishmentSystemIDDropDownList(DropDownList publishmentSystemIDDropDownList, PublishmentSystemInfo publishmentSystemInfo, int nodeID)
        {
            publishmentSystemIDDropDownList.Items.Clear();

            var nodeInfo = NodeManager.GetNodeInfo(publishmentSystemInfo.PublishmentSystemId, nodeID);

            if (nodeInfo.Additional.TransType == ECrossSiteTransType.SelfSite || nodeInfo.Additional.TransType == ECrossSiteTransType.SpecifiedSite || nodeInfo.Additional.TransType == ECrossSiteTransType.ParentSite)
            {
                int thePublishmentSystemID;
                if (nodeInfo.Additional.TransType == ECrossSiteTransType.SelfSite)
                {
                    thePublishmentSystemID = publishmentSystemInfo.PublishmentSystemId;
                }
                else if (nodeInfo.Additional.TransType == ECrossSiteTransType.SpecifiedSite)
                {
                    thePublishmentSystemID = nodeInfo.Additional.TransPublishmentSystemID;
                }
                else
                {
                    thePublishmentSystemID = PublishmentSystemManager.GetParentPublishmentSystemId(publishmentSystemInfo.PublishmentSystemId);
                }
                if (thePublishmentSystemID > 0)
                {
                    var thePublishmentSystemInfo = PublishmentSystemManager.GetPublishmentSystemInfo(thePublishmentSystemID);
                    if (thePublishmentSystemInfo != null)
                    {
                        var listitem = new ListItem(thePublishmentSystemInfo.PublishmentSystemName, thePublishmentSystemInfo.PublishmentSystemId.ToString());
                        publishmentSystemIDDropDownList.Items.Add(listitem);
                    }
                }
            }
            else if (nodeInfo.Additional.TransType == ECrossSiteTransType.AllParentSite || nodeInfo.Additional.TransType == ECrossSiteTransType.AllSite)
            {
                var publishmentSystemIdList = PublishmentSystemManager.GetPublishmentSystemIdList();

                var allParentPublishmentSystemIdList = new List <int>();
                if (nodeInfo.Additional.TransType == ECrossSiteTransType.AllParentSite)
                {
                    PublishmentSystemManager.GetAllParentPublishmentSystemIdList(allParentPublishmentSystemIdList, publishmentSystemIdList, publishmentSystemInfo.PublishmentSystemId);
                }

                foreach (int psId in publishmentSystemIdList)
                {
                    if (psId == publishmentSystemInfo.PublishmentSystemId)
                    {
                        continue;
                    }
                    var psInfo = PublishmentSystemManager.GetPublishmentSystemInfo(psId);
                    var show   = false;
                    if (nodeInfo.Additional.TransType == ECrossSiteTransType.AllSite)
                    {
                        show = true;
                    }
                    else if (nodeInfo.Additional.TransType == ECrossSiteTransType.AllParentSite)
                    {
                        if (psInfo.IsHeadquarters || allParentPublishmentSystemIdList.Contains(psInfo.PublishmentSystemId))
                        {
                            show = true;
                        }
                    }
                    if (show)
                    {
                        var listitem = new ListItem(psInfo.PublishmentSystemName, psId.ToString());
                        if (psInfo.IsHeadquarters)
                        {
                            listitem.Selected = true;
                        }
                        publishmentSystemIDDropDownList.Items.Add(listitem);
                    }
                }
            }
        }