Strip Enhanced data when importing an Enhanced procedure. The enhanced data will not properly align, so it should be removed.

This commit is contained in:
Rich 2016-05-10 17:57:26 +00:00
parent 09b87d183e
commit 81661c1fb9

View File

@ -2697,6 +2697,7 @@ namespace VEPROMS
int versiontype = int.Parse(xe.Attributes.GetNamedItem("versiontype").InnerText); int versiontype = int.Parse(xe.Attributes.GetNamedItem("versiontype").InnerText);
string name = xe.Attributes.GetNamedItem("name").InnerText; string name = xe.Attributes.GetNamedItem("name").InnerText;
string config = xe.Attributes.GetNamedItem("config").InnerText; string config = xe.Attributes.GetNamedItem("config").InnerText;
config = StripEnhanced(config);
string userid = xe.Attributes.GetNamedItem("userid").InnerText; string userid = xe.Attributes.GetNamedItem("userid").InnerText;
DateTime dts = DateTime.Parse(xe.Attributes.GetNamedItem("dts").InnerText); DateTime dts = DateTime.Parse(xe.Attributes.GetNamedItem("dts").InnerText);
string formatid = xe.Attributes.GetNamedItem("formatid").InnerText; string formatid = xe.Attributes.GetNamedItem("formatid").InnerText;
@ -2869,6 +2870,7 @@ namespace VEPROMS
int proctype = int.Parse(xc.Attributes.GetNamedItem("type").InnerText); int proctype = int.Parse(xc.Attributes.GetNamedItem("type").InnerText);
string formatid = xc.Attributes.GetNamedItem("formatid").InnerText; string formatid = xc.Attributes.GetNamedItem("formatid").InnerText;
string config = xc.Attributes.GetNamedItem("config").InnerText; string config = xc.Attributes.GetNamedItem("config").InnerText;
config = StripEnhanced(config);
string userid = xc.Attributes.GetNamedItem("userid").InnerText; string userid = xc.Attributes.GetNamedItem("userid").InnerText;
DateTime dts = DateTime.Parse(xc.Attributes.GetNamedItem("dts").InnerText); DateTime dts = DateTime.Parse(xc.Attributes.GetNamedItem("dts").InnerText);
Procedure p = Procedure.MakeProcedure(dvInfo, procInfo, number, text, proctype); Procedure p = Procedure.MakeProcedure(dvInfo, procInfo, number, text, proctype);
@ -3072,7 +3074,8 @@ namespace VEPROMS
int steptype = int.Parse(xc.Attributes.GetNamedItem("type").InnerText); int steptype = int.Parse(xc.Attributes.GetNamedItem("type").InnerText);
string formatid = xc.Attributes.GetNamedItem("formatid").InnerText; string formatid = xc.Attributes.GetNamedItem("formatid").InnerText;
string config = xc.Attributes.GetNamedItem("config").InnerText; string config = xc.Attributes.GetNamedItem("config").InnerText;
int contentid = int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText); config = StripEnhanced(config);
int contentid = int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText);
CheckForFloatingFoldout(contentid, config); CheckForFloatingFoldout(contentid, config);
string userid = xc.Attributes.GetNamedItem("userid").InnerText; string userid = xc.Attributes.GetNamedItem("userid").InnerText;
DateTime dts = DateTime.Parse(xc.Attributes.GetNamedItem("dts").InnerText); DateTime dts = DateTime.Parse(xc.Attributes.GetNamedItem("dts").InnerText);
@ -3160,7 +3163,8 @@ namespace VEPROMS
int steptype = int.Parse(xc.Attributes.GetNamedItem("type").InnerText); int steptype = int.Parse(xc.Attributes.GetNamedItem("type").InnerText);
string formatid = xc.Attributes.GetNamedItem("formatid").InnerText; string formatid = xc.Attributes.GetNamedItem("formatid").InnerText;
string config = xc.Attributes.GetNamedItem("config").InnerText; string config = xc.Attributes.GetNamedItem("config").InnerText;
int contentid = int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText); config = StripEnhanced(config);
int contentid = int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText);
CheckForFloatingFoldout(contentid, config); CheckForFloatingFoldout(contentid, config);
string userid = xc.Attributes.GetNamedItem("userid").InnerText; string userid = xc.Attributes.GetNamedItem("userid").InnerText;
DateTime dts = DateTime.Parse(xc.Attributes.GetNamedItem("dts").InnerText); DateTime dts = DateTime.Parse(xc.Attributes.GetNamedItem("dts").InnerText);
@ -3247,7 +3251,8 @@ namespace VEPROMS
int steptype = int.Parse(xc.Attributes.GetNamedItem("type").InnerText); int steptype = int.Parse(xc.Attributes.GetNamedItem("type").InnerText);
string formatid = xc.Attributes.GetNamedItem("formatid").InnerText; string formatid = xc.Attributes.GetNamedItem("formatid").InnerText;
string config = xc.Attributes.GetNamedItem("config").InnerText; string config = xc.Attributes.GetNamedItem("config").InnerText;
int contentid = int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText); config = StripEnhanced(config);
int contentid = int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText);
CheckForFloatingFoldout(contentid, config); CheckForFloatingFoldout(contentid, config);
string userid = xc.Attributes.GetNamedItem("userid").InnerText; string userid = xc.Attributes.GetNamedItem("userid").InnerText;
DateTime dts = DateTime.Parse(xc.Attributes.GetNamedItem("dts").InnerText); DateTime dts = DateTime.Parse(xc.Attributes.GetNamedItem("dts").InnerText);
@ -3334,7 +3339,8 @@ namespace VEPROMS
int steptype = int.Parse(xc.Attributes.GetNamedItem("type").InnerText); int steptype = int.Parse(xc.Attributes.GetNamedItem("type").InnerText);
string formatid = xc.Attributes.GetNamedItem("formatid").InnerText; string formatid = xc.Attributes.GetNamedItem("formatid").InnerText;
string config = xc.Attributes.GetNamedItem("config").InnerText; string config = xc.Attributes.GetNamedItem("config").InnerText;
int contentid = int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText); config = StripEnhanced(config);
int contentid = int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText);
CheckForFloatingFoldout(contentid, config); CheckForFloatingFoldout(contentid, config);
string userid = xc.Attributes.GetNamedItem("userid").InnerText; string userid = xc.Attributes.GetNamedItem("userid").InnerText;
DateTime dts = DateTime.Parse(xc.Attributes.GetNamedItem("dts").InnerText); DateTime dts = DateTime.Parse(xc.Attributes.GetNamedItem("dts").InnerText);
@ -3421,7 +3427,8 @@ namespace VEPROMS
int steptype = int.Parse(xc.Attributes.GetNamedItem("type").InnerText); int steptype = int.Parse(xc.Attributes.GetNamedItem("type").InnerText);
string formatid = xc.Attributes.GetNamedItem("formatid").InnerText; string formatid = xc.Attributes.GetNamedItem("formatid").InnerText;
string config = xc.Attributes.GetNamedItem("config").InnerText; string config = xc.Attributes.GetNamedItem("config").InnerText;
int contentid = int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText); config = StripEnhanced(config);
int contentid = int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText);
CheckForFloatingFoldout(contentid, config); CheckForFloatingFoldout(contentid, config);
string userid = xc.Attributes.GetNamedItem("userid").InnerText; string userid = xc.Attributes.GetNamedItem("userid").InnerText;
DateTime dts = DateTime.Parse(xc.Attributes.GetNamedItem("dts").InnerText); DateTime dts = DateTime.Parse(xc.Attributes.GetNamedItem("dts").InnerText);
@ -3514,6 +3521,7 @@ namespace VEPROMS
int sectiontype = int.Parse(xc.Attributes.GetNamedItem("type").InnerText); int sectiontype = int.Parse(xc.Attributes.GetNamedItem("type").InnerText);
string formatid = xc.Attributes.GetNamedItem("formatid").InnerText; string formatid = xc.Attributes.GetNamedItem("formatid").InnerText;
string config = xc.Attributes.GetNamedItem("config").InnerText; string config = xc.Attributes.GetNamedItem("config").InnerText;
config = StripEnhanced(config);
int contentid = int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText); int contentid = int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText);
CheckForFloatingFoldout(contentid, config); CheckForFloatingFoldout(contentid, config);
string userid = xc.Attributes.GetNamedItem("userid").InnerText; string userid = xc.Attributes.GetNamedItem("userid").InnerText;
@ -3547,7 +3555,19 @@ namespace VEPROMS
AddParts(xc, prevInfo); AddParts(xc, prevInfo);
return prevInfo; return prevInfo;
} }
private string StripEnhanced(string config)
{
if (config.Length > 0)
{
XmlDocument xd = new XmlDocument();
xd.LoadXml(config);
XmlNodeList nl = xd.DocumentElement.SelectNodes("//Enhanced");
foreach (XmlNode nd in nl)
nd.ParentNode.RemoveChild(nd);
return xd.OuterXml;
}
return config;
}
private void CheckForFloatingFoldout(int contentid, string config) private void CheckForFloatingFoldout(int contentid, string config)
{ {
if (config != string.Empty) if (config != string.Empty)