Esempio n. 1
0
        private void BtnCreateAccount_Click(object sender, EventArgs e)
        {
            try
            {
                string username     = txtUserName.Text;
                string password     = txtPassword2.Text;
                string emailAddress = txtEmailAddress.Text;

                if (SamePassword())
                {
                    createAccount.CreateAcct(username, password, emailAddress);
                }
                if (createAccount.wasAccountCreated == true)
                {
                    pbAccountCreationStatus.Value = 100;
                    DialogResult accountCreatedMessageBoxResult = MessageBox.Show("Your Account Has Been Created.", "Account Successfully Created", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    if (accountCreatedMessageBoxResult == DialogResult.OK)
                    {
                        pbAccountCreationStatus.Value = 0;
                    }
                }
                ResetAccountCreationFormVariables();
            }
            catch (Exception except)
            {
                MessageBox.Show(except.Message, except.GetType().ToString(), MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }