示例#1
0
        // change password and update database with new password
        private void button11_Click(object sender, EventArgs e)
        {
            if (textBox3.Enabled == true)
            {
                CreateNewAccount create = new CreateNewAccount(_connectionString, _login);
                create.Visible = false;
                if (create.validPassword(textBox3.Text))
                {
                    OleDbConnection conn           = new OleDbConnection(_connectionString);
                    OleDbCommand    updateUsername = conn.CreateCommand();
                    //conn.Open();
                    updateUsername = new OleDbCommand("UPDATE [Users] SET [Password]='" + textBox3.Text + "' WHERE [Username]='" + _username + "'", conn);
                    updateUsername.ExecuteScalar();
                    //conn.Close();

                    _password = textBox3.Text;
                    _user.setPassword(_password);
                    textBox3.Enabled = false;
                    button5.Enabled  = true;
                    button10.Enabled = true;
                    button11.Text    = "Change";
                }
            }
            else
            {
                textBox3.Enabled = true;
                button11.Text    = "Confirm";
                button5.Enabled  = false;
                button10.Enabled = false;
            }
        }
示例#2
0
        private void createAccButton_Click(object sender, EventArgs e)
        {
            CreateNewAccount acc = new CreateNewAccount(_connectionString, this);

            acc.Show();
            this.Hide();
        }