项目管理的管理员和其他用户部分 [英] Admin and other User Part of Project Manage
问题描述
您必须简单地使用基于密码的登录系统和public static bool IsAdmin
全局变量.然后为您想要的任何UI元素设置Visible = IsAdmin
!
或者,如果您想:Visible = IsAdmin && OtherConditions;
要保存代码并使其更容易使用,您可以为管理员提供一种方法.
例如:
公共 void IsAdministrator() { SpecialBackground.Visible = true ; AdministrationPanel.Visible = true ; Extra1Panel.Visible = true ; Extra2Panel.Visible = true ; Extra3Panel.Visible = true ; }
另一个像这样:
公共 void IsNotAdministrator() { SpecialBackground.Visible = false ; AdministrationPanel.Visible = false ; Extra1Panel.Visible = false ; Extra2Panel.Visible = false ; Extra3Panel.Visible = false ; }
然后,您需要做的就是授予管理员权限.
放入某种详细信息后,可能单击按钮即可:
IsAdministrator()
然后注销,并删除管理员权限,因为没有人可以登录,是这样的:
IsNotAdministrator()
我大部分时间都这样做.它将所有内容保持整齐.
hi
I have Created a Windows Application and I want to provide a Customization of the some Option in my project for Administrator and the admin set to the other User part which is show or not for user so pls help me for some ideas which i can apply on my appln.
thanks in Advance.
You have to simply use a password-based login system and apublic static bool IsAdmin
global variable. Then setVisible = IsAdmin
for any UI element you want!
Or, if you want:Visible = IsAdmin && OtherConditions;
To save on code and make it easier for yourself, you could have a method for the administrator.
For example:
public void IsAdministrator() { SpecialBackground.Visible = true; AdministrationPanel.Visible = true; Extra1Panel.Visible = true; Extra2Panel.Visible = true; Extra3Panel.Visible = true; }
And another like this:
public void IsNotAdministrator() { SpecialBackground.Visible = false; AdministrationPanel.Visible = false; Extra1Panel.Visible = false; Extra2Panel.Visible = false; Extra3Panel.Visible = false; }
Then all you would need to do to ''give'' admin rights is this.
Probably on a button click after putting in details of some sort:
IsAdministrator()
Then to log out, and remove the admin rights since no one will be logged in, is this:
IsNotAdministrator()
I do this most of the time. It keeps everything together and neat.
这篇关于项目管理的管理员和其他用户部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!