public static string GetRoleIds(string[] Roles, int SiteId) { int i = 0; string RoleIds = ""; var db = new Data.Common(); object obj = null; // DataCache.CacheRetrieve(SiteId & "afroles") if (obj == null) { var rc = new Security.Roles.RoleController(); foreach (Security.Roles.RoleInfo ri in rc.GetPortalRoles(SiteId)) { string roleName = ri.RoleName; foreach (string role in Roles) { if (!string.IsNullOrEmpty(role)) { if (roleName == role) { RoleIds += ri.RoleID.ToString() + ";"; break; } } } } // DataCache.CacheStore(SiteId & "afroles", RoleIds) } return(RoleIds); }
private static ArrayList GetRoles(int PortalId) { object obj = DataCache.CacheRetrieve(PortalId + "RoleNames"); ArrayList roleNames; if (obj == null) { var objRoleController = new Security.Roles.RoleController(); roleNames = objRoleController.GetPortalRoles(PortalId); DataCache.CacheStore(PortalId + "RoleNames", roleNames); } else { roleNames = (ArrayList)obj; } return(roleNames); }
private static ArrayList GetRoles(int PortalId) { object obj = DataCache.CacheRetrieve(PortalId + "RoleNames"); ArrayList roleNames; if (obj == null) { var objRoleController = new Security.Roles.RoleController(); roleNames = objRoleController.GetPortalRoles(PortalId); DataCache.CacheStore(PortalId + "RoleNames", roleNames); } else { roleNames = (ArrayList)obj; } return roleNames; }
public static string GetRoleIds(string[] Roles, int SiteId) { int i = 0; string RoleIds = ""; var db = new Data.Common(); object obj = null; // DataCache.CacheRetrieve(SiteId & "afroles") if (obj == null) { var rc = new Security.Roles.RoleController(); foreach (Security.Roles.RoleInfo ri in rc.GetPortalRoles(SiteId)) { string roleName = ri.RoleName; foreach (string role in Roles) { if (!string.IsNullOrEmpty(role)) { if (roleName == role) { RoleIds += ri.RoleID.ToString() + ";"; break; } } } } // DataCache.CacheStore(SiteId & "afroles", RoleIds) } return RoleIds; }