简体   繁体   English

如何在给定登录信息的 Asp.net 网站中为不同类型的用户创建不同的网络表单

[英]how to create different webforms for different types of users in a Asp.net website given their logins

I am currently working on the website of a hospital management system.我目前正在做一个医院管理系统的网站。 I do know how to create a login form and how to code it.我知道如何创建登录表单以及如何对其进行编码。 The problem is that I have multiple types of users:问题是我有多种类型的用户:

  • doctors: will view information about their patients and the coming appointments医生:将查看有关他们的患者和即将到来的约会的信息
  • Nurse: Will see what room is she assigned to in a specific time and what client she's attending护士:会看到她在特定时间被分配到哪个房间以及她正在就诊的客户
  • Receptionist: will have access to information about the client and add/delete/modify an appointment接待员:将有权访问有关客户的信息并添加/删除/修改约会

How can I sort of enable some web forms to doctors only, or nurses only, or receptionists only based on their username/password ?如何仅根据用户名/密码为医生、护士或接待员启用某些 Web 表单?

You can Manage it using Membership built in feature in Visual Studio, where you can manage roles for different types of Users !!!您可以使用 Visual Studio 中内置的 Membership 功能来管理它,您可以在其中管理不同类型用户的角色!!!

For more details..refer the following link... https://msdn.microsoft.com/library/t32yf0a9(v=vs.100).aspx有关更多详细信息..请参阅以下链接... https://msdn.microsoft.com/library/t32yf0a9(v=vs.100).aspx

If you able to do that, do everything yourself over database.如果您能够做到这一点,请通过数据库自己完成所有工作。 You have some table Users , which contains logins and passwords.您有一些表Users ,其中包含登录名和密码。 Add also field Role or create one more table Roles and in table Users create foreign key for table roles .还添加字段Role或再创建一个表Roles并在表Users 中为表角色创建外键。 Then you might create few masterpages, one for each role, where you can design one masterpage fully for one role, another masterpage for another role, so on.然后,您可能会创建几个母版页,每个角色一个,您可以在其中完全为一个角色设计一个母版页,为另一个角色设计另一个母版页,依此类推。 And you should check on load for the role.您应该检查角色的负载。

Another way is making everything dynamically.另一种方法是动态地制作一切。 For example, in database you will create some table menus , where for every role you will create specific menu, and then call this menu on load for some specific role.例如,在数据库中,您将创建一些表格菜单,您将为每个角色创建特定菜单,然后在加载时为某个特定角色调用此菜单。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM