C#桌面应用程序中的菜单驱动程序 [英] menu driven program in c# desktop application

查看:79
本文介绍了C#桌面应用程序中的菜单驱动程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何开发菜单驱动程序-意味着每个用户都可以在c#桌面/Windows应用程序中访问该应用程序.

谢谢
payraj

How can I develop a menu driven program - means as per user they can get access the application in c# desktop/windows application.

thanks
payraj

推荐答案

您必须从后端进行控制,并且应该有一个表,该表赋予该用户什么权限.此外,您还必须在菜单中启用或禁用该功能.
You got to control this from backend and should have a table for which user what what rights. And further you got to enable or diable the feature in your Menus.


在登录时,应将UserId保存在静态变量中,以便能够在所有项目中读取此变量.
在创建菜单时,您应该检查该用户是否具有启用或禁用它的权限,还可以在屏幕内启动控件以根据权限启用和禁用它.
因此您的表可能包含3个字段:
WindowName,控件名(按钮,文本...),usersEnable(包含有权访问此屏幕上此控件的用户的ID)
当您要检查权限时,可以选择usersenabled,其中userid =(在登录时初始化的静态变量),将获得用逗号分隔列表的用户,并检查登录的ID是否在列表中.
很抱歉没有编码,但可能对我有帮助:)
gd运气
at the login time you should save the UserId in a static variable to be able to read this variable in all your project.
and when you are creating your menu you should check if this user have the rights to enable or disable it, also you can itterate your controls inside the screen to enable and disble it according to the rights.
so your table may contain 3 fields:
WindowName,controlname (buttons,texts...),usersEnable(contain the ID of the users that have the rights to access this control in this screen)
when you want to check the rights,you can select the usersenabled where userid = (the staticvariable you initialized in login time) and you will get users with comma separated list and you will check if the ID logged in is inside the list.
Sorry for not coding, but may be i help in the algorithm :)
gd luck


我已经下载了类似的项目,您可以从此处使用源代码作为参考
http://www.c-sharpcorner.com/UploadFile/rahul4_saxena/1130/ [ ^ ]

这是一个小型办公室管理系统.在该项目的帮助下,所有办公室员工都可以彼此联系,请求在线请假,获取生日提醒,获取当前/不在职员工的状态以及在登录和注销时使用自动出勤系统.只需在每个计算机上安装和设置此项目即可.
在此项目中,有两种类型的用户,一种是办公室的员工,另一种是管理员.管理员对该项目具有完全访问权限.我在下面的DFD中显示了这两种类型的用户的所有权限.
I have Downloaded the Similar Project u can use source code for Reference from here
http://www.c-sharpcorner.com/UploadFile/rahul4_saxena/1130/[^]

This is a small office management system. With the help of this project all office employee can connect with each other, request online leave, get birthday reminders, get status of present/absent employees and use an automatic attendence system when logged in and logged out. Just need to install and setup of this project to every machine.
In this project there are 2 types of users one is Employee of a office and other is Admin. An Admin has full access for this project. I am showing every right of both types of user in the following DFD.


这篇关于C#桌面应用程序中的菜单驱动程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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