Пример #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            NAE nae = (NAE)this.listDevices.SelectedItems[0].Tag;
            nae.StaticIPAddress = this.generateStatic(nae.IPAddress);
            frmImport frm = new frmImport();

            foreach(Site site in Sites.FromTreeView(this.mainFrm.treeSites))
            {
                frm.comboSite.Items.Add(site.Name);
            }

            frm.ShowDialog();
            if (frm.DialogResult == DialogResult.OK && !String.IsNullOrEmpty((String)frm.comboSite.SelectedItem))
            {
                String selectedSite = (String)frm.comboSite.SelectedItem;
                foreach(TreeNode node in this.mainFrm.treeSites.Nodes)
                {
                    Site site = (Site)node.Tag;
                    if (selectedSite.Equals(site.Name))
                    {
                        site.NAEs.Add(nae);
                        FormHandler.AddNAEToTree(node.Nodes, nae);
                    }
                }
            }
        }
Пример #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            NAE nae = (NAE)this.listDevices.SelectedItems[0].Tag;

            nae.StaticIPAddress = this.generateStatic(nae.IPAddress);
            frmImport frm = new frmImport();

            foreach (Site site in Sites.FromTreeView(this.mainFrm.treeSites))
            {
                frm.comboSite.Items.Add(site.Name);
            }

            frm.ShowDialog();
            if (frm.DialogResult == DialogResult.OK && !String.IsNullOrEmpty((String)frm.comboSite.SelectedItem))
            {
                String selectedSite = (String)frm.comboSite.SelectedItem;
                foreach (TreeNode node in this.mainFrm.treeSites.Nodes)
                {
                    Site site = (Site)node.Tag;
                    if (selectedSite.Equals(site.Name))
                    {
                        site.NAEs.Add(nae);
                        FormHandler.AddNAEToTree(node.Nodes, nae);
                    }
                }
            }
        }