Exemplo n.º 1
0
 private void BackRegButton_Click(object sender, EventArgs e)
 {
     panelRegister.Hide();
     panelInicio.Show();
     UserRegBox.Clear();
     PassRegBox.Clear();
     Pass2RegBox.Clear();
     EmailRegBox.Clear();
     Email2RegBox.Clear();
     RegErrorLabel.Hide();
 }
Exemplo n.º 2
0
        private void RegisterButton_Click(object sender, EventArgs e)
        {
            string username  = UserRegBox.Text;
            string password  = PassRegBox.Text;
            string email     = EmailRegBox.Text;
            bool   privateAc = PvtRegCheck.Checked;
            bool   premium   = PremiumCheck.Checked;

            try
            {
                User user = new User(username, email, password, privateAc, premium, false);
                Spotflix.AddUser(user);
                RegErrorLabel.Show();
                panelRegister.Hide();
                panelInicio.Show();
                Spotflix.Save("Spotflix.bin", Spotflix.GetUserDB);
            }
            catch (Exception)
            {
                RegErrorLabel.Text = "Missing or incorrect\nfields";
                RegErrorLabel.Show();
            }
        }