Esempio n. 1
0
        private void m_pTab_IPAccess_Add_Click(object sender, EventArgs e)
        {
            IPAccessForm iPAccessForm = new IPAccessForm(this.m_pDsSettings);

            if (iPAccessForm.ShowDialog(this) == DialogResult.OK)
            {
                this.m_pTab_IPAccess_List.Items.Clear();
                foreach (DataRow dataRow in this.m_pDsSettings.Tables["IP_Access"].Rows)
                {
                    ListViewItem listViewItem = new ListViewItem(dataRow["StartIP"].ToString());
                    listViewItem.SubItems.Add(dataRow["EndIP"].ToString());
                    listViewItem.Tag = dataRow;
                    this.m_pTab_IPAccess_List.Items.Add(listViewItem);
                }
            }
        }
Esempio n. 2
0
        private void m_pTab_IPAccess_Edit_Click(object sender, EventArgs e)
        {
            if (this.m_pTab_IPAccess_List.SelectedItems[0].Text.ToLower() == "127.0.0.1" && this.m_pTab_IPAccess_List.SelectedItems[0].SubItems[0].Text == "127.0.0.1")
            {
                MessageBox.Show("IP range 127.0.0.1 - 127.0.0.1 is permanent system entry and cannot be modified !", "Error:", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                return;
            }
            IPAccessForm iPAccessForm = new IPAccessForm(this.m_pDsSettings, (DataRow)this.m_pTab_IPAccess_List.SelectedItems[0].Tag);

            if (iPAccessForm.ShowDialog(this) == DialogResult.OK)
            {
                this.m_pTab_IPAccess_List.Items.Clear();
                foreach (DataRow dataRow in this.m_pDsSettings.Tables["IP_Access"].Rows)
                {
                    ListViewItem listViewItem = new ListViewItem(dataRow["StartIP"].ToString());
                    listViewItem.SubItems.Add(dataRow["EndIP"].ToString());
                    listViewItem.Tag = dataRow;
                    this.m_pTab_IPAccess_List.Items.Add(listViewItem);
                }
            }
        }