Example #1
0
        //------------------------------------------
        #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);
        }
Example #2
0
        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);
        }
Example #3
0
        public static string GetAdvertiseFileForAdmin(int adID)
        {
            AdvertismentsEntity adv = AdvertismentsFactory.GetObject(adID);

            return(GetAdvertiseFileForAdmin(adv));
        }