private void registerToolStripMenuItem2_Click(object sender, EventArgs e) { RegisterForm registerForm = null; if (isFormOpened(typeof(RegisterForm)) == null) { registerForm = new RegisterForm("Register", null); registerForm.MdiParent = this; registerForm.Show(); } }
private void btnResetPassword_Click(object sender, EventArgs e) { string errMsg = ""; if (dataGridView1.SelectedCells.Count == 0) { errMsg = "Select user to be reset"; } else { string selectedUserId = dataGridView1.SelectedCells[0].Value.ToString(); string selectedUserName = dataGridView1.SelectedCells[1].Value.ToString(); bool selectedIsAdmin = (bool)dataGridView1.SelectedCells[2].Value; RegisterForm registerForm = new RegisterForm("Reset Password", selectedUserName); registerForm.ShowDialog(this); } if (errMsg != "") { MessageBox.Show(this, errMsg, "Reset Password", MessageBoxButtons.OK, MessageBoxIcon.Hand); } }