private void resetMenu()
        {
            if (this.resetFlag)
            {
                return;
            }
            this.resetFlag = true;
            //Will allow user to reset the menu back to the parent
            if (this.mainMenuPanel.Enabled == false)
            {
                //Remove the connected cd user entry
                //string errorCode;
                //string errorMesg;
                //ShopCashProcedures.DeleteConnectedCdUser(CashlinxDesktopSession.Instance.CashDrawerId,
                //    PawnSecurityAccessor.Instance.EncryptConfig.ClientConfig.ClientConfiguration.WorkstationId,
                //    CashlinxDesktopSession.Instance.CurrentSiteId.StoreNumber, CashlinxDesktopSession.Instance,
                //    out errorCode,
                //    out errorMesg);
                //CashlinxDesktopSession.Instance.LoggedInUserSecurityProfile = new UserVO();
                ADS.ClearLoggedInUser();

                ADS.ClearSessionData();

                this.mainMenuPanel.Enabled = true;
                this.mainMenuPanel.Visible = true;
                this.mainMenuPanel.ButtonControllers.resetGroupInitialState();
                this.mainMenuPanel.BringToFront();
                this.mainMenuPanel.Update();
                this.mainMenuPanel.setExitButtonHandler(this.exitButton_Click);
            }
            this.resetFlag = false;
        }
        private bool triggerNextEvent(MenuLevelController menuCtrl)
        {
            bool rt = false;

            if (menuCtrl != null)
            {
                Button triggerBtn = menuCtrl.TriggerButton;
                if (triggerBtn != null)
                {
                    if (triggerBtn != menuCtrl.BackButton)
                    {
                        string targetPanelName = menuCtrl[triggerBtn];


                        if (!string.IsNullOrEmpty(targetPanelName) &&
                            !targetPanelName.Equals("null"))
                        {
                            UserVO currUser = ADS.LoggedInUserSecurityProfile;
                            if (currUser == null || (string.IsNullOrEmpty(currUser.UserName)))
                            {
                                ADS.ClearLoggedInUser();
                                ADS.PerformAuthorization();
                            }
                            if (!string.IsNullOrEmpty(ADS.LoggedInUserSecurityProfile.UserName))
                            {
                                rt = this.initializeProperMenu(targetPanelName);
                            }
                            else
                            {
                                this.resetMenu();
                                return(true);
                            }
                        }
                        else
                        {
                            UserVO currUser = ADS.LoggedInUserSecurityProfile;
                            if (currUser == null || (string.IsNullOrEmpty(currUser.UserName)))
                            {
                                ADS.ClearLoggedInUser();
                                ADS.PerformAuthorization();
                            }
                            if (!string.IsNullOrEmpty(ADS.LoggedInUserSecurityProfile.UserName))
                            {
                                rt = this.InitializeFunctionality(
                                    StringUtilities.removeFromString(triggerBtn.Name.ToLowerInvariant(), "button"));
                            }
                            else
                            {
                                this.resetMenu();
                                return(true);
                            }
                        }
                    }
                    else
                    {
                        //We have the back button - reset the menu
                        this.resetMenu();
                        return(true);
                    }
                }
            }
            return(rt);
        }