Ejemplo n.º 1
0
        private void SaveChanges()
        {
            LayIpAddressDAO ipAddressDAO = new LayIpAddressDAO();

            // delete all existing before adding new ones
            ipAddressDAO.DeleteAllTcpIp();

            foreach (UltraListViewItem item in tcpipListView.Items)
            {
                IPAddressRange ipAddressRange = new IPAddressRange(item.Text, item.SubItems[0].Text, item.CheckState == CheckState.Checked, IPAddressRange.IPType.Tcpip);
                ipAddressDAO.Add(ipAddressRange);
            }
        }
Ejemplo n.º 2
0
        private void SaveChanges()
        {
            SettingsDAO     settingsDAO  = new SettingsDAO();
            LayIpAddressDAO ipAddressDao = new LayIpAddressDAO();
            StringBuilder   sb           = new StringBuilder();

            // delete all existing before adding new ones
            ipAddressDao.DeleteAllSnmp();

            foreach (UltraListViewItem item in tcpipListView.Items)
            {
                IPAddressRange ipAddressRange = new IPAddressRange(item.Text, item.SubItems[0].Text, item.CheckState == CheckState.Checked, IPAddressRange.IPType.Snmp);
                ipAddressDao.Add(ipAddressRange);
            }

            foreach (string communityString in lbReadStrings.Items)
            {
                sb.Append(communityString + ",");
            }

            settingsDAO.SetSetting("SNMPRead", sb.ToString().TrimEnd(','), false);
        }