private void PassWord_Load(object sender, EventArgs e) { List <AdminsModel> adminList = PrepAndPaintDB.GetAdmins(); if (adminList.Count == 0) { MessageBox.Show("Currently there are no admins. Please create an admin account to protect your data", "No Admins!", MessageBoxButtons.OK, MessageBoxIcon.Warning); AdminPage adminPage = new AdminPage(); adminPage.ShowDialog(); } }
private void toolStripAdminButton_Click(object sender, EventArgs e) { CheckForAdmins(); PassWord passWord = new PassWord(); DialogResult result = passWord.ShowDialog(); if (result == DialogResult.OK) { AdminPage adminPage = new AdminPage(); adminPage.ShowDialog(); } }