Exemple #1
0
        private bool LoadNetworks(int _parent, TreeNode oParent)
        {
            bool    boolExpand = false;
            DataSet dsOther    = oSolaris.GetSVENetworks(intID);
            DataSet ds         = oIPAddresses.GetNetworks(_parent, 0);

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                TreeNode oNode = new TreeNode();
                oNode.Text         = oIPAddresses.GetNetworkName(Int32.Parse(dr["id"].ToString()));
                oNode.ToolTip      = oIPAddresses.GetNetworkName(Int32.Parse(dr["id"].ToString()));
                oNode.Value        = dr["id"].ToString();
                oNode.SelectAction = TreeNodeSelectAction.None;
                oNode.ShowCheckBox = true;
                oNode.Checked      = false;
                foreach (DataRow drOther in dsOther.Tables[0].Rows)
                {
                    if (dr["id"].ToString() == drOther["networkid"].ToString())
                    {
                        oNode.Checked = true;
                        boolExpand    = true;
                    }
                }
                oParent.ChildNodes.Add(oNode);
            }
            return(boolExpand);
        }