Wow, you're asking a lot in a single post.
I assure you you'll have better results if you take things one step at a time.
But I'll start you out with managing your users.
I found a piece of code set in a zip file. All you have to do is register yourself through your normal website registration.
Put the users.aspx file in your root folder so anyone can access it, type the location your browser, and change your login Id from guest to Admin.
AND THE MOST IMPORTANT PART IS AFTER YOU HAVE CHANGED YOURSELF TO AN ADMINISTRATOR,
MOVE THAT FILE TO A PROTECTED AREA OF YOUR SITE.
I wish I could take credit for writing the code but it was done by TomT, great piece of code.
Go here http://forums.asp.net/t/1110595.aspx the link for the users.aspx file is at the bottom of the first post.
And there you go.
It does leave out one thing though.
When you use the file above, it does not delete the member from the classifieds database.
So I added a storedprocedure to do this.
You should note that I am not using the exact code above.
I used a users.cs file that I converted to vb.
But you should be able to make my addition work.
You need to start with the user file you use for managing your members.
And you need to understand how it works.
When it runs through and deletes them member tell it to get the username you want to delete.
MembersDB.RemoveMemberFromDatabase(ListBox1.SelectedValue)
That line above tells it to go into App_Data/BLL/Members.vb
and looks for a sub your about to create, RemoveMemberFromDatabase
Public Shared Sub RemoveMemberFromDatabase(ByVal UserName As String)
Using db As New MembersDataAdapter()db.RemoveMemberByUsername(UserName, "/")
End Using
End Sub
That sub tells it to look in App_Code/DAL/Members.xsd
I like to go into the code itself, and I just copied insertmember, deleted the entries, only leaving the top three.
THE NAMES BELOW ARE ABBREVIATED.
RETURN
ASPNETusername
ASPNETAPPNAME
Since you copied, don't forget to change ALL insertmember (only in the one you copied) to RemoveMemberByUsername
Now it looks for your stored procedure.
Here's one I wrote.
ALTER PROCEDURE RemoveMemberByUsername @AspNetUsername nvarchar(256),
@AspNetApplicationName
nvarchar(256)
AS
DELETE FROM
classifieds_Members
WHERE
(AspNetUsername = @AspNetUsername) AND (AspNetApplicationName = @AspNetApplicationName)
And it should work.
(Note that I am using the final version so it says my members table is classifieds_Members)
If you are using beta, just remove "classifieds_"
Make sure you make a backup before trying new code, and test it out before publishing.
For the email notification you need to add code to the hourlyMaintenanceTimer to check for ads to expire.
It already does a check if it is expired, use that as a guideline,
And add a if statement to send an email if it will expire in 7 days or whatever you choose.
Questions 1, 2, & 3.
Use an if statement to tell the app what to do.
Good Luck
-Daniel
Please remember to click “Mark as Answer” on the post that helps you.
This can be beneficial to other community members reading the thread.