Last post Nov 01, 2007 05:42 PM by ashmetry
Nov 01, 2007 01:40 PM|kyleq|LINK
Is there a routine that allows the administrator to update the expiration date of an ad? Also, what is the process to re-activate an ad. When I make an ad active after it has expired, the expiration date does not change.
In order to give the administrator the ability to edit the expiration date I have:
If you have any ideas please let me know.
Below are the steps I took to make the data connections.
So far this displays the Ad record and lets me change the fields but does not update the table.
Nov 01, 2007 01:53 PM|ashmetry|LINK
When an ad expires it also changes the AdStatus (to -50 if i remember correctly) , not just the expiration date. Could this be your issue or are you sure the date itself is not updated?
Nov 01, 2007 05:26 PM|kyleq|LINK
You are correct. When an ad expires it changes the ad status to -50. It is then inactive. The Site Administration,/ Manage Ads feature will let you set an ad to active but that action does not change the status or expiration date. The ad will remain
active during the current session but then reverts to inactive status.
There is a stored procedure named RelistAd and a sub-routine in the App_Code/BLL/Ads.vb named RelistAd but I see no way to get to it.
If an ad expires and you want to re-list for another period of time the only way I have found is to go into the database and make the changes there. That is both cumbersom and dangerous.
Nov 01, 2007 05:42 PM|ashmetry|LINK
Agreed you do not want to touch the DB directly.
I created a SP that does that for me. You can map that SP in the ads.xsd and call it from your admin page.
--Usage exec [RelistAd] <AdId>,100,<Some_Future_date>
ALTER PROCEDURE [dbo].[RelistAd]
@ExpirationDate smalldatetime = NULL
ExpirationDate = @ExpirationDate ,
AdStatus = @AdStatus,
NumResponses = 0,
NumViews = 0
WHERE Id = @AdId