Ejemplo n.º 1
0
        private void Submit()
        {
            if (!QDLib.VerifyMasterPassword(txbMasterPassword.Text, DBData))
            {
                MessageBox.Show("Master-Password is not valid. Please enter the corrent Master-Password, which has been set when the database was first initialised.", "Invalid Master-Password", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            this.DialogResult = DialogResult.OK;
            this.Close();
        }
Ejemplo n.º 2
0
        private void SubmitSB2B()
        {
            QDLoader qdLoader = new QDLoader();

            qdLoader.Show();

            if (rbnSB2ExistingDB.Checked)
            {
                if (!QDLib.VerifyMasterPassword(txbSB2ExistingDBPassword.Text, onlineDBConDat))
                {
                    qdLoader.Close();
                    MessageBox.Show("Master-Password is not valid. Please enter the corrent Master-Password, which has been set when the database was first initialised.", "Invalid Master-Password", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                else
                {
                    onlineMasterPassword = txbSB2ExistingDBPassword.Text;
                }
            }
            else
            {
                if (QDLib.ValidatePasswords(txbSB2NewDBPassword.Text, txbSB2NewDBConfirmPassword.Text))
                {
                    onlineMasterPassword = txbSB2NewDBPassword.Text;
                }
                else
                {
                    qdLoader.Close();
                    return;
                }

                if (onlineAlreadyConfigured)
                {
                    if (MessageBox.Show("The given database has already been initialised before. Do you really want to delete the existing database and configure it as a new one?", "Database already initialised", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
                    {
                        VerifyMasterPW verify = new VerifyMasterPW()
                        {
                            DBData = onlineDBConDat
                        };

                        if (verify.ShowDialog() != DialogResult.OK)
                        {
                            qdLoader.Close();
                            return;
                        }
                    }
                    else
                    {
                        qdLoader.Close();
                        return;
                    }
                }
            }

            alwaysPromptPassword   = chbS2B2PromptUserPassword.Checked;
            onlineConfigureAsNewDB = rbnSB2NewDB.Checked;

            SaveConfiguration(localConnection);

            if (!errorEncountered)
            {
                pnlS3Finish.BringToFront();
            }
            else
            {
                pnlS3Error.BringToFront();
                btnS3ErrorClose.Focus();
            }

            qdLoader.Close();
        }