Пример #1
0
 public static DataTable GetAdvertisement(int aid)
 {
     if (aid <= 0)
     {
         return(new DataTable());
     }
     return(Advertisenments.GetAdvertisement(aid));
 }
Пример #2
0
 public static void DeleteAdvertisementList(string advIdList)
 {
     if (Utils.IsNumericList(advIdList))
     {
         Advertisenments.DeleteAdvertisementList(advIdList);
         DNTCache.Current.RemoveObject(CacheKeys.FORUM_ADVERTISEMENTS);
     }
 }
Пример #3
0
 public static DataTable GetAdvertisements(int type)
 {
     if (type < 0)
     {
         return(Advertisenments.GetAdvertisements());
     }
     return(Advertisenments.GetAdvertisements(type));
 }
Пример #4
0
 public static int UpdateAdvertisementAvailable(string aidList, int available)
 {
     if (Utils.IsNumericList(aidList) && (available == 0 || available == 1))
     {
         int result = Advertisenments.UpdateAdvertisementAvailable(aidList, available);
         DNTCache.Current.RemoveObject(CacheKeys.FORUM_ADVERTISEMENTS);
         return(result);
     }
     return(0);
 }
Пример #5
0
 public static void UpdateAdvertisement(int adId, int available, string type, int displayorder, string title, string targets, string parameters, string code, string startTime, string endTime)
 {
     if (adId > 0)
     {
         startTime = ((startTime.IndexOf("1900") >= 0) ? "1900-1-1" : startTime);
         endTime   = ((endTime.IndexOf("1900") >= 0) ? "2555-1-1" : endTime);
         targets   = ((targets.IndexOf("全部") >= 0) ? ",全部," : ("," + targets + ","));
         Advertisenments.UpdateAdvertisement(adId, available, type, displayorder, title, targets, parameters, code, startTime, endTime);
         DNTCache.Current.RemoveObject(CacheKeys.FORUM_ADVERTISEMENTS);
     }
 }
Пример #6
0
        private static AdShowInfo[] GetAdsTable(string selectstr)
        {
            var       cacheService = DNTCache.Current;
            DataTable dataTable    = cacheService.RetrieveObject(CacheKeys.FORUM_ADVERTISEMENTS) as DataTable;

            if (dataTable == null)
            {
                dataTable = Advertisenments.GetAdsTable();
                cacheService.AddObject(CacheKeys.FORUM_ADVERTISEMENTS, dataTable);
            }
            DataRow[]    array  = dataTable.Select(selectstr);
            AdShowInfo[] array2 = new AdShowInfo[array.Length];
            for (int i = 0; i < array.Length; i++)
            {
                array2[i]              = new AdShowInfo();
                array2[i].Advid        = Utils.StrToInt(array[i]["advid"].ToString(), 0);
                array2[i].Displayorder = Utils.StrToInt(array[i]["displayorder"].ToString(), 0);
                array2[i].Code         = array[i]["code"].ToString().Trim();
                array2[i].Parameters   = array[i]["parameters"].ToString().Trim();
            }
            return(array2);
        }