private void button2_Click(object sender, EventArgs e) { this.Close(); EmployeePortal empportal = new EmployeePortal(); empportal.ShowDialog(); }
private void button2_Click(object sender, EventArgs e) { People = Admin.ReadXML <Manager>(path); for (int i = 0; i < People.Count; i++) { if (usernameAdminTB.Text.ToUpper() == People.ElementAt(i).username.ToUpper()) { valid1 = true; } if (passwordAdminTB.Text.ToUpper() == People.ElementAt(i).password.ToUpper()) { valid2 = true; } if (valid1 && valid2) { i = People.Count; EmployeePortal managerportal = new EmployeePortal(manage1); managerportal.Name = "Manager Portal"; managerportal.ShowDialog(); this.Close(); } } if (!(valid1)) { adminLoginError.Text = "***Unrecognizable username***"; } else { adminLoginError.Text = ""; valid1 = false; } if (!(valid2)) { adminLoginError.Text += "**invalid password***"; } else { adminLoginError.Text += ""; valid2 = false; } }
private void button2_Click(object sender, EventArgs e) { instant = EmployeeForm.ReadXML <Employee>(userpath); for (int i = 0; i < instant.Count; i++) { if (usernameUserTB.Text.ToUpper() == instant.ElementAt(i).username.ToUpper()) { valid1 = true; } if (passwordUserTB.Text.ToUpper() == instant.ElementAt(i).password.ToUpper()) { valid2 = true; } if (valid1 && valid2) { i = instant.Count; EmployeePortal employeeportal = new EmployeePortal(); employeeportal.ShowDialog(); this.Close(); } } if (!(valid1)) { userLoginError.Text = "***Unrecognizable username***"; } else { userLoginError.Text = ""; valid1 = false; } if (!(valid2)) { userLoginError.Text += "**invalid password***"; } else { userLoginError.Text += ""; valid2 = false; } }