如何实现MVC 4更改日志? [英] How to implement a MVC 4 change log?

查看:249
本文介绍了如何实现MVC 4更改日志?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在开发一个MVC应用4。
客户希望有一个更改日志,这样他们可以查看哪些领域已被更改。它应该显示旧值和新值,在编辑的情况下。如果它是一个删除,那么它应该显示哪些行已被删除。

I currently am developing a mvc 4 application. The client wants to have a change log, so that they can view what fields have been changed. It should show the old value and the new value, in case of an edit. If its a delete, then it should show what row was deleted.

请告诉我实现这样的事情的最好方法?

Whats the best way to achieve something like this?

我只想澄清..这些变化将在数据库中的实际数据。

Just to clarify.. the changes will be the actual data in the database..

即我可能有客户的姓名和地址的记录。用户可能会更新地址..我需要的能力,看到用户改变什么..旧数据和新的数据

ie I might have a record of customer names and addresses.. the user might update the addresses.. I need the ability to see what the user changed.. old data and new data

谢谢...

推荐答案

这通常是在数据库中使用触发器完成的。您创建一个审计表,然后创建赶上每一个变化触发并记录下来。

This is typically done using triggers in the database. You create an audit table, and then create triggers that catch each change and record them.

的一篇文章说起这个是在这里:

An article talking about this is here:

HTTP://www.$c$ cproject.com/Articles/441498/Quick-SQL-Server-Auditing-Setup

最近的版本有内置的审核,但只有在企业版这是相当spendy ..大多数人都无法访问这些功能。

More recent versions of SQL Server have auditing built-in, but only in the enterprise editions which are quite spendy.. most people don't have access to these features.

另一种选择,我不能讲它有多好作品,都宣称添加审计功能的第三方工具。例如,一个简单的谷歌搜索找到了这些:

Another option, and I cannot speak to how well it works, are third party tools that claim to add auditing capability. For example, a simple google search found these:

http://krell-software.com/omniaudit/

https://renholdsoftware.com/SQLTableAudit

这篇关于如何实现MVC 4更改日志?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆