private void button1_Click(object sender, EventArgs e)
        {
            if (usernametextbox.Text.Length < 6)
            {
                usernametextbox.Text = ""; usernametextbox.PromptText = "min 8 chars";
            }
            else if (passwordtextbox.Text.Length < 8)
            {
                passwordtextbox.Text = ""; confirmtextbox.Text = "";
            }
            else if (passwordtextbox.Text != confirmtextbox.Text)
            {
                confirmtextbox.Text = ""; confirmtextbox.PromptText = "Pass did not match";
            }
            else if (emailtextbox.Text.Length < 10 || emailtextbox.Text.Contains('@') == false || emailtextbox.Text.Contains('.') == false)
            {
                emailtextbox.Text = ""; emailtextbox.PromptText = "Enter correct email";
            }
            else if (check.Checked)
            {
                MessageBox.Show("Agree terms and conditons..");
            }
            else
            {
                Creditional c = new Creditional();

                c.Savefile(usernametextbox.Text, passwordtextbox.Text);
                Hide();
                MessageBox.Show("Successfully registered.", "Success", MessageBoxButtons.OK);
                Login.Form1Instance.Show();
            }
        }
Exemplo n.º 2
0
        private void metroButton1_Click(object sender, EventArgs e)
        {
            Creditional c = new Creditional();

            if (UsernameTextbox.Text == c.Readuser() && PasswordTextbox.Text == c.Readpass())
            {
                Hide();
                if (Main.MainForm == null)
                {
                    Main f = new Main();
                    f.Show();
                }
                else
                {
                    Main.MainForm.Show();
                }
            }
        }