LoginView 用于自定义逻辑

发布于 2024-08-20 05:26:07 字数 305 浏览 6 评论 0原文

我对 LoginView 控件有些熟悉,并了解如何使用它来创建一页的只读版本和编辑版本。然后,该页面会显示不同的内容,具体取决于您是处于“读者”角色还是被授予“编辑”角色成员资格。 效果很好!

现在,如果例如 editor1 打开表单并开始更新特定数据对象...我认为如果尝试通过页面访问同一对象的所有其他编辑器角色成员都以只读模式显示,那么会很好editor1 仍然打开着。 其他编辑者打开的任何其他对象都应该以编辑模式为他打开。

因此,我正在考虑根据您尝试显示的对象来调整角色成员资格。

怎么会有人做这样的事呢?

谢谢! 拉尔夫

I am somewhat familar with the LoginView control and understand how to use it to create say a read-only version and edit version of one page. The page then displays different depending if you are in a "readers" role or you were granted "editors" role membership.
Works nice!

Now what if for example editor1 opened the form and began updating a particular data object... I think it would be nice if all other editor role members that tried to access the same object through the page would be shown in the read only mode while editor1 still has it open.
Any other object another editor opens should open in edit mode for him.

So I am thinking of messing around with the role memberships depending what object you try to display.

How would someone do something like that?

Thanks!
Ralf

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

寒尘 2024-08-27 05:26:07

一次只有一个用户编辑一条记录,这并不是一件容易的事。您必须:

  • 登录用户正在编辑记录的数据库。
  • 使用 Web 服务经常检查此状态。

我不相信有一种方法可以使它完美,当另一个用户访问它时,用户会立即被锁定......这将很棘手。

或者,您可以使用冲突解决功能,您可以在其中执行一些操作,例如比较原始值,并查看这些原始值是否被其他用户更改。如果他们这样做了,那么可以合并任何更改,或者您可以提示用户决定要做什么,或类似的事情。

HTH。

That's not very easy to do, to have only one user edit a record at a time. You would have to:

  • Log in the database that a user is editing a record.
  • Use a web service to check for this status frequently.

I don't believe there is a way to make it perfect, where the user is instantly locked when another user accesses it... it will be tricky.

Alternatively, you can have a conflict resolution feature, where you can do something like compare the original values, and see if those original values changed by another user. If they did, then any changes can be merged or you can prompt the user to decide what to do, or something like that.

HTH.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文