private bool LoadNetworks(int _parent, TreeNode oParent)
        {
            bool    boolExpand = false;
            DataSet dsOther    = oServerName.GetComponentDetailNetworks(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);
        }
Example #2
0
        private void Load(int _parent, TreeNode oParent)
        {
            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.SelectAction = TreeNodeSelectAction.Expand;
                oNode.NavigateUrl  = "javascript:Edit('" + dr["id"].ToString() + "','" + dr["vlanid"].ToString() + "','" + oIPAddresses.GetVlan(Int32.Parse(dr["vlanid"].ToString()), "vlan") + "','" + dr["add1"].ToString() + "','" + dr["add2"].ToString() + "','" + dr["add3"].ToString() + "','" + dr["min4"].ToString() + "','" + dr["max4"].ToString() + "','" + dr["mask"].ToString() + "','" + dr["gateway"].ToString() + "','" + dr["starting"].ToString() + "','" + dr["maximum"].ToString() + "','" + dr["reverse"].ToString() + "','" + dr["routable"].ToString() + "','" + dr["notify"].ToString() + "','" + dr["only_apps"].ToString() + "','" + dr["only_components"].ToString() + "','" + dr["description"].ToString() + "','" + dr["enabled"].ToString() + "');";
                oParent.ChildNodes.Add(oNode);
            }
        }
Example #3
0
        private void LoadNetworks(int _parent, TreeNode oParent)
        {
            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.ImageUrl     = "/images/folder.gif";
                oNode.SelectAction = TreeNodeSelectAction.Select;
                oNode.NavigateUrl  = "javascript:SelectNetwork('" + dr["id"].ToString() + "','" + oIPAddresses.GetNetworkName(Int32.Parse(dr["id"].ToString())) + "','" + hdnVLAN.ClientID + "','" + txtVLAN.ClientID + "');";
                oParent.ChildNodes.Add(oNode);
            }
        }
Example #4
0
        private void LoadNetworks(int _parent, TreeNode oParent)
        {
            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.ImageUrl     = "/images/folder.gif";
                oNode.SelectAction = TreeNodeSelectAction.Expand;
                oParent.ChildNodes.Add(oNode);
                LoadDHCP(Int32.Parse(dr["id"].ToString()), oNode);
            }
        }
Example #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Request.Cookies["adminid"] != null && Request.Cookies["adminid"].Value != "")
     {
         intProfile = Int32.Parse(Request.Cookies["adminid"].Value);
     }
     else
     {
         Reload();
     }
     oIPAddresses = new IPAddresses(intProfile, dsnIP, dsn);
     oEnvironment = new Environments(intProfile, dsn);
     oClass       = new Classes(intProfile, dsn);
     btnClose.Attributes.Add("onclick", "return HidePanel();");
     if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
     {
         intNetwork = Int32.Parse(Request.QueryString["id"]);
     }
     if (!IsPostBack)
     {
         LoadClasses();
         if (intNetwork > 0)
         {
             lblName.Text = oIPAddresses.GetNetworkName(intNetwork);
         }
         // Expand Nodes
         foreach (TreeNode oChild in oTree.Nodes)
         {
             if (Expand(oChild) == true)
             {
                 oChild.Expand();
             }
         }
     }
 }
Example #6
0
        private void LoadNetworks(int _parent, TreeNode oParent)
        {
            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.ImageUrl     = "/images/folder.gif";
                oNode.SelectAction = TreeNodeSelectAction.Expand;
                oParent.ChildNodes.Add(oNode);
                LoadDHCP(Int32.Parse(dr["id"].ToString()), oNode);
                TreeNode oNew = new TreeNode();
                oNew.Text        = " Add DHCP Range";
                oNew.ToolTip     = "Add DHCP Range";
                oNew.ImageUrl    = "/images/green_right.gif";
                oNew.NavigateUrl = "javascript:Add('" + dr["id"].ToString() + "','" + oIPAddresses.GetNetworkName(Int32.Parse(dr["id"].ToString())) + "','" + dr["add1"].ToString() + "','" + dr["add2"].ToString() + "','" + dr["add3"].ToString() + "');";
                oNode.ChildNodes.Add(oNew);
            }
        }
Example #7
0
        private void Load(int _parent, TreeNode oParent)
        {
            DataSet dsOther = oIPAddresses.GetNetworkRelations(intNetwork);
            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.Value        = dr["id"].ToString();
                oNode.ToolTip      = oIPAddresses.GetNetworkName(Int32.Parse(dr["id"].ToString()));
                oNode.SelectAction = TreeNodeSelectAction.None;
                oNode.Checked      = false;
                foreach (DataRow drOther in dsOther.Tables[0].Rows)
                {
                    if (dr["id"].ToString() == drOther["id"].ToString())
                    {
                        oNode.Checked = true;
                    }
                }
                oParent.ChildNodes.Add(oNode);
            }
        }