Aaron Roberson wrote, On 12/21/2006 4:18 PM:
FIRST Q: My current application tracks who many times an individual
record is viewed by incrementing a value each time it is queried. How
would I do this in a MVC app, given that an individual record could be
queried for display in a view or for editing in a form?
I might have a method say like this (with appropriate syntax and
arguments you need -- this is just a shell):
function getRecordForEdit()
{
...get the record ...
return record;
}
function getRecordForView()
{
record = getRecordForEdit();
increment the number of times viewed
return record
}
Though, I'm sure there are better ways... that is just what immediately
comes to mind.
SECOND Q: How do I track what records a user has viewed during a
session (such as a product - like how Amazon displays items you have
viewed)?
I'd probably just use an array of structures stored in the session...
At least that seems like the most straightforward way.
-Sam
You are subscribed to cfcdev. To unsubscribe, please follow the instructions at
http://www.cfczone.org/listserv.cfm
CFCDev is supported by:
Katapult Media, Inc.
We are cool code geeks looking for fun projects to rock!
www.katapultmedia.com
An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]