Esempio n. 1
0
 private void btnOk_Click_1(object sender, EventArgs e)
 {
     user.Username = txtUsername.Text;
     user.Password = txtPassword.Text;
     if (bl.IsUserAllowed(user))
     {
         frmMain f = new frmMain();
         this.Hide();
         f.ShowDialog();
     }
     else
     {
         MessageBox.Show("Digitare credenziali corrette!");
     }
 }
 private void btnChangeNewPassword_Click_1(object sender, EventArgs e)
 {
     if (bl.IsUserAllowed(new User(txtChangedUsername.Text, txtOldPassword.Text)))
     {
         // Crea nuovo user.
         User newUser = new User(txtChangedUsername.Text, txtNewPassword.Text);
         bl.ChangePassword(newUser);
         frmMain f = new frmMain();
         f.Show();
         this.Hide();
     }
     else
     {
         MessageBox.Show("impossibile cambiare password!");
         this.Close();
     }
 }