Example #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);
     }
 }
Example #2
0
 private void PopulateData(String userId)
 {
     Exists = false;
     UserData = new UserData(userId);
     _addressList = GetAddressList();
     //if we have no address create a default one from DNN profile
     if (_addressList.Count == 0 && UserData.Exists)
     {
         var newDefault = new NBrightInfo(true);
         newDefault.SetXmlProperty("genxml/hidden/default", "True");
         newDefault.SetXmlProperty("genxml/hidden/index", _addressList.Count.ToString(""));
         var prop = DnnUtils.GetUserProfileProperties(UserData.Info.UserId.ToString(""));
         foreach (var p in prop)
         {
             newDefault.SetXmlProperty("genxml/textbox/" + p.Key.ToLower(), p.Value);
         }
         _addressList.Add(newDefault);
         Save();
     }
     else
     {
         UpdateDefaultProfileAddress(); //alway update default address to profile, to keep it in-line.
     }
 }