public void AccessControl() { if (objDBAccess.AuthenticateUser(strUsrName, strPswd) == "Emp") { shipToolStripMenuItem.Enabled = false; reportToolStripMenuItem.Enabled = false; } }
private void Authenticate() { String strRole = dbLayer.AuthenticateUser(txtUserName.Text, txtPassword.Text); if (strRole == null) { MessageBox.Show("Invalid Username/Password. Try Again!"); } else { frmShipMain objMainScreen = new frmShipMain(txtUserName.Text, strRole); objMainScreen.AccessControl(); objMainScreen.Show(); this.Visible = false; } }