private void ExecuteLogout(object obj)
        {
            int count = LogoutReasonCodes.Count();

            LogoutReasonCodes.Add(new ScreenPopUpEntity()
            {
                Name = string.Format("Logout{0}", (count + 1).ToString("00")), Description = LogoutReason, Pop_Label = "Logout " + (count + 1), Type = (int)ScreenOptions.LogoutReasonCodes
            });
            SetReasonCodeLabel();
            LogoutReason = "";
        }
        private void BindData()
        {
            try
            {
                this.SearchPopOptions.Clear();
                this.LogoutReasonCodes.Clear();
                this.AUXReasonCodes.Clear();
                this.WrapupReasoncodes.Clear();
                this.Wrapup             = "";
                this.LogoutReason       = "";
                this.NotReadyReason     = "";
                screenpopConfigs        = ScreenPopConfigModel.Instance.GetAgentConfigurationByProfile(Int32.Parse(SelectedProfile.Value.ToString()));
                this.CanScreenPop       = screenpopConfigs.CanScreenPop;
                this.AutoRecieve        = screenpopConfigs.AutoRecieve;
                this.VoiceScreenPop     = screenpopConfigs.VoiceScreenPop;
                this.ChatScreenPop      = screenpopConfigs.ChatScreenPop;
                this.IncidentScreenPop  = screenpopConfigs.IncidentScreenPop;
                this.IsDefaultConfig    = screenpopConfigs.IsDefault;
                this.IsDontOpen         = screenpopConfigs.CanOpen;
                this.IsDontOpenIncident = screenpopConfigs.CanOpenIncident;
                this.IsDontOpenChat     = screenpopConfigs.CanOpenChat;
                this.IsWrapup           = screenpopConfigs.WrapupReasonEnabled;
                this.IsLogout           = screenpopConfigs.LogoutReasonEnabled;
                this.IsAUXReason        = screenpopConfigs.AUXReasonEnabled;
                this.PrimaryCTIEngine   = screenpopConfigs.PrimaryCTIEngine;
                this.SecondaryCTIEngine = screenpopConfigs.SecondaryCTIEngine;
                this.IsQueueEnabled     = screenpopConfigs.IsQueueEnabled;
                this.AutoRecieve        = screenpopConfigs.AutoRecieve;
                this.Enhanced           = screenpopConfigs.IsEnhanced;

                if (!IsDontOpen)
                {
                    SelectedWorkSpaceList = WorkSpaceList.FirstOrDefault(p => p.ToString() == screenpopConfigs.DefaultWorkSpace);
                }
                if (!IsDontOpenChat)
                {
                    SelectedChatWorkSpaceList = WorkSpaceList.FirstOrDefault(p => p.ToString() == screenpopConfigs.ChatDefaultWorkspace);
                }
                if (!IsDontOpenIncident)
                {
                    SelectedIncidentWorkSpaceList = WorkSpaceList.FirstOrDefault(p => p.ToString() == screenpopConfigs.IncidentDefaultWorkspace);
                }

                if (screenpopConfigs.ScreenPopOptionsList != null)
                {
                    foreach (ScreenPopOptions opt in screenpopConfigs.ScreenPopOptionsList.Where(opt => opt.Type == (int)ScreenOptions.ScreenSearch))
                    {
                        SearchPopOptions.Add(new ScreenPopUpEntity()
                        {
                            ID = opt.ID, Pop_Label = opt.Pop_Label, Type = opt.Type, Description = opt.Description, Name = opt.Name
                        });
                    }

                    foreach (ScreenPopOptions opt in screenpopConfigs.ScreenPopOptionsList.Where(opt => opt.Type == (int)ScreenOptions.WrapupReasonCodes))
                    {
                        WrapupReasoncodes.Add(new ScreenPopUpEntity()
                        {
                            ID = opt.ID, Pop_Label = opt.Pop_Label, Type = opt.Type, Description = opt.Description, Name = opt.Name
                        });
                    }
                    foreach (ScreenPopOptions opt in screenpopConfigs.ScreenPopOptionsList.Where(opt => opt.Type == (int)ScreenOptions.LogoutReasonCodes))
                    {
                        LogoutReasonCodes.Add(new ScreenPopUpEntity()
                        {
                            ID = opt.ID, Pop_Label = opt.Pop_Label, Type = opt.Type, Description = opt.Description, Name = opt.Name
                        });
                    }

                    foreach (ScreenPopOptions opt in screenpopConfigs.ScreenPopOptionsList.Where(opt => opt.Type == (int)ScreenOptions.AUXReasonCodes))
                    {
                        AUXReasonCodes.Add(new ScreenPopUpEntity()
                        {
                            ID = opt.ID, Pop_Label = opt.Pop_Label, Type = opt.Type, Description = opt.Description, Name = opt.Name
                        });
                    }
                }
                SetReasonCodeLabel();
            }
            catch (Exception ex)
            {
                Logger.Logger.Log.Error("ScreenpopConfigurationViewModel: ", ex);
            }
        }