private void AddBanners(WebPage webPage, AppCache appCache) { if (webPage != null && webPage.bannerTopicId > 0) { BannerTopic bt = appCache.GetBannerTopic(webPage.bannerTopicId); if (bt != null) { int[] bannerIds = { bt.b1, bt.b2, bt.b3, bt.b4, bt.b5, bt.b6, bt.b7, bt.b8, bt.b9 }; for (int i = 0; i < bannerIds.Length; i++) { int bannerIndex = i + 1; int bannerId = bannerIds[i]; if (bannerId > 0 && !banners.ContainsKey(bannerIndex)) { Banner banner = appCache.GetBanner(bannerId); if (banner != null) { banners.Add(bannerIndex, banner); } } } } } }