Пример #1
0
        private void editMikrotik()
        {
            if (dataGridView1.CurrentRow == null)
            {
                return;
            }

            var name     = dataGridView1.CurrentRow.Cells["nameDataGridViewTextBoxColumn"].Value.ToString();
            var ip       = dataGridView1.CurrentRow.Cells["iPDataGridViewTextBoxColumn"].Value.ToString();
            var sshport  = dataGridView1.CurrentRow.Cells["sSHPortDataGridViewTextBoxColumn"].Value.ToString();
            var login    = dataGridView1.CurrentRow.Cells["loginDataGridViewTextBoxColumn"].Value.ToString();
            var password = dataGridView1.CurrentRow.Cells["passwordDataGridViewTextBoxColumn"].Value.ToString();

            Form_AddEdit fae = new Form_AddEdit(name, ip, sshport, login, password);

            fae.ShowDialog();

            if (fae.DialogResult != DialogResult.OK)
            {
                return;
            }

            var mikrotikRow = ((DataRowView)dataGridView1.CurrentRow.DataBoundItem).Row;

            mikrotikRow["Name"]     = fae.tb_Name.Text;
            mikrotikRow["IP"]       = fae.tb_IP.Text;
            mikrotikRow["SSHPort"]  = fae.tbSSHPort.Text;
            mikrotikRow["Login"]    = fae.tb_Login.Text;
            mikrotikRow["Password"] = fae.tb_Password.Text;

            saveDataSet();
        }
Пример #2
0
        private void addMikrotik(string name, string ip, string sshport, string username, string password)
        {
            Form_AddEdit fae = new Form_AddEdit(name, ip, sshport, username, password);

            fae.ShowDialog();

            if (fae.DialogResult != DialogResult.OK)
            {
                return;
            }

            dataSet1.Tables["MikrotikList"].Rows.Add(fae.tb_Name.Text, fae.tb_IP.Text, fae.tb_Login.Text, fae.tb_Password.Text, Convert.ToInt32(fae.tbSSHPort.Text));
            saveDataSet();
        }
Пример #3
0
        private void editMikrotik()
        {
            if (dataGridView1.CurrentRow == null) return;

            var name = dataGridView1.CurrentRow.Cells["nameDataGridViewTextBoxColumn"].Value.ToString();
            var ip = dataGridView1.CurrentRow.Cells["iPDataGridViewTextBoxColumn"].Value.ToString();
            var sshport = dataGridView1.CurrentRow.Cells["sSHPortDataGridViewTextBoxColumn"].Value.ToString();
            var login = dataGridView1.CurrentRow.Cells["loginDataGridViewTextBoxColumn"].Value.ToString();
            var password = dataGridView1.CurrentRow.Cells["passwordDataGridViewTextBoxColumn"].Value.ToString();

            Form_AddEdit fae = new Form_AddEdit(name, ip, sshport, login, password);
            fae.ShowDialog();

            if (fae.DialogResult != DialogResult.OK) return;

            var mikrotikRow = ((DataRowView)dataGridView1.CurrentRow.DataBoundItem).Row;

            mikrotikRow["Name"] = fae.tb_Name.Text;
            mikrotikRow["IP"] = fae.tb_IP.Text;
            mikrotikRow["SSHPort"] = fae.tbSSHPort.Text;
            mikrotikRow["Login"] = fae.tb_Login.Text;
            mikrotikRow["Password"] = fae.tb_Password.Text;

            saveDataSet();
        }
Пример #4
0
        private void addMikrotik(string name, string ip, string sshport, string username, string password)
        {
            Form_AddEdit fae = new Form_AddEdit(name, ip, sshport, username, password);
            fae.ShowDialog();

            if (fae.DialogResult != DialogResult.OK) return;

            dataSet1.Tables["MikrotikList"].Rows.Add(fae.tb_Name.Text, fae.tb_IP.Text, fae.tb_Login.Text, fae.tb_Password.Text, Convert.ToInt32(fae.tbSSHPort.Text));
            saveDataSet();
        }