コード例 #1
0
 public void AddSiteLinksToPromotion(Promotion promo, CampaignSetupModel model, int customerFk)
 {
     if (model.SiteLinks != null)
         foreach (var sitelink in model.SiteLinks)
         {
             var slink = new SiteLink
             {
                 LinkText = sitelink.LinkText,
                 LinkURL = sitelink.LinkURL,
                 PromotionFK = promo.PromotionPK
             };
             promo.SiteLinks.Add(slink);
             try
             {
                 var sw = new ServiceClientWrapper();
                 var adEngines = new List<string>();
                 if (promo.IsLaunched)
                 {
                     adEngines.AddRange(promo.PromotionAdEngineSelecteds.Select(pades => pades.AdvertisingEngine.AdvertisingEngine1));
                     sw.scheduleRefreshSiteLinksForAd(customerFk, promo.PromotionPK, adEngines);
                 }
             }
             catch (Exception ex) { SharedResources.Helpers.ExceptionHelper.LogException(ex.ToString()); }
         }
 }