public static DataTable GetAdvertisement(int aid) { if (aid <= 0) { return(new DataTable()); } return(Advertisenments.GetAdvertisement(aid)); }
public static void DeleteAdvertisementList(string advIdList) { if (Utils.IsNumericList(advIdList)) { Advertisenments.DeleteAdvertisementList(advIdList); DNTCache.Current.RemoveObject(CacheKeys.FORUM_ADVERTISEMENTS); } }
public static DataTable GetAdvertisements(int type) { if (type < 0) { return(Advertisenments.GetAdvertisements()); } return(Advertisenments.GetAdvertisements(type)); }
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); }
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); } }
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); }