Example #1
0
        /// <Summary>
        /// Gets a sub-collection of items in the collection by category.
        /// </Summary>
        /// <Param name="category">The category to get</Param>
        /// <Returns>A ProfilePropertyDefinitionCollection object</Returns>
        public ProfilePropertyDefinitionCollection GetByCategory(string category)
        {
            ProfilePropertyDefinitionCollection collection = new ProfilePropertyDefinitionCollection();

            foreach (ProfilePropertyDefinition definition in this.InnerList)
            {
                if (Operators.CompareString(definition.PropertyCategory, category, false) == 0)
                {
                    collection.Add(definition);
                }
            }
            return(collection);
        }
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// Gets a sub-collection of items in the collection by category.
        /// </summary>
        /// <param name="category">The category to get</param>
        /// <returns>A ProfilePropertyDefinitionCollection object</returns>
        /// -----------------------------------------------------------------------------
        public ProfilePropertyDefinitionCollection GetByCategory(string category)
        {
            var collection = new ProfilePropertyDefinitionCollection();

            foreach (ProfilePropertyDefinition profileProperty in InnerList)
            {
                if (profileProperty.PropertyCategory == category)
                {
                    collection.Add(profileProperty);
                }
            }
            return(collection);
        }
Example #3
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// Gets a collection of Property Defintions from the Data Store by portal
        /// </summary>
        /// <param name="portalId">The id of the Portal</param>
        /// <param name="clone">Whether to use a clone object.</param>
        /// <param name="includeDeleted">Whether to include deleted profile properties.</param>
        /// <returns>A ProfilePropertyDefinitionCollection object</returns>
        /// -----------------------------------------------------------------------------
        public static ProfilePropertyDefinitionCollection GetPropertyDefinitionsByPortal(int portalId, bool clone, bool includeDeleted)
        {
            portalId = GetEffectivePortalId(portalId);

            var definitions = new ProfilePropertyDefinitionCollection();

            foreach (ProfilePropertyDefinition definition in GetPropertyDefinitions(portalId))
            {
                if (!definition.Deleted || includeDeleted)
                {
                    definitions.Add(clone ? definition.Clone() : definition);
                }
            }
            return(definitions);
        }
Example #4
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// Gets a collection of Property Defintions from the Data Store by category
        /// </summary>
        /// <param name="portalId">The id of the Portal</param>
        /// <param name="category">The category of the Property Defintions to retrieve</param>
        /// <returns>A ProfilePropertyDefinitionCollection object</returns>
        /// -----------------------------------------------------------------------------
        public static ProfilePropertyDefinitionCollection GetPropertyDefinitionsByCategory(int portalId, string category)
        {
            portalId = GetEffectivePortalId(portalId);

            var definitions = new ProfilePropertyDefinitionCollection();

            foreach (ProfilePropertyDefinition definition in GetPropertyDefinitions(portalId))
            {
                if (definition.PropertyCategory == category)
                {
                    definitions.Add(definition);
                }
            }
            return(definitions);
        }
        /// <summary>
        /// Fills a ProfilePropertyDefinitionCollection from a DataReader
        /// </summary>
        /// <param name="dr">An IDataReader object</param>
        /// <returns>The ProfilePropertyDefinitionCollection</returns>
        private static ProfilePropertyDefinitionCollection FillCollection(IDataReader dr)
        {
            ArrayList arrDefinitions = CBO.FillCollection(dr, typeof(ProfilePropertyDefinition));
            ProfilePropertyDefinitionCollection definitionsCollection = new ProfilePropertyDefinitionCollection();
            foreach (ProfilePropertyDefinition definition in arrDefinitions)
            {
                //Clear the Is Dirty Flag
                definition.ClearIsDirty();

                //Initialise the Visibility
                object setting = UserModuleBase.GetSetting(definition.PortalId, "Profile_DefaultVisibility");
                if (setting != null)
                {
                    definition.Visibility = (UserVisibilityMode)Enum.Parse(typeof(UserVisibilityMode),setting.ToString());
                }

                //Add to collection
                definitionsCollection.Add(definition);
            }
            return definitionsCollection;
        }
Example #6
0
        /// <summary>
        /// Fills a ProfilePropertyDefinitionCollection from a DataReader
        /// </summary>
        /// <param name="dr">An IDataReader object</param>
        /// <returns>The ProfilePropertyDefinitionCollection</returns>
        private static ProfilePropertyDefinitionCollection FillCollection(IDataReader dr)
        {
            ArrayList arrDefinitions = CBO.FillCollection(dr, typeof(ProfilePropertyDefinition));
            ProfilePropertyDefinitionCollection definitionsCollection = new ProfilePropertyDefinitionCollection();

            foreach (ProfilePropertyDefinition definition in arrDefinitions)
            {
                //Clear the Is Dirty Flag
                definition.ClearIsDirty();

                //Initialise the Visibility
                object setting = UserModuleBase.GetSetting(definition.PortalId, "Profile_DefaultVisibility");
                if (setting != null)
                {
                    definition.Visibility = (UserVisibilityMode)Enum.Parse(typeof(UserVisibilityMode), setting.ToString());
                }

                //Add to collection
                definitionsCollection.Add(definition);
            }
            return(definitionsCollection);
        }
Example #7
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// DataBind binds the data to the controls
        /// </summary>
        /// <history>
        /// 	[cnurse]	03/01/2006  Created
        /// </history>
        /// -----------------------------------------------------------------------------
        public override void DataBind()
        {
		
            //Before we bind the Profile to the editor we need to "update" the visible data
            var properties = new ProfilePropertyDefinitionCollection();
			var imageType = new ListController().GetListEntryInfo("DataType", "Image");
            foreach (ProfilePropertyDefinition profProperty in UserProfile.ProfileProperties)
            {
                if (IsAdmin && !IsProfile)
                {
                    profProperty.Visible = true;
                }

                if (!profProperty.Deleted && (Request.IsAuthenticated || profProperty.DataType != imageType.EntryID))
                {
                    properties.Add(profProperty);
                }
            }

            ProfileProperties.User = User;
            ProfileProperties.ShowVisibility = ShowVisibility;
            ProfileProperties.DataSource = properties;
            ProfileProperties.DataBind();
        }
 /// -----------------------------------------------------------------------------
 /// <summary>
 /// Gets a sub-collection of items in the collection by category.
 /// </summary>
 /// <param name="category">The category to get</param>
 /// <returns>A ProfilePropertyDefinitionCollection object</returns>
 /// <history>
 ///     [cnurse]	01/31/2006	created
 /// </history>
 /// -----------------------------------------------------------------------------
 public ProfilePropertyDefinitionCollection GetByCategory(string category)
 {
     var collection = new ProfilePropertyDefinitionCollection();
     foreach (ProfilePropertyDefinition profileProperty in InnerList)
     {
         if (profileProperty.PropertyCategory == category)
         {
             collection.Add(profileProperty);
         }
     }
     return collection;
 }
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// Gets a collection of Property Defintions from the Data Store by portal
        /// </summary>
        /// <param name="portalId">The id of the Portal</param>
        /// <param name="clone">Whether to use a clone object.</param>
        /// <param name="includeDeleted">Whether to include deleted profile properties.</param>
        /// <returns>A ProfilePropertyDefinitionCollection object</returns>
        /// -----------------------------------------------------------------------------
        public static ProfilePropertyDefinitionCollection GetPropertyDefinitionsByPortal(int portalId, bool clone, bool includeDeleted)
        {
            portalId = GetEffectivePortalId(portalId);

            var definitions = new ProfilePropertyDefinitionCollection();
            foreach (ProfilePropertyDefinition definition in GetPropertyDefinitions(portalId))
            {
                if (!definition.Deleted || includeDeleted)
                {
                    definitions.Add(clone ? definition.Clone() : definition);
                }
            }
            return definitions;
        }
Example #10
0
 /// -----------------------------------------------------------------------------
 /// <summary>
 /// Gets a collection of Property Defintions from the Data Store by category
 /// </summary>
 /// <param name="portalId">The id of the Portal</param>
 /// <param name="category">The category of the Property Defintions to retrieve</param>
 /// <returns>A ProfilePropertyDefinitionCollection object</returns>
 /// -----------------------------------------------------------------------------
 public static ProfilePropertyDefinitionCollection GetPropertyDefinitionsByCategory(int portalId, string category)
 {
     portalId = GetEffectivePortalId(portalId); 
     
     var definitions = new ProfilePropertyDefinitionCollection();
     foreach (ProfilePropertyDefinition definition in GetPropertyDefinitions(portalId))
     {
         if (definition.PropertyCategory == category)
         {
             definitions.Add(definition);
         }
     }
     return definitions;
 }
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// DataBind binds the data to the controls
        /// </summary>
        /// <history>
        /// 	[cnurse]	03/01/2006  Created
        /// </history>
        /// -----------------------------------------------------------------------------
        public override void DataBind()
        {
            if (IsAdmin)
            {
                lblTitle.Text = string.Format(Localization.GetString("ProfileTitle.Text", LocalResourceFile), User.Username, User.UserID);
            }
            else if (IsRegister)
            {
                lblTitle.Text = Localization.GetString("RequireProfile.Text", LocalResourceFile);
            }
            else
            {
                divTitle.Visible = false;
            }

            //Before we bind the Profile to the editor we need to "update" the visible data
            ProfilePropertyDefinitionCollection properties = new ProfilePropertyDefinitionCollection();

            foreach (ProfilePropertyDefinition profProperty in UserProfile.ProfileProperties)
            {
                if (IsAdmin && !IsProfile)
                {
                    profProperty.Visible = true;
                }

                if (!profProperty.Deleted)
                    properties.Add(profProperty);
            }
            ProfileProperties.ShowVisibility = ShowVisibility;
            ProfileProperties.DataSource = properties;
            ProfileProperties.DataBind();
        }
 /// <Summary>
 /// Gets a sub-collection of items in the collection by category.
 /// </Summary>
 /// <Param name="category">The category to get</Param>
 /// <Returns>A ProfilePropertyDefinitionCollection object</Returns>
 public ProfilePropertyDefinitionCollection GetByCategory( string category )
 {
     ProfilePropertyDefinitionCollection collection = new ProfilePropertyDefinitionCollection();
     foreach( ProfilePropertyDefinition definition in this.InnerList )
     {
         if( Operators.CompareString( definition.PropertyCategory, category, false ) == 0 )
         {
             collection.Add( definition );
         }
     }
     return collection;
 }
Example #13
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// DataBind binds the data to the controls
        /// </summary>
        /// <history>
        /// 	[cnurse]	03/01/2006  Created
        /// </history>
        /// -----------------------------------------------------------------------------
        public override void DataBind()
        {
		
            //Before we bind the Profile to the editor we need to "update" the visible data
            var properties = new ProfilePropertyDefinitionCollection();

            foreach (ProfilePropertyDefinition profProperty in UserProfile.ProfileProperties)
            {
                if (IsAdmin && !IsProfile)
                {
                    profProperty.Visible = true;
                }

                if (!profProperty.Deleted)
                {
                    properties.Add(profProperty);
                }
            }

            ProfileProperties.User = User;
            ProfileProperties.ShowVisibility = ShowVisibility;
            ProfileProperties.DataSource = properties;
            ProfileProperties.DataBind();
        }