private void LoginToolStripMenuItem_Click(object sender, EventArgs e) { try { frmLogin frm = new frmLogin(); if (frm.ShowDialog() == DialogResult.OK) { HindMenu(); LoginToolStripMenuItem.Visible = false; LogoffToolStripMenuItem.Visible = true; if (Program.CurrentUser.mut_admin == true) { policyEditToolStripMenuItem.Visible = true; } frmAllRoom frmall = new frmAllRoom(); // frmall.MdiParent = this; frmall.ShowDialog(); } } catch (Exception ex) { Program.MessageError(ex.Source, ex.StackTrace, ex.Message, false); } }
private void LogoffToolStripMenuItem_Click(object sender, EventArgs e) { foreach (Form childForm in MdiChildren) { childForm.Close(); } Program.Logout(); LogoffToolStripMenuItem.Visible = false; LoginToolStripMenuItem.Visible = true; frmLogin frm = new frmLogin(); if (frm.ShowDialog() == DialogResult.OK) { HindMenu(); LoginToolStripMenuItem.Visible = false; LogoffToolStripMenuItem.Visible = true; frmAllRoom frmall = new frmAllRoom(); //frmall.MdiParent = this; frmall.ShowDialog(); } }