//------------------------------------------ #endregion #region --------------GetAdForShowFile-------------- public static string GetAdForShowFile(int placeID, Guid OwnerID) { Languages langID = SiteSettings.GetCurrentLanguage(); AdvertismentsEntity advertisment = AdvertismentsSqlDataPrvider.Instance.GetAdForShow(placeID, OwnerID, langID); string adText = ""; if (advertisment != null) { adText = GetAdvertiseFile(advertisment); } else { AdvPlacesEntity adPlace = AdvPlacesFactory.GetObject(placeID); if (adPlace != null) { adText = AdvertismentsFactory.GetAdvertiseFile(adPlace.DefaultFileType, adPlace.DefaultFilePath, -1, adPlace.Width, adPlace.Height, "", false); } } return(adText); }
public static string GetSeparatedAdForShow(int placeID, Guid OwnerID) { string adText = ""; AdvPlacesEntity adPlace = AdvPlacesFactory.GetObject(placeID); List <AdvertismentsEntity> advertismentList = AdvertismentsSqlDataPrvider.Instance.GetSeparatedAdForShow(placeID, OwnerID, adPlace.EnableSeparatedCount); foreach (AdvertismentsEntity advertisment in advertismentList) { if (advertisment != null) { adText += GetAdvertiseFile(advertisment); } else { if (adPlace != null) { adText += AdvertismentsFactory.GetAdvertiseFile(adPlace.DefaultFileType, adPlace.DefaultFilePath, -1, adPlace.Width, adPlace.Height, "", false); } } } return(adText); }