Beispiel #1
0
        private void buttonSelectTarget_Click(object sender, EventArgs e)
        {
            FormConnection formConnection = new FormConnection();
            //formConnection.MdiParent = this.ParentForm;
            if (formConnection.ShowDialog() == DialogResult.OK)
            {
                if (!string.IsNullOrEmpty(formConnection.textBoxOracleUserId.Text)
                    && !string.IsNullOrEmpty(formConnection.textBoxOraclePassword.Text)
                    && !string.IsNullOrEmpty(formConnection.TNSNamesComboBox.Text))
                {
                    Config.SaveLastConnectionInfo(formConnection.textBoxOracleUserId.Text,
                                           formConnection.textBoxOraclePassword.Text,
                                           formConnection.TNSNamesComboBox.Text);

                    labelTargetTnsnames.Text = string.Format("Source {0}@{1}", formConnection.textBoxOracleUserId.Text, formConnection.TNSNamesComboBox.Text);
                    TargetConnexion = new Connexion.Connexion("Oracle");
                    // Open connexions
                    TargetConnexion.Open(formConnection.textBoxOracleUserId.Text,
                                         formConnection.textBoxOraclePassword.Text, formConnection.TNSNamesComboBox.Text);
                    TargetConnexion.Close();
                }
            }
        }
Beispiel #2
0
 private void SessionConnectMenuItem_Click(object sender, EventArgs e)
 {
     FormConnection formConnection = new FormConnection();
     //formConnection.MdiParent = this.ParentForm;
     if (formConnection.ShowDialog() == DialogResult.OK)
     {
         if (!string.IsNullOrEmpty(formConnection.textBoxOracleUserId.Text)
             && !string.IsNullOrEmpty(formConnection.textBoxOraclePassword.Text)
             && !string.IsNullOrEmpty(formConnection.TNSNamesComboBox.Text))
         {
             //DataGridViewRow dgvr = formConnection.dataGridViewConnection.CurrentRow;
             Config.SaveLastConnectionInfo(formConnection.textBoxOracleUserId.Text,
                                    formConnection.textBoxOraclePassword.Text,
                                    formConnection.TNSNamesComboBox.Text);
             MainForm mainForm = new MainForm();
             plugSender = mainForm.plugEvent;
             mainForm.MdiParent = ParentForm;
             mainForm.ParentForm = ParentForm;
             mainForm.Show();
             SendConnectionInfo(formConnection.textBoxOracleUserId.Text, formConnection.textBoxOraclePassword.Text, formConnection.TNSNamesComboBox.Text);
         }
     }
 }
Beispiel #3
0
        private void buttonSelectSource_Click(object sender, EventArgs e)
        {
            FormConnection formConnection = new FormConnection();
            //formConnection.MdiParent = this.ParentForm;
            if (formConnection.ShowDialog() == DialogResult.OK)
            {
                if (!string.IsNullOrEmpty(formConnection.textBoxOracleUserId.Text)
                    && !string.IsNullOrEmpty(formConnection.textBoxOraclePassword.Text)
                    && !string.IsNullOrEmpty(formConnection.TNSNamesComboBox.Text))
                {
                    labelSourceTnsnames.Text = string.Format("Source {0}@{1}", formConnection.textBoxOracleUserId.Text, formConnection.TNSNamesComboBox.Text);
                    SourceConnexion = new Connexion.Connexion("Oracle");
                    // Open connexions
                    SourceConnexion.Open(formConnection.textBoxOracleUserId.Text, formConnection.textBoxOraclePassword.Text, formConnection.TNSNamesComboBox.Text);
                    // Get Tables of source connexion
                    if (SourceConnexion.Cnn.State.ToString() != "Closed")
                    {
                        using (DbCommand cmd = SourceConnexion.Cnn.CreateCommand())
                        {
                            string SQL = "select distinct table_name  " +
                                         "  from user_tables " +
                                         " order by table_name ";

                            cmd.CommandText = SQL;
                            cmd.Prepare();

                            using (DbDataReader rd = cmd.ExecuteReader())
                            {
                                while (rd.Read())
                                {
                                    SourceTablesCheckedListBox.Items.Add(rd.GetValue(0), false);
                                }
                            }
                        }
                    }
                    // close connexions
                    SourceConnexion.Close();
                }
            }
        }