private void LoadScreen(PositionDetailsScreen detail)
 {
     LoadScreen(detail, false);
 }
        private void LoadScreen(PositionDetailsScreen detail, bool isRefresh)
        {
            try
            {
#if SKIP_SAME_PAGE_LOAD
                if (_selectedScreen == detail)
                {
                    LogManager.WriteLog("Same screen was selected again. Skipped loading.", LogManager.enumLogLevel.Info);
                    return;
                }
#endif
                if ((_selectedScreen != detail) &&
                    (detail == PositionDetailsScreen.Handpay))
                {
                    ((ICashDispenserStatusParent)this).ParentLoaded = false;
                }
                else
                {
                    ((ICashDispenserStatusParent)this).ParentLoaded = true;
                }
                LogManager.WriteLog("Inside LoadScreen", LogManager.enumLogLevel.Info);

                this.DisposeChildren(true);
                this.DisposeViewHandPay();
                _currentScreen = null;

                if (_SlotMachine.Status == SlotMachineStatus.EmptyPosition || _SlotMachine.Status == SlotMachineStatus.FloatCollection)
                    return;

                switch (detail)
                {
                    case PositionDetailsScreen.Handpay:
                        //RefreshSlot();
                        ViewHandPayPageCaller(isRefresh);
                        break;

                    case PositionDetailsScreen.PlayerClub:
                        CPositionDetailsPlayerClub PlayerClub = new CPositionDetailsPlayerClub(ucSlotMachine.InstallationNo);
                        pnlContent.Children.Add(PlayerClub);
                        PlayerClub.Margin = new Thickness(0);
                        break;
                    case PositionDetailsScreen.FieldService:

                        CFieldService fieldService = new CFieldService(sBarPosName, lblAsset.Text.ToString(), lblGame.Text.ToString(), lblManufacturer.Text, lblSerialNo.Text);
                        fieldService.Installation = _SlotMachine.InstallationNo;
                        pnlContent.Children.Add(fieldService);
                        fieldService.Margin = new Thickness(0);
                        break;

                    case PositionDetailsScreen.Events:
                        CPositionDetailsEvents posDetailsEvents = new CPositionDetailsEvents(sBarPosName, _SlotMachine.InstallationNo);
                        pnlContent.Children.Add(posDetailsEvents);
                        posDetailsEvents.Margin = new Thickness(0);
                        break;
                    case PositionDetailsScreen.EnrollMachine:
                        break;
                    case PositionDetailsScreen.MachineMeters:

                        CMeterLife meterLife = new CMeterLife(_SlotMachine.InstallationNo, dtInstallationStartDate);
                        pnlContent.Children.Add(meterLife);
                        meterLife.Margin = new Thickness(0);
                        break;
                    case PositionDetailsScreen.FillsCredits:
                        break;
                    case PositionDetailsScreen.CurrentMeters:

                        CCurrentMeters currentMeters = new CCurrentMeters(_SlotMachine.InstallationNo, dtInstallationStartDateforCM);
                        pnlContent.Children.Add(currentMeters);
                        currentMeters.Margin = new Thickness(0);
                        break;
                    //case PositionDetailsScreen.MachineMaintenance:
                    //    CMachineMaintenanceView objMachineMaintenanceView = new CMachineMaintenanceView(sBarPosName, ucSlotMachine.InstallationNo);
                    //    objMachineMaintenanceView.Margin = new Thickness(0);
                    //    pnlContent.Children.Add(objMachineMaintenanceView);
                    //    break;
                    default:
                        break;
                }
            }
            catch (Exception ex)
            {
                ExceptionManager.Publish(ex);
            }
            finally
            {
                _selectedScreen = detail;
            }
        }
 /// <summary>
 /// Common Method for Access rights to buttons
 /// </summary>
 /// <param name="eButton"></param>
 /// <returns></returns>
 private bool HasAccess(PositionDetailsScreen eButton)
 {
     switch (eButton)
     {
         case PositionDetailsScreen.Handpay:
             return Security.SecurityHelper.HasAccess("CashdeskOperator.FloorView.cs.Handpay");
         case PositionDetailsScreen.PlayerClub:
             return Security.SecurityHelper.HasAccess("CashdeskOperator.FloorView.cs.PlayerClub");
         case PositionDetailsScreen.FieldService:
             return Security.SecurityHelper.HasAccess("CashdeskOperator.FloorView.cs.FieldService");
         case PositionDetailsScreen.Events:
             return Security.SecurityHelper.HasAccess("CashdeskOperator.FloorView.cs.Events");
         case PositionDetailsScreen.MachineMeters:
             return Security.SecurityHelper.HasAccess("CashdeskOperator.FloorView.cs.MachineMeters");
         case PositionDetailsScreen.MachineMaintenance:
             return Security.SecurityHelper.HasAccess("CashdeskOperator.Authorize.cs.MachineMaintenance");
         case PositionDetailsScreen.RemoveMachine:
             return Security.SecurityHelper.HasAccess("CashdeskOperator.FloorView.cs.RemoveMachine");
         case PositionDetailsScreen.SyncTicketExpire:
             return Security.SecurityHelper.HasAccess("CashdeskOperator.FloorView.cs.SyncTicketExpire");
         case PositionDetailsScreen.CurrentMeters:
             return Security.SecurityHelper.HasAccess("CashdeskOperator.FloorView.cs.CurrentMeters");
         case PositionDetailsScreen.ReinstateMachine:
             return Security.SecurityHelper.HasAccess("CashdeskOperator.FloorView.cs.ReinstateMachine");
         default:
             return false;
     }
 }