Click here to Skip to main content
15,943,233 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Dear All,

I want to make my survey expire date in mu survey table.

suppose 1 Feedback table is there with with column name feedback date,cust id,rating,ticket number.

one another table is Feedback config in this i want to make my user survey expire date and survey update date.

user can update his survey within 24 hours after closing the ticket or getting the mail

survey will expire after 15 days of getting mail.

suppose today i got mail for survey with url so i will be able to update my survey withing 24 hour.

suppose i open my mail after 15 days i try to open survey this time i want to expire the survey.


please help me out

Thanks
Posted
Comments
PIEBALDconsult 1-Aug-15 12:50pm    
It doesn't sound like you need to store a date for that; just compare "now" with the date the survey was entered, determine how many days have passed (DATEDIFF) and compare with the time limit (15 days). And make the time limit configurable; don't hard-code it.

1 solution

Then set a token along with that survey. The token would hold the details for your user and the survey and when it was initiated. For example, if I am asking to get a survey, application would store my User ID, Survey details (optional) and Time when I started it.

Now, that time would be in DateTime format, I can compare it to see whether it is 24 hours old or should I allow user to use it. For example,

C#
if((DateTime.Now - surveyCreated).TotalHours < 24) {
   // Survey was created with in 24 hours
} else {
   // Expire the token
}


When ever user wants to use that token, if that is expired he won't be able to update the survey or use the tool at all.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900