예제 #1
0
 public static void SaveProfileAttribute(ProfileAttribute attribute)
 {
     if (attribute.ProfileAttributeID > 0)
         ProfileAttribute.Update(attribute);
     else
         ProfileAttribute.Add(attribute);
 }
예제 #2
0
        private List<ProfileAttribute> ExtractAttributes()
        {
            List<ProfileAttribute> attributes = new List<ProfileAttribute>();
            foreach (ProfileAttributeType type in _presenter.GetProfileAttributeTypes())
            {
                Label lblAttributeTypeID = phAttributes.FindControl("lblAttributeTypeID" + type.ProfileAttributeTypeID.ToString()) as Label;
                Label lblProfileAttributeID =
                    phAttributes.FindControl("lblProfileAttributeID" + type.ProfileAttributeTypeID.ToString()) as Label;
                //Label lblProfileAttributeTimestamp =
                //    phAttributes.FindControl("lblProfileAttributeTimestamp" + type.ProfileAttributeTypeID.ToString()) as
                //    Label;
                TextBox txtProfileAttribute = phAttributes.FindControl("txtProfileAttribute" + type.ProfileAttributeTypeID.ToString()) as TextBox;
                ProfileAttribute pa = new ProfileAttribute();
                if (!string.IsNullOrEmpty(lblProfileAttributeID.Text))
                    pa.ProfileAttributeID = Convert.ToInt32(lblProfileAttributeID.Text);
                else
                    pa.ProfileAttributeID = 0;

                //if (!string.IsNullOrEmpty(lblProfileAttributeID.Text) && !string.IsNullOrEmpty(lblProfileAttributeTimestamp.Text))
                //    pa.TimeStamp = lblProfileAttributeTimestamp.Text.StringToTimestamp();

                pa.ProfileAttributeTypeID = Convert.ToInt32(lblAttributeTypeID.Text);
                pa.Response = txtProfileAttribute.Text;
                pa.CreateDate = DateTime.Now;
                attributes.Add(pa);
            }
            return attributes;
        }