Beispiel #1
0
        internal static UserProfileField Factory(Guid contactId, Guid profileId, ProfileField profileField)
        {
            UserProfileField f = new UserProfileField();

            f.Id        = Guid.Empty;
            f.ProfileId = profileId;
            f.FieldId   = profileField.Id;
            f.ContactId = contactId;
            f.Name      = profileField.Name;
            return(f);
        }
Beispiel #2
0
        internal static ProfileField Factory(Entity e)
        {
            ProfileField field = new ProfileField();

            field.Id               = e.GetAttributeValue <Guid>("appl_profilefieldid");
            field.Name             = e.GetAttributeValue <string>("appl_name");
            field.Options          = e.GetAttributeValue <string>("appl_options");
            field.RequirementLevel = (ProfileFieldRequirementLevels)e.GetAttributeValue <OptionSetValue>("appl_requirementlevel").Value;
            field.DataType         = (ProfileFieldDataTypes)e.GetAttributeValue <OptionSetValue>("appl_datatype").Value;
            return(field);
        }
Beispiel #3
0
        internal static Profile Factory(EntityCollection Fields, Guid ProfileId)
        {
            Profile profile = new Profile()
            {
                Id = ProfileId
            };

            foreach (Entity e in Fields.Entities)
            {
                profile.Fields.Add(ProfileField.Factory(e));
            }
            return(profile);
        }
Beispiel #4
0
        public ProfileField Field(string name)
        {
            ProfileField field = Fields.FirstOrDefault(x => GetPropName(x.Name).Equals(GetPropName(name), StringComparison.OrdinalIgnoreCase));

            if (field == null)
            {
                field = Fields.FirstOrDefault(x => x.Name.Equals(name, StringComparison.OrdinalIgnoreCase));
            }
            if (field != null)
            {
                return(field);
            }
            throw new ArgumentException(string.Format("A field with the name {0} was not found in the profile", name), "name");
        }