I need to add a database entry as every one changes in an area as the old value and new value is indicated .
How would you go about this ??
Would you ...
-
Add a hidden field to each area and submit to an audit entry if presented on the new value if necessary? ?
-
To include on the data post, make a selection to compare each property and enter the audit entrance.
-
Any other thoughts?
Cheers.
Assume that you want to put it in the App Layer, I want to copy the per-field properties With the use of a model layer, all the data usage goes to this data model, so that you can give a hook to add functionality.
One based example (VBScript):
class cSomeEntity public database 'link to a database cover personal id, dirty, filled "If loaded various flags Private Sub class_initialize dirty = false dirty so db.execute (" Update some_table set Some_field =? Where id =? ", Array (p_some_field, ID)) End Sub Public Sub load_by_id (value) set down Rs = False end sub private sub-class_terminate end if rs = database .fetch_rs ("id, select some_field from some_table where id =?", Array (id)) id = Rs ("id") p_some_field = Rs ("some_field") Load = true end sub personal p_some_field public property received some_field some_field = p_some_field end property public property some_field (ma ) Go when err.raise 1 ,, "entity has not yet started loading, .load_by_id call () first!" If the value is & lt; & Gt; p_some_field dirty = true make_log_entry ( "some_value", p_some_field, value) p_some_field = Value End If End Property Private Sub make_log_entry (area, old_value, new_value) put db.execute ( "audit_log (tables, fields, old_value, new_value) values (",?,?,?)", _ Array ("some_table", area, old_value, new_value)) end sub end squared
It may look a bit bloated, but it There is more flexibility than a trigger-based approach, for example you can easily apply the boundary check and such.
Secondly, when you need to write multiple unit sections you can use a lot of functionality to push in a delegate class and write code property to write property gator &; Sets.
Comments
Post a Comment