Esempio n. 1
0
        public void AddProfileAttribute(List<ProfileAttributeType> _listProfileAttributeType, Profile profile)
        {
            ProfileAttribute profileAttribute;
            foreach (ProfileAttributeType proAttributeType in _listProfileAttributeType)
            {

                profileAttribute = new ProfileAttribute();
                profileAttribute.ProfileID = profile.ProfileID;
                profileAttribute.ProfileAttributeName = proAttributeType.Type;
                profileAttribute.ProfileAttributeTypeID = proAttributeType.ProfileAttributeTypeID;
                _profileAttributeService.SaveProfileAttribute(profileAttribute);
            }
        }
Esempio n. 2
0
        public void loadProfileAttribute(List<ProfileAttributeType> profileAttributeType, Profile profile)
        {
            #region MyRegion
            //foreach (ProfileAttributeType pt in profileAttributeType)
            //{
            //    ProfileAttributeControl ctr = new ProfileAttributeControl(profile, pt, _presenter._profileAttributeRepository);
            //    ProfileAttribute.Controls.Add(ctr);
            //}
            /* ProfileAttributeControlFull ctr = new ProfileAttributeControlFull(profile, profileAttributeType);
             ProfileAttribute.Controls.Add(ctr);*/
            //SPKTCore.Core.DataAccess.IProfileAttributeRepository _Repository = new SPKTCore.Core.DataAccess.Impl.ProfileAttributeRepository();
            // List<ProfileAttribute> listAttribute = new List<ProfileAttribute>();
            // listAttribute = _Repository.GetProfileAttributesByProfileID(profile.ProfileID);
            // if (listAttribute.Count != profileAttributeType.Count)
            // {
            //     _presenter.AddProfileAttribute(profileAttributeType, profile);
            // }
            // System.Web.UI.HtmlControls.HtmlGenericControl br = new System.Web.UI.HtmlControls.HtmlGenericControl("br");
            // ProfileAttribute.Controls.Add(br);
            // foreach (ProfileAttribute proAttribute in listAttribute)
            // {
            //     System.Web.UI.HtmlControls.HtmlGenericControl brTab = new System.Web.UI.HtmlControls.HtmlGenericControl("br");
            //     Label lbl = new Label();
            //     lbl.Width = 150;
            //     lbl.Height = 18;
            //     lbl.ForeColor = System.Drawing.Color.Blue;
            //     lbl.ID = "lbl" + proAttribute.ProfileAttributeID.ToString();
            //     lbl.Text = proAttribute.ProfileAttributeName;
            //     TextBox txt = new TextBox();
            //     txt.Width = 150;
            //     txt.Height = 18;
            //     lbl.ForeColor = System.Drawing.Color.CornflowerBlue;
            //     txt.ID = "txt" + proAttribute.ProfileAttributeID.ToString();
            //     txt.Text = proAttribute.Response;
            //     ProfileAttribute.Controls.Add(lbl);
            //     ProfileAttribute.Controls.Add(txt);
            //     ProfileAttribute.Controls.Add(brTab);
            #endregion

            System.Web.UI.HtmlControls.HtmlGenericControl br = new System.Web.UI.HtmlControls.HtmlGenericControl("br");
            divProfileAttribute.Controls.Add(br);
            foreach(ProfileAttributeType type in profileAttributeType)
            {
                System.Web.UI.HtmlControls.HtmlGenericControl brTab = new System.Web.UI.HtmlControls.HtmlGenericControl("br");
                Label lbl = new Label();
                lbl.Width = 150;
                lbl.Height = 15;
                lbl.ForeColor = System.Drawing.Color.Blue;
                lbl.ID = "lbl" + type.ProfileAttributeTypeID.ToString();
                lbl.Text = type.Type;
                TextBox txt = new TextBox();
                txt.Width = 150;
                txt.Height = 15;
                lbl.ForeColor = System.Drawing.Color.CornflowerBlue;
                ProfileAttribute attribute = _presenter.GetProfileAttributeByProfileIDAndType(profile,type);
                if(attribute==null)
                 {
                    attribute = new ProfileAttribute();
                    attribute.ProfileID = profile.ProfileID;
                    attribute.ProfileAttributeName = type.Type;
                    attribute.ProfileAttributeTypeID = type.ProfileAttributeTypeID;
                    _presenter.SaveAttribute(attribute);
                 };
                divProfileAttribute.Controls.Add(lbl);
                divProfileAttribute.Controls.Add(txt);
                divProfileAttribute.Controls.Add(brTab);
                txt.ID = "txt" + attribute.ProfileAttributeID.ToString();
                txt.Text = attribute.Response;
            }
        }
Esempio n. 3
0
 partial void DeleteProfileAttribute(ProfileAttribute instance);
Esempio n. 4
0
 partial void UpdateProfileAttribute(ProfileAttribute instance);
Esempio n. 5
0
 partial void InsertProfileAttribute(ProfileAttribute instance);
Esempio n. 6
0
		private void detach_ProfileAttributes(ProfileAttribute entity)
		{
			this.SendPropertyChanging();
			entity.ProfileAttributeType = null;
		}
Esempio n. 7
0
		private void attach_ProfileAttributes(ProfileAttribute entity)
		{
			this.SendPropertyChanging();
			entity.Profile = this;
		}
Esempio n. 8
0
 public void SaveProfileAttribute(ProfileAttribute attribute)
 {
     using (SPKTDataContext spktDC = conn.GetContext())
     {
         if (attribute.ProfileAttributeID > 0)
         {
             spktDC.ProfileAttributes.Attach(attribute, true);
         }
         else
         {
             attribute.CreateDate = DateTime.Now;
             spktDC.ProfileAttributes.InsertOnSubmit(attribute);
         }
         spktDC.SubmitChanges();
     }
 }
Esempio n. 9
0
 public void SaveAttribute(ProfileAttribute attribute)
 {
     _profileAttributeService.SaveProfileAttribute(attribute);
 }
Esempio n. 10
0
        public void loadProfileAttribute(List<ProfileAttributeType> profileAttributeType,List<VisibilityLevel> ListVisibilityLevel,List<PrivacyFlag> PrivacyFlags, Profile profile)
        {
            #region MyRegion
            //foreach (ProfileAttributeType pt in profileAttributeType)
            //{
            //    ProfileAttributeControl ctr = new ProfileAttributeControl(profile, pt, _presenter._profileAttributeRepository);
            //    ProfileAttribute.Controls.Add(ctr);
            //}
            /* ProfileAttributeControlFull ctr = new ProfileAttributeControlFull(profile, profileAttributeType);
             ProfileAttribute.Controls.Add(ctr);*/
            //SPKTCore.Core.DataAccess.IProfileAttributeRepository _Repository = new SPKTCore.Core.DataAccess.Impl.ProfileAttributeRepository();
            // List<ProfileAttribute> listAttribute = new List<ProfileAttribute>();
            // listAttribute = _Repository.GetProfileAttributesByProfileID(profile.ProfileID);
            // if (listAttribute.Count != profileAttributeType.Count)
            // {
            //     _presenter.AddProfileAttribute(profileAttributeType, profile);
            // }
            // System.Web.UI.HtmlControls.HtmlGenericControl br = new System.Web.UI.HtmlControls.HtmlGenericControl("br");
            // ProfileAttribute.Controls.Add(br);
            // foreach (ProfileAttribute proAttribute in listAttribute)
            // {
            //     System.Web.UI.HtmlControls.HtmlGenericControl brTab = new System.Web.UI.HtmlControls.HtmlGenericControl("br");
            //     Label lbl = new Label();
            //     lbl.Width = 150;
            //     lbl.Height = 18;
            //     lbl.ForeColor = System.Drawing.Color.Blue;
            //     lbl.ID = "lbl" + proAttribute.ProfileAttributeID.ToString();
            //     lbl.Text = proAttribute.ProfileAttributeName;
            //     TextBox txt = new TextBox();
            //     txt.Width = 150;
            //     txt.Height = 18;
            //     lbl.ForeColor = System.Drawing.Color.CornflowerBlue;
            //     txt.ID = "txt" + proAttribute.ProfileAttributeID.ToString();
            //     txt.Text = proAttribute.Response;
            //     ProfileAttribute.Controls.Add(lbl);
            //     ProfileAttribute.Controls.Add(txt);
            //     ProfileAttribute.Controls.Add(brTab);
            #endregion

            System.Web.UI.HtmlControls.HtmlGenericControl br = new System.Web.UI.HtmlControls.HtmlGenericControl("br");
            divProfileAttribute.Controls.Add(br);
            foreach(ProfileAttributeType type in profileAttributeType)
            {
                System.Web.UI.HtmlControls.HtmlGenericControl brTab = new System.Web.UI.HtmlControls.HtmlGenericControl("br");
                Label lbl = new Label();
                lbl.Width = 150;
                lbl.ForeColor = System.Drawing.Color.Blue;
                lbl.ID = "lbl" + type.ProfileAttributeTypeID.ToString();
                lbl.Text = type.Type;
                TextBox txt = new TextBox();
                txt.Width = 150;
                lbl.ForeColor = System.Drawing.Color.CornflowerBlue;
                DropDownList ddlVisibility = new DropDownList();
                ddlVisibility.ID = "ddlVisibility" + type.PrivacyFlagTypeID.ToString();
                foreach (VisibilityLevel level in ListVisibilityLevel)
                {
                    ListItem li = new ListItem(level.Name, level.VisibilityLevelID.ToString());
                    if (!IsPostBack)
                        li.Selected = _presenter.IsFlagSelected((int)type.PrivacyFlagTypeID, level.VisibilityLevelID, PrivacyFlags);
                    ddlVisibility.Items.Add(li);
                }
                ProfileAttribute attribute = _presenter.GetProfileAttributeByProfileIDAndType(profile,type);
                if(attribute==null)
                 {
                    attribute = new ProfileAttribute();
                    attribute.ProfileID = profile.ProfileID;
                    attribute.ProfileAttributeName = type.Type;
                    attribute.ProfileAttributeTypeID = type.ProfileAttributeTypeID;
                    _presenter.SaveAttribute(attribute);
                 };
                divProfileAttribute.Controls.Add(lbl);
                divProfileAttribute.Controls.Add(txt);
                divProfileAttribute.Controls.Add(ddlVisibility);
                divProfileAttribute.Controls.Add(brTab);
                txt.ID = "txt" + attribute.ProfileAttributeID.ToString();
                txt.Text = attribute.Response;
            }
        }
Esempio n. 11
0
 public void SaveProfileAttribute(ProfileAttribute profileAttribute)
 {
     _profileAttributeRepository.SaveProfileAttribute(profileAttribute);
 }