private void btnVisitor_Click(object sender, EventArgs e) { frmPrincipal frmPrincipal = new frmPrincipal(); frmPrincipal.Show(); this.Hide(); }
private void btnLogin_Click(object sender, EventArgs e) { foreach (clsClient user in clsGlobal.Company.Cliente.Elements) { if (user.User == txtUser.Text && user.Password == txtPassword.Text) { clsGlobal.userClient = user; break; } } foreach (clsEmployee user in clsGlobal.Company.VEmployee.Elements) { if (user.User == txtUser.Text && user.Password == txtPassword.Text) { clsGlobal.userEmployee = user; break; } } if (clsGlobal.userClient != null || clsGlobal.userEmployee != null) { frmPrincipal frmPrincipal = new frmPrincipal(); frmPrincipal.Show(); this.Hide(); } else { MessageBox.Show("User don't found "); } }