private void btnLogout_Click(object sender, EventArgs e) { this.Hide(); LoginActivity LoginForm = new LoginActivity(); LoginForm.Show(); }
private void ValidateRule() { if (roleValue == "ROLE_ADMIN") { CallMainMenu(); } else if (roleValue == "ROLE_GUARD") { //Environment.Exit(0); IsCallingMainMenu = true; this.Hide(); reader.CloseCom(); LoginActivity LoginForm = new LoginActivity(); LoginForm.Show(); } }
private void logOutToolStripMenuItem_Click(object sender, EventArgs e) { try { if (tabCtrlMainMenu.TabCount == 0 || (tabCtrlMainMenu.TabCount != 0 && MessageBox.Show("Are you sure you want logout?" + "\n" + "There are active form(s) open.", "Confirm...", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2) == DialogResult.Yes)) { logoutCloseCameraReader(); this.Hide(); LoginActivity LoginForm = new LoginActivity(); LoginForm.Show(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }