Exemple #1
0
 /// <summary>
 /// Get data from DNN profile
 /// </summary>
 /// <param name="userId"></param>
 private void PopulateData(String userId)
 {
     Exists = false;
     _uData = new UserData(userId);
     //Get DNN profile
     if (_uData.Exists)
     {
         var newDefault = GetProfile();
         var prop       = DnnUtils.GetUserProfileProperties(_uData.Info.UserId.ToString(""));
         foreach (var p in prop)
         {
             newDefault.SetXmlProperty("genxml/textbox/" + p.Key.ToLower(), p.Value);
         }
         // get email
         newDefault.SetXmlProperty("genxml/textbox/email", _uData.GetEmail());
         Save(newDefault.XMLData);
     }
 }
Exemple #2
0
        /// <summary>
        /// Save Data to DNN profile
        /// </summary>
        /// <param name="profile"></param>
        private void UpdateDnnProfile(NBrightInfo profile)
        {
            var flag  = false;
            var prop1 = DnnUtils.GetUserProfileProperties(_uData.Info.UserId.ToString(""));
            var prop2 = DnnUtils.GetUserProfileProperties(_uData.Info.UserId.ToString(""));

            foreach (var p in prop1)
            {
                var n = profile.XMLDoc.SelectSingleNode("genxml/textbox/" + p.Key.ToLower());
                if (n != null)
                {
                    prop2[p.Key] = n.InnerText;
                    flag         = true;
                }
                n = profile.XMLDoc.SelectSingleNode("genxml/dropdownlist/" + p.Key.ToLower());
                if (n != null)
                {
                    prop2[p.Key] = n.InnerText;
                    flag         = true;
                }
                n = profile.XMLDoc.SelectSingleNode("genxml/radiobuttonlist/" + p.Key.ToLower());
                if (n != null)
                {
                    prop2[p.Key] = n.InnerText;
                    flag         = true;
                }
            }
            if (flag)
            {
                DnnUtils.SetUserProfileProperties(_uData.Info.UserId.ToString(""), prop2);
            }

            // update email
            var email = profile.GetXmlProperty("genxml/textbox/email");

            if (email != "" && email != _uData.GetEmail())
            {
                _uData.UpdateEmail(email);
            }
        }
Exemple #3
0
 /// <summary>
 /// Get data from DNN profile
 /// </summary>
 /// <param name="userId"></param>
 private void PopulateData(String userId)
 {
     Exists = false;
     _uData = new UserData(userId);
     //Get DNN profile
     if (_uData.Exists)
     {
         var newDefault = GetProfile();
         var prop = DnnUtils.GetUserProfileProperties(_uData.Info.UserId.ToString(""));
         foreach (var p in prop)
         {
             newDefault.SetXmlProperty("genxml/textbox/" + p.Key.ToLower(), p.Value);
         }
         // get email
         newDefault.SetXmlProperty("genxml/textbox/email", _uData.GetEmail());
         Save(newDefault.XMLData);
     }
 }