start actions at a specific time

  • Thread starter Thread starter Bob Cummings
  • Start date Start date
B

Bob Cummings

Greetings

I am working on a Senior Project for school. It is a simple ASP.NET on
line card catalog for an in-house library. One of the requests the
client has is to send an email reminder to users who have checked out
materials for over two weeks. I can figure out how to do everything but
time the query for the database to get the list of users.

My initial idea is to have a small class that would have a timer running
in the background and check itself every 24 hours and then fire the
message or whatever to start the process. Is that the best way? Or am
I missing something simpler and better. I am a great believer is KISS
(Keep It Simple Stupid)

Thanks

Bob
 
Bob
Have you considered doing a scheduled task. You can do this from Control Panel and Scheduled Tasks and create a new task. The beauty of this approach is that your application is not burdened with making the decision of when to run. You can delegate that task to the "Scheduled Tasks" in windows

With Regards

Deepa
[I code, therefore I am


----- Bob Cummings wrote: ----

Greeting

I am working on a Senior Project for school. It is a simple ASP.NET on
line card catalog for an in-house library. One of the requests the
client has is to send an email reminder to users who have checked out
materials for over two weeks. I can figure out how to do everything but
time the query for the database to get the list of users

My initial idea is to have a small class that would have a timer running
in the background and check itself every 24 hours and then fire the
message or whatever to start the process. Is that the best way? Or am
I missing something simpler and better. I am a great believer is KISS
(Keep It Simple Stupid

Thank

Bo
 
Deepak has the right idea, Robert. One addition:
As soon as you send the e-mail, make sure to IMMEDIATELY mark the record in
the database. Otherwise, anyone interrupting your application will cause
the entire list of offenders to be spammed when it starts back up (and those
of us who are tardy with our books won't like that very much :-).

You will also want to put in a check in the unlikely event that your
application is not done spamming the list when either a person or the timer
fires off again and attempts to start your application running in a second
process. This would be messy, since everyone still remaining in the list
would get two e-mails.

Good Luck,
--- Nick

Deepak said:
Bob,
Have you considered doing a scheduled task. You can do this from Control
Panel and Scheduled Tasks and create a new task. The beauty of this approach
is that your application is not burdened with making the decision of when to
run. You can delegate that task to the "Scheduled Tasks" in windows.
With Regards,


Deepak
[I code, therefore I am]


----- Bob Cummings wrote: -----

Greetings

I am working on a Senior Project for school. It is a simple ASP.NET on
line card catalog for an in-house library. One of the requests the
client has is to send an email reminder to users who have checked out
materials for over two weeks. I can figure out how to do everything but
time the query for the database to get the list of users.

My initial idea is to have a small class that would have a timer running
in the background and check itself every 24 hours and then fire the
message or whatever to start the process. Is that the best way? Or am
I missing something simpler and better. I am a great believer is KISS
(Keep It Simple Stupid)

Thanks

Bob
 
Back
Top