本文整理汇总了C#中DataLayer.GetAllRoles方法的典型用法代码示例。如果您正苦于以下问题:C# DataLayer.GetAllRoles方法的具体用法?C# DataLayer.GetAllRoles怎么用?C# DataLayer.GetAllRoles使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataLayer
的用法示例。
在下文中一共展示了DataLayer.GetAllRoles方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: frmResources
/// <summary>
/// Constructor with assembly path parameter to find all the RBAC resources used in the assembly
/// </summary>
/// <param name="pAssemblyPath"></param>
public frmResources(DataLayer pRbacd, string pAssemblyPath)
{
Rbacd = pRbacd;
if ((!SecurityPrincipal.IsRBACInitialized) && (SecurityPrincipal.IsRBACAuthenticated)) { throw new Exception("RBAC system is not activated..."); } // Check if the RBAC systm is initialize or not
if (pRbacd == null) { throw new Exception("RBAC data layer is not activated"); } //Check RBAC datalayer is valid or not
if (!File.Exists(pAssemblyPath)) { throw new Exception("Assembly not found"); } //Check that provided assembly path is valid or not
sRoleList = Rbacd.GetAllRoles();
sResourceList = Rbacd.GetAllResources();
assemblyPath = pAssemblyPath;
if ((sRoleList == null) || (sRoleList.Count == 0)) { throw new Exception("Role table is not ready"); }
Rbacd = pRbacd;//Initialize a member variable
InitializeComponent();
Bitmap bmp = Resources.Blue4;
this.BackgroundImage = (Image)bmp;
grpResources.BackgroundImage = (Image)bmp;
grpForms.BackgroundImage = (Image)bmp;
}
示例2: frmResourceRoleMapping
public frmResourceRoleMapping(DataLayer pRbacd, string pAssemblyPath)
{
Rbacd = pRbacd;
assemblyPath = pAssemblyPath;
if ((!SecurityPrincipal.IsRBACInitialized) && (SecurityPrincipal.IsRBACAuthenticated)) { throw new Exception("RBAC system is not activated..."); } // Check if the RBAC systm is initialize or not
if (pRbacd == null) { throw new Exception("RBAC data layer is not activated"); } //Check RBAC datalayer is valid or not
sRoleList = Rbacd.GetAllRoles();
sResourceList = Rbacd.GetAllResources();
if ((sRoleList == null) || (sRoleList.Count == 0)) { throw new Exception("Role table is not ready"); }
InitializeComponent();
if ((sResourceList == null) || (sResourceList.Count == 0)) { shouldClose = true; }
Bitmap bmp = Resources.Blue4;
//lvwResources.BackgroundImage = (Image)bmp;
//lvwRoles.BackgroundImage = (Image)bmp;
this.BackgroundImage = (Image)bmp;
grpResources.BackgroundImage = (Image)bmp;
grpRoles.BackgroundImage = (Image)bmp;
}