private void btnLogin_Click(object sender, EventArgs e) { string username = txtUsername.Text; string pass = txtPassword.Text; if (username != "" && pass != "") { PersonClass personClass = new PersonClass(username, pass); personClass.PopulatingList(); if (personClass.LoginMethod()) { frmMenu menuForm = new frmMenu(); menuForm.personClassMenu = personClass; menuForm.tempFrmHolder = (frmLogin)Form.ActiveForm; menuForm.Show(); menuForm.RankExecution(); } else { MessageBox.Show("Password and Username doesn't match"); } } else { MessageBox.Show("Please leave no fields empty"); } }
private void lstPerson_SelectedIndexChanged(object sender, EventArgs e) { if (lstPerson.SelectedIndex != -1) { PersonClass person = (PersonClass)lstPerson.SelectedItem; txtPersonPSiRA.Text = person.PSiRA; txtPersonPSiRA.Enabled = false; txtPersonName.Text = person.Name; txtPersonSurname.Text = person.Surname; txtPersonUsername.Text = person.Username; txtPersonPassword.Text = person.Password; txtPersonConPassword.Text = ""; btnPersonLog.Text = "Update Employee"; if (person.Rank == 2) { cbAdmin.Checked = true; } else { cbAdmin.Checked = false; } } }