Beispiel #1
0
        private void m_pTab_IPAccess_Add_Click(object sender, EventArgs e)
        {
            wfrm_IPAccess frm = new wfrm_IPAccess(m_pDsSettings);

            if (frm.ShowDialog(this) == DialogResult.OK)
            {
                m_pTab_IPAccess_List.Items.Clear();
                foreach (DataRow dr in m_pDsSettings.Tables["IP_Access"].Rows)
                {
                    ListViewItem it = new ListViewItem(dr["StartIP"].ToString());
                    it.SubItems.Add(dr["EndIP"].ToString());
                    it.Tag = dr;
                    m_pTab_IPAccess_List.Items.Add(it);
                }
            }
        }
Beispiel #2
0
        private void m_pTab_IPAccess_Edit_Click(object sender, EventArgs e)
        {
            if (m_pTab_IPAccess_List.SelectedItems[0].Text.ToLower() == "127.0.0.1" && 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.Error);
                return;
            }

            wfrm_IPAccess frm = new wfrm_IPAccess(m_pDsSettings, (DataRow)m_pTab_IPAccess_List.SelectedItems[0].Tag);

            if (frm.ShowDialog(this) == DialogResult.OK)
            {
                m_pTab_IPAccess_List.Items.Clear();
                foreach (DataRow dr in m_pDsSettings.Tables["IP_Access"].Rows)
                {
                    ListViewItem it = new ListViewItem(dr["StartIP"].ToString());
                    it.SubItems.Add(dr["EndIP"].ToString());
                    it.Tag = dr;
                    m_pTab_IPAccess_List.Items.Add(it);
                }
            }
        }
Beispiel #3
0
        private void m_pTab_IPAccess_Edit_Click(object sender, EventArgs e)
        {
            if(m_pTab_IPAccess_List.SelectedItems[0].Text.ToLower() == "127.0.0.1" && 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.Error);
                return;
            }

            wfrm_IPAccess frm = new wfrm_IPAccess(m_pDsSettings,(DataRow)m_pTab_IPAccess_List.SelectedItems[0].Tag);
            if(frm.ShowDialog(this) == DialogResult.OK){
                m_pTab_IPAccess_List.Items.Clear();
                foreach(DataRow dr in m_pDsSettings.Tables["IP_Access"].Rows){
                    ListViewItem it = new ListViewItem(dr["StartIP"].ToString());
                    it.SubItems.Add(dr["EndIP"].ToString());
                    it.Tag = dr;
                    m_pTab_IPAccess_List.Items.Add(it);
                }
            }
        }
Beispiel #4
0
 private void m_pTab_IPAccess_Add_Click(object sender, EventArgs e)
 {
     wfrm_IPAccess frm = new wfrm_IPAccess(m_pDsSettings);
     if(frm.ShowDialog(this) == DialogResult.OK){
         m_pTab_IPAccess_List.Items.Clear();
         foreach(DataRow dr in m_pDsSettings.Tables["IP_Access"].Rows){
             ListViewItem it = new ListViewItem(dr["StartIP"].ToString());
             it.SubItems.Add(dr["EndIP"].ToString());
             it.Tag = dr;
             m_pTab_IPAccess_List.Items.Add(it);
         }
     }
 }