Reputation: 47
I'm new to .NET development and am building a simple display site.
I want to grab the number of unfinished orders from a database at the start of each day and display that number throughout the day:
( completed / original unfinished orders)
The number of "unfinished orders" changes throughout the day as orders are finished. If I cache this variable, each user of the site may get a different number depending on when they run the script.
I want each user to be able to see the same original daily total and have it reset at night. How can I accomplish this?
Upvotes: 0
Views: 26
Reputation: 2234
There are a couple of ways you can go about this. Probably one of the easiest options would be to store the completed date along with the order, where ever you are storing them, and simply query the store for all orders that have a completed date greater than the day before or doesn't have a completed date.
This would have the effect of counting all orders even if entries get completed today. So you will have consistent list of orders everyday unless more gets added in which case the number will go up.
Upvotes: 2