/// <summary> /// Save to USERDATA and DNN profile /// </summary> private void Save(String profileXml, Boolean debugMode = false) { if (_uData.Exists) { //save cart var strXml = "<profile>"; strXml += profileXml; strXml += "</profile>"; _uData.Info.RemoveXmlNode("genxml/profile"); _uData.Info.AddXmlNode(strXml, "profile", "genxml"); _uData.Save(debugMode); var pInfo = GetProfile(); UpdateDnnProfile(pInfo); Exists = true; } }
/// <summary> /// Save cart /// </summary> private void Save(Boolean debugMode = false) { if (UserData.Exists) { //save cart var strXML = "<address>"; var lp = 0; var defAddr = GetDefaultAddress(); var defIdex = -1; if (defAddr != null) { defIdex = defAddr.GetXmlPropertyInt("genxml/hidden/index"); } foreach (var info in _addressList) { if (lp == defIdex || defIdex == -1) { defIdex = lp; info.SetXmlProperty("genxml/hidden/default", "True"); } else { info.SetXmlProperty("genxml/hidden/default", "False"); } info.SetXmlProperty("genxml/hidden/index", lp.ToString("")); strXML += info.XMLData; lp += 1; } strXML += "</address>"; UserData.Info.RemoveXmlNode("genxml/address"); UserData.Info.AddXmlNode(strXML, "address", "genxml"); UserData.Save(debugMode); Exists = true; } }