public ScreenPopConfig GetScreenConfigByProfileId(int profileid)
        {
            ScreenPopConfig list = GetObject <ScreenPopConfig>(string.Format("where Profileid={0}", profileid));

            if (list != null)
            {
                list.ScreenPopOptionsList = new List <ScreenPopOptions>(GetObjects <ScreenPopOptions>(string.Format("where ScreenPopConfigID={0}", list.ID))).ToList();
            }
            else
            {
                list = new ScreenPopConfig();
                list.CanScreenPop      = false;
                list.AutoRecieve       = false;
                list.VoiceScreenPop    = false;
                list.ChatScreenPop     = false;
                list.IncidentScreenPop = false;
                list.DefaultWorkSpace  = "";
                //list.ChatDefaultWorkSpace = "";
                //list.IncidentDefaultWorkSpace = "";
                list.ProfileId            = profileid;
                list.IsDefault            = true;
                list.ScreenPopOptionsList = null;
            }
            return(list);
        }
        public List <ScreenPopOptions> GetReasonByCode(int profileID, ReasonCodes reasoncode)
        {
            ScreenPopConfig wrapupreason = GetScreenConfigByProfileId(profileID);

            if (wrapupreason.ScreenPopOptionsList != null)
            {
                return(wrapupreason.ScreenPopOptionsList.Where(reason => reason.Type == (int)reasoncode).ToList());
            }
            else
            {
                return(null);
            }
        }