Exemplo n.º 1
0
        /// <summary>
        /// 删除一个外拨活动
        /// </summary>
        /// <param name="_confService"></param>
        /// <param name="campaignname"></param>
        /// <param name="tenantid"></param>
        /// <param name="switchname"></param>
        public static void DeleteCampaign(IConfService _confService, string campaignname,
                                          int tenantid, string switchname)
        {
            CfgCampaignQuery qcampaign = new CfgCampaignQuery(_confService);

            try
            {
                qcampaign.Name       = campaignname;
                qcampaign.TenantDbid = tenantid;

                CfgCampaign campaign = _confService.RetrieveObject <CfgCampaign>(qcampaign);
                campaign.Delete();
            }
            catch (Exception ex)
            {
                log.Error("can not create campaignname " + campaignname + ":" + ex.Message);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 获取外拨活动list
        /// </summary>
        /// <param name="_confService"></param>
        /// <param name="campaignname"></param>
        /// <param name="tenantid"></param>
        /// <param name="switchname"></param>
        public static ICollection <CfgCampaign> RetrieveCampaignList(IConfService _confService,
                                                                     int tenantid)
        {
            ICollection <CfgCampaign> campaign = null;

            CfgCampaignQuery qcampaign = new CfgCampaignQuery(_confService);

            try
            {
                qcampaign.TenantDbid = tenantid;


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

            return(campaign);
        }