Exemplo n.º 1
0
        /// <summary>
        /// Get subcampaign accounts for sales consultant
        /// </summary>
        public static List<CTScSubCampaignCompanyAndContact> GetSubCampaignAccounts(int SubCampaignId, eSalesAppCompanyViewMode SalesAppCompanyViewMode)
        {
            List<CTScSubCampaignCompanyAndContact> items = null;
            BrightPlatformEntities objBrightPlatformEntity = new BrightPlatformEntities(UserSession.EntityConnection);
            objBrightPlatformEntity.CommandTimeout = 0;
            if (SalesAppCompanyViewMode == eSalesAppCompanyViewMode.CompaniesOnly)
                items = objBrightPlatformEntity.FIScGetSubCampaignCompanyList(SubCampaignId).ToList();
            else if (SalesAppCompanyViewMode == eSalesAppCompanyViewMode.CompaniesAndContacts)
            {
                var _objFinalListId = objBrightPlatformEntity.final_lists.FirstOrDefault(i => i.sub_campaign_id == SubCampaignId);
                items = objBrightPlatformEntity.FIScGetSubCampaignCompaniesAndContactsList(SubCampaignId, _objFinalListId.id).ToList();
            }

            return items;
        }