private void BttnLogIn_Click(object sender, EventArgs e) { if (txtUser.Text != "") { if (txtPassword.Text != "") { if ((userCollection.Search(txtUser.Text).UserName == txtUser.Text && userCollection.Search(txtUser.Text).Password == txtPassword.Text) || (txtUser.Text == "admin" && txtPassword.Text == "1234")) { lblIncorrect.Visible = false; userCollection.Search(txtUser.Text).LastAcess = DateTime.Now; xmlUsers.GenerateXMLUsers(userCollection.GetAll()); FormMenu formMenu = new FormMenu(userCollection.Search(txtUser.Text)); formMenu.Show(); Hide(); } else { lblIncorrect.Visible = true; } } else { MessageBox.Show("No se ha ingresado ninguna contraseña."); } } else { MessageBox.Show("No se ha ingresado ningún nombre de usuario."); } }
private void FormConfiguration_Load(object sender, EventArgs e) { tabUserManager.Visible = false; lblCreateLink.Visible = false; lblRecuperateLink.Visible = false; cmbQuestion.SelectedIndex = 0; cmbRecQuestion.SelectedIndex = 0; cmbRecUser.DataSource = userCollection.GetAll(); }