Exemple #1
0
        // Create account
        private void btnCreateAccount_Click(object sender, EventArgs e)
        {
            bool   valid = false;
            string a     = txtUsername.Text;
            string b     = txtPassword.Text;


            valid = ReadNamePassword(a, b);


            if (valid)
            {
                if (count == 0 || (!IsDuplicate(a) && IsLong(b)))
                {
                    WriteInfo();
                    // Go to next form
                    frmSelectGames secondForm = new frmSelectGames();
                    secondForm.GetLoginUserName = txtUsername.Text;
                    secondForm.Show();
                    this.Hide();
                }
            }
        }
Exemple #2
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            bool found = false, valid;

            string a = txtUsername.Text;
            string b = txtPassword.Text;

            valid = ReadNamePassword(a, b);

            if (valid)
            {
                if (IsLong(b))
                {
                    for (int i = 0; i < Buyer.GetNumberOfCustomers(); i++)
                    {
                        if (a == Buyer.GetCustomerName()[i] && b == Buyer.GetCustomerPassword()[i])
                        {
                            found = true;
                        }
                    }

                    if (found)
                    {
                        // Go to next form
                        frmSelectGames secondForm = new frmSelectGames();
                        secondForm.GetLoginUserName = txtUsername.Text;
                        secondForm.Show();
                        this.Hide();
                    }
                    else
                    {
                        MessageBox.Show("Invalid username/password. Try again",
                                        "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
            }
        }
Exemple #3
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            bool found = false, valid;

            string a = txtUsername.Text;
            string b = txtPassword.Text;

            valid = ReadNamePassword(a, b);

            if (valid)
            {
                if (IsLong(b))
                {
                    for (int i = 0; i < Buyer.GetNumberOfCustomers(); i++)
                    {
                        if (a == Buyer.GetCustomerName()[i] && b == Buyer.GetCustomerPassword()[i])
                            found = true;
                    }

                    if (found)
                    {
                        // Go to next form
                        frmSelectGames secondForm = new frmSelectGames();
                        secondForm.GetLoginUserName = txtUsername.Text;
                        secondForm.Show();
                        this.Hide();
                    }
                    else
                    {
                        MessageBox.Show("Invalid username/password. Try again",
                                        "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
            }
        }
Exemple #4
0
        // Create account
        private void btnCreateAccount_Click(object sender, EventArgs e)
        {
            bool valid = false;
            string a = txtUsername.Text;
            string b = txtPassword.Text;

            valid = ReadNamePassword(a, b);

            if (valid)
            {
                if (count == 0 || (!IsDuplicate(a) && IsLong(b)))
                {
                    WriteInfo();
                    // Go to next form
                    frmSelectGames secondForm = new frmSelectGames();
                    secondForm.GetLoginUserName = txtUsername.Text;
                    secondForm.Show();
                    this.Hide();
                }
            }
        }