Exemple #1
0
 private void login_bn_Click(object sender, EventArgs e)
 {
     if (password != "" && username != "")
     {
         if (password == MySQLFunctions.getPass(username))
         {
             this.Hide();
             HomePage d = new HomePage(username);
             d.ShowDialog();
             this.Close();
         }
         else
         {
             MessageBox.Show("Account does not exist / Password is not correct");
         }
     }
 }
Exemple #2
0
        private void save_button_Click(object sender, EventArgs e)
        {
            signup a = new signup(email_textbox.Text, firstname_textbox.Text, lastname_textbox.Text, password_textbox.Text);

            a.firstname_check();
            a.lastname_check();
            a.Email();
            a.password_check();
            if (a.firstname_check() == true)
            {
                firstname_textbox.BackColor = Color.Green;
            }
            else if (a.firstname_check() == false)
            {
                firstname_textbox.BackColor = Color.Red;
            }

            if (a.lastname_check() == true)
            {
                lastname_textbox.BackColor = Color.Green;
            }
            else if (a.lastname_check() == false)
            {
                lastname_textbox.BackColor = Color.Red;
            }

            if (a.Email() == true)
            {
                email_textbox.BackColor = Color.Green;
            }
            else if (a.Email() == false)
            {
                email_textbox.BackColor = Color.Red;
            }
            if (a.password_check() == true)
            {
                password_textbox.BackColor = Color.Green;
            }
            else
            {
                password_textbox.BackColor = Color.Red;
            }

            if (email_textbox.BackColor != Color.Red && firstname_textbox.BackColor != Color.Red &&
                lastname_textbox.BackColor != Color.Red && password_textbox.BackColor != Color.Red)
            {
                string username = email_textbox.Text;
                if (password == MySQLFunctions.getPass(username))
                {
                    MessageBox.Show("Account Already exists");
                }
                else
                {
                    string tempString = "INSERT INTO accounts (FirstName, LastName, Email, Password, profImage_path, backgroundImage_path, Bio, Home) Values('";
                    tempString = tempString + firstName + "', '";
                    tempString = tempString + lastName + "', '";
                    tempString = tempString + email + "', '";
                    tempString = tempString + password + "','nyc.jpg','10759301728_IMG_9920.jpg', 'NULL', 'NULL')";

                    MySQLFunctions.SQLCommand(tempString);

                    MessageBox.Show("You Successfully Signed Up! You May Now LogIn");
                    this.Hide();
                    WelcomePage o = new WelcomePage();
                    o.ShowDialog();
                }
            }
            else
            {
                MessageBox.Show("Make Sure Everythings Valid and Submit again");
            }
        }