Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
		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;
		}
Beispiel #4
0
		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;
		}