项目管理的管理员和其他用户部分 [英] Admin and other User Part of Project Manage

查看:56
本文介绍了项目管理的管理员和其他用户部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨 我已经创建了一个Windows应用程序,我想在我的项目中为Administrator提供一些选项的自定义,并为另一个显示给用户的User部分提供admin设置,请帮助我提出一些可以应用的想法我的应用程序.

解决方案

您必须简单地使用基于密码的登录系统和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 a public static bool IsAdmin global variable. Then set Visible = 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屋!

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