public static ICollection <CfgPerson> RetrieveAgentListfromAgentGroup(IConfService _confService,
                                                                              int tenantid, CfgGroup group)
        {
            ICollection <CfgPerson> person = null;

            CfgAgentGroup agentgroup = null;


            CfgAgentGroupQuery qagentgroup = new CfgAgentGroupQuery(_confService);

            try
            {
                qagentgroup.TenantDbid = tenantid;
                qagentgroup.Dbid       = group.DBID;

                agentgroup = _confService
                             .RetrieveObject <CfgAgentGroup>(qagentgroup);

                person = agentgroup.Agents;
            }
            catch (Exception ex)
            {
                log.Error("获取qagentgroup列表失败   " + ex.Message);
            }


            return(person);
        }
Example #2
0
        public ICollection GetAllObjectsForType(string objectType)
        {
            switch (objectType)
            {
            case "CFGApplication":
                CfgApplicationQuery appQuery = new CfgApplicationQuery(confServiceContract);
                var apps = confServiceContract.RetrieveMultipleObjects <CfgApplication>(appQuery);
                return(BuildObjectDictionary(apps));

            case "CFGAgentGroup":
                CfgAgentGroupQuery agQuery = new CfgAgentGroupQuery(confServiceContract);
                var agentGroups            = confServiceContract.RetrieveMultipleObjects <CfgAgentGroup>(agQuery);
                return(BuildObjectDictionary(agentGroups));
            }

            return(null);
        }
        /// <summary>
        /// 获取座席组
        /// </summary>
        /// <param name="_confService"></param>
        /// <param name="campaignname"></param>
        /// <param name="tenantid"></param>
        /// <param name="switchname"></param>
        public static CfgAgentGroup RetrieveAgentGroup(IConfService _confService, int dbid,
                                                       int tenantid)
        {
            CfgAgentGroup agentgroup = null;

            CfgAgentGroupQuery qagentgroup = new CfgAgentGroupQuery(_confService);

            try
            {
                qagentgroup.TenantDbid = tenantid;
                qagentgroup.Dbid       = dbid;

                agentgroup = _confService
                             .RetrieveObject <CfgAgentGroup>(qagentgroup);
            }
            catch (Exception ex)
            {
                log.Error("获取qagentgroup列表失败   " + ex.Message);
            }

            return(agentgroup);
        }
        /// <summary>
        /// 获取座席组列表
        /// </summary>
        /// <param name="_confService"></param>
        /// <param name="campaignname"></param>
        /// <param name="tenantid"></param>
        /// <param name="switchname"></param>
        public static ICollection <CfgAgentGroup> RetrieveAgentGroupList(IConfService _confService,
                                                                         int tenantid)
        {
            ICollection <CfgAgentGroup> agentgroup = null;

            CfgAgentGroupQuery qagentgroup = new CfgAgentGroupQuery(_confService);

            try
            {
                qagentgroup.TenantDbid = tenantid;


                agentgroup = _confService
                             .RetrieveMultipleObjects <CfgAgentGroup>(qagentgroup);
            }
            catch (Exception ex)
            {
                log.Error("获取qagentgroup列表失败   " + ex.Message);
            }

            return(agentgroup);
        }
        /// <summary>
        /// The Will Retrieve the Pperson Id of which group the login agent is superadmin.
        /// If the User is Agent Means it will not Performed.
        /// </summary>
        public static List <string> GetMyTeamAgentId()
        {
            List <string>      empId           = new List <string>();
            CfgAgentGroupQuery agentGroupQuery = new CfgAgentGroupQuery();

            agentGroupQuery.TenantDbid = ConfigContainer.Instance().TenantDbId;
            ICollection <CfgAgentGroup> agentGroups = ConfigContainer.Instance().ConfServiceObject.RetrieveMultipleObjects <CfgAgentGroup>(agentGroupQuery);

            if (agentGroups != null && agentGroups.Count > 0)
            {
                //this is added by sakthikumar to determine the age is admin or not.
                WorkbinUtility.Instance().AgentGroup   = agentGroups.Where(x => x != null && x.GroupInfo != null && x.GroupInfo.Managers != null && x.GroupInfo.Managers.Where(y => y.EmployeeID.Equals(ConfigContainer.Instance().AgentId)).ToList().Count > 0).ToList();
                WorkbinUtility.Instance().IsSuperadmin = WorkbinUtility.Instance().AgentGroup.Count > 0;
                foreach (CfgAgentGroup agentgroup in WorkbinUtility.Instance().AgentGroup)
                {
                    foreach (CfgPerson person in agentgroup.Agents)
                    {
                        empId.Add(person.EmployeeID);
                    }
                }
            }
            return(empId);
        }