Esempio n. 1
0
        private void ButtonRegister_Click(object sender, EventArgs e)
        {
            //Agafem les variables del form corresponent
            string nom        = fr.nameUserText.Text;
            string pass       = fr.PasswordUserText.Text;
            string repeatPass = fr.RepeatPasswordUserText.Text;
            string type       = fr.TypeUserText.Text;

            string Encryptedpass = null;
            string EncryptedName = null;

            bool typeBool = false;

            if (type.Equals("Usuari"))
            {
                typeBool = true;
            }

            if (pass.Equals(repeatPass))
            {
                Encryptedpass = PasswordEncryptation(pass);
                EncryptedName = PasswordEncryptation(nom);
                AddUser(EncryptedName, Encryptedpass, typeBool);
            }
            else
            {
                MessageBox.Show("Password is not equal.");
            }

            //Tanquem la vista del FormulariRegistre i obrim el de Login

            fr.Close();
            fl.Show();
        }