Esempio n. 1
0
        private void DatabaseConnectionForm_Load(object sender, EventArgs e)
        {
            txtbxDatabasePassword.PasswordChar = '\u25CF';
            pnlWarning.Visible    = false;
            lblConnecting.Visible = false;

            txtbxDatabaseServer.Text   = B3DatabaseConnection.GetServerNameFromRegistry();
            txtbxDatabaseName.Text     = B3DatabaseConnection.GetDatabaseNameFromRegistry();
            txtbxDatabaseUser.Text     = B3DatabaseConnection.GetDatabaseUserFromRegistry();
            txtbxDatabasePassword.Text = B3DatabaseConnection.GetDatabasePasswordRegistry();


            //fire button connect click event if flag is set
            if (m_connectOnLoad)
            {
                imgBtnConnect_Click(null, EventArgs.Empty);
            }
        }
Esempio n. 2
0
        private void ConnectionAttemptCompleted(bool isValid)
        {
            if (isValid)
            {
                B3DatabaseConnection.SaveCredentials(txtbxDatabaseServer.Text,
                                                     txtbxDatabaseName.Text,
                                                     txtbxDatabaseUser.Text,
                                                     txtbxDatabasePassword.Text);
                DialogResult = DialogResult.OK;
                Close();
            }
            else
            {
                pnlWarning.Visible = true;
            }

            lblConnecting.Visible = false;
            EnableControls(true);
        }