Beispiel #1
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                var CurrentUser = new User(tbxUserName.Text, tbxPassword.Text, tbxLastName.Text, cbxAvatar.SelectedIndex, tbxFirstName.Text);
                CurrentUser.RegisterUser();
                tbxFirstName.Clear();
                tbxLastName.Clear();
                tbxUserName.Clear();
                tbxPassword.Clear();
                cbxAvatar.ResetText();
                MessageBox.Show("You will now be redirected to the logon form, to register another user simply click on the register button again", "Login");
                Form MovetoLogin = new Logon();
                MovetoLogin.Show();
                this.Close();
            }

            catch
            {
                MessageBox.Show("Sorry there has been a problem registering yuor account, Please Try Again", "Registration Unsecessfull");
            }
        }