Example #1
0
        private void sign_up_Click(object sender, EventArgs e)
        {
            string login = username_box.Text.ToUpper();

            if ((password_box.Text == "") || (confirm_box.Text == "") || (username_box.Text == ""))
            {
                error_sign_up.Text    = "Each fields are required";
                error_sign_up.Visible = true;
            }
            else if ((dB.Query("Select ID from accounts_list where login = '******'") != ""))
            {
                error_sign_up.Text    = "Username is not unique!";
                error_sign_up.Visible = true;
            }
            else if ((password_box.Text != confirm_box.Text) || (password_box.Text == ""))
            {
                error_sign_up.Text    = "Passwords do not match!";
                error_sign_up.Visible = true;
            }
            else
            {
                dB.CreateNewUser(login, password_box.Text);
                error_sign_up.Visible = false;
                error_login.Text      = "Your account is created";
                error_login.Visible   = true;
                username_box.Text     = "";
                panel2.Visible        = false;
                panel1.Visible        = true;
                back_button.Visible   = false;
            }
            password_box.Text = "";
            confirm_box.Text  = "";
        }