Beispiel #1
0
        public static void LoadNodeIDListBox(ListBox nodeIDListBox, PublishmentSystemInfo publishmentSystemInfo, int psID, NodeInfo nodeInfo, string administratorName)
        {
            nodeIDListBox.Items.Clear();

            var isUseNodeNames = false;

            if (nodeInfo.Additional.TransType == ECrossSiteTransType.AllParentSite || nodeInfo.Additional.TransType == ECrossSiteTransType.AllSite)
            {
                isUseNodeNames = true;
            }

            if (!isUseNodeNames)
            {
                var nodeIDArrayList = TranslateUtils.StringCollectionToIntList(nodeInfo.Additional.TransNodeIDs);
                foreach (int theNodeID in nodeIDArrayList)
                {
                    var theNodeInfo = NodeManager.GetNodeInfo(psID, theNodeID);
                    if (theNodeInfo != null)
                    {
                        var listitem = new ListItem(theNodeInfo.NodeName, theNodeInfo.NodeId.ToString());
                        nodeIDListBox.Items.Add(listitem);
                    }
                }
            }
            else
            {
                if (!string.IsNullOrEmpty(nodeInfo.Additional.TransNodeNames))
                {
                    var nodeNameArrayList = TranslateUtils.StringCollectionToStringList(nodeInfo.Additional.TransNodeNames);
                    var dic = NodeManager.GetNodeInfoHashtableByPublishmentSystemId(psID);
                    if (dic != null)
                    {
                        foreach (string nodeName in nodeNameArrayList)
                        {
                            foreach (var theNodeId in dic.Keys)
                            {
                                var theNodeInfo = NodeManager.GetNodeInfo(psID, (int)theNodeId);
                                if (theNodeInfo.NodeName == nodeName)
                                {
                                    var listitem = new ListItem(theNodeInfo.NodeName, theNodeInfo.NodeId.ToString());
                                    nodeIDListBox.Items.Add(listitem);
                                    break;
                                }
                            }
                        }
                    }
                }
                else
                {
                    NodeManager.AddListItemsForAddContent(nodeIDListBox.Items, PublishmentSystemManager.GetPublishmentSystemInfo(psID), false, administratorName);
                }
            }
        }