Esempio n. 1
0
        private void btnRegisterNewUser_Click(object sender, EventArgs e)
        {
            QDAddUser addUser = new QDAddUser()
            {
                DBData = dbData
            };

            if (addUser.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    mysql.ExecuteNonQueryACon("INSERT INTO qd_users (ID, Name, Username, Password) VALUES (?,?,?,?)",
                                              Guid.NewGuid(),
                                              addUser.DisplayName,
                                              addUser.Username,
                                              QDLib.HashPassword(addUser.Password)
                                              );
                }
                catch
                {
                    MessageBox.Show("Could not add new user. Please try again later.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }

                UpdateUsersSettings();
            }
        }