C2015-022 Separate Windows Upgrade – moved RemoveEnhancedFromConfig from AuditExt.cs

C2015-022 Separate Windows Upgrade – new call to RemoveEnhancedFromConfig
C2015-022 Separate Windows Upgrade – needed to check ProcessID instead of SessionID
This commit is contained in:
2018-03-12 14:34:01 +00:00
parent f87f541a16
commit 60e9131698
3 changed files with 46 additions and 5 deletions

View File

@@ -1405,6 +1405,46 @@ namespace VEPROMS.CSLA.Library
}
return level;
}
// B2017-070 - when retoring a step that once had enhanced links, remove the link info for the notes and cautions as well
public void RemoveEnhancedFromConfig()
{
RemoveEnhancedFromConfig(false);
}
public void RemoveEnhancedFromConfig(bool doOneStepOnly)
{
XmlDocument xd = new XmlDocument();
if (this.MyContent.Config == null || this.MyContent.Config == "") return; // B2017-164 & B2017-172 check for null or empty config
xd.LoadXml(this.MyContent.Config);
XmlNode xn = xd.DocumentElement.SelectSingleNode("Enhanced");
if (xn != null)
{
xn.ParentNode.RemoveChild(xn);
string config = xd.OuterXml;
using (Content ctmp = this.MyContent.Get())
{
ctmp.Config = config;
ctmp.Save();
ContentInfo.Refresh(ctmp);
_MyConfig = null; // refresh the memory value
}
}
if (doOneStepOnly) return;
if (this.IsHigh)
{
if (this.Cautions != null)
foreach (ItemInfo chld in this.Cautions)
{
chld.RemoveEnhancedFromConfig(false);
}
if (this.Notes != null)
foreach (ItemInfo chld in this.Notes)
{
chld.RemoveEnhancedFromConfig(false);
}
}
}
#endregion
public bool HasHeader
{