private bool GetApproval(UserAccess accesslevel = UserAccess.Cashier) { if (user.LoginType <= (int)accesslevel) { return(true); } else { if (accesslevel == UserAccess.Admin) { MessageBox.Show("This action requires approval from Administrator.", "Approval", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else if (accesslevel == UserAccess.Manager) { MessageBox.Show("This action requires approval from Manager.", "Approval", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else if (accesslevel == UserAccess.Supervisor) { MessageBox.Show("This action requires approval from Manager/Supervisor.", "Approval", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } frmApproval login = new frmApproval((int)accesslevel); if (login.ShowDialog() == System.Windows.Forms.DialogResult.OK) { clsUsers iuser = login.m_User; if (iuser.LoginType <= (int)accesslevel) { return(true); } } } return(false); }
private bool GetApproval(UserAccess accesslevel = UserAccess.Cashier) { if (m_user.LoginType <= (int)accesslevel) { return(true); } else { frmApproval login = new frmApproval((int)accesslevel); if (login.ShowDialog() == System.Windows.Forms.DialogResult.OK) { clsUsers iuser = login.m_User; if (iuser.LoginType <= (int)accesslevel) { return(true); } } } return(false); }