Beispiel #1
0
        private bool testMySqlSettings()
        {
            var address = textBoxMysqlAddress.Text;
            var user    = textBoxMysqlUsername.Text;
            var pass    = textBoxMysqlPassword.Text;
            var port    = Convert.ToUInt16(textBoxMysqlPort.Text);

            var da = new DatabaseAuth(address, user, pass, port, textBoxMysqlAuth.Text);
            var dc = new DatabaseCharacters(address, user, pass, port, textBoxMysqlCharacters.Text);
            var dw = new DatabaseWorld(address, user, pass, port, textBoxMysqlWorld.Text);

            if (MySqlAssist.TestConnection(da) && MySqlAssist.TestConnection(dc) && MySqlAssist.TestConnection(dw))
            {
                return(true);
            }

            return(false);
        }
Beispiel #2
0
        private void buttonConnect_Click(object sender, EventArgs e)
        {
            var address = textBoxAddress.Text;
            var user    = textBoxUsername.Text;
            var pass    = textBoxPassword.Text;
            var port    = Convert.ToUInt16(textBoxPort.Text);

            var da = new DatabaseAuth(address, user, pass, port, textBoxAuth.Text);
            var dc = new DatabaseCharacters(address, user, pass, port, textBoxCharacters.Text);
            var dw = new DatabaseWorld(address, user, pass, port, textBoxWorld.Text);

            if (MySqlAssist.TestConnection(da) && MySqlAssist.TestConnection(dc) && MySqlAssist.TestConnection(dw))
            {
                SaveSettings();

                dbPassword = textBoxPassword.Text;

                this.Hide();
                var mf = new Views.FormMain();
                mf.FormClosed += (s, args) => this.Close();
                mf.Show();
            }
        }