Added code to change the xml that is added to the config column of the procedure content record when creating a new procedure in a multi-unit working draft.

This commit is contained in:
Rich 2014-09-03 02:14:52 +00:00
parent 080b1098bc
commit 48ecbdea36

View File

@ -47,7 +47,20 @@ namespace VEPROMS.CSLA.Library
{
_Procedure = procedure;
string xml = procedure.MyContent.Config;
if (xml == string.Empty) xml = "<Config/>";
if (xml == string.Empty)
{
if (_Procedure.MyProcedureInfo.MyDocVersion.MultiUnitCount > 1)
{
xml = "<Config><Slaves>";
for (int i = 1; i <= _Procedure.MyProcedureInfo.MyDocVersion.MultiUnitCount; i++)
{
xml = xml + "<Slave index='" + i.ToString() + "'/>";
}
xml = xml + "</Slaves></Config>";
}
else
xml = "<Config/>";
}
_Xp = new XMLProperties(xml);
if (procedure.MyProcedureInfo.ActiveParent != null) _Xp.LookInAncestor += new XMLPropertiesEvent(Xp_LookInAncestorFolder);
}
@ -96,7 +109,20 @@ namespace VEPROMS.CSLA.Library
{
_ProcedureInfo = procedureInfo;
string xml = procedureInfo.MyContent.Config;
if (xml == string.Empty) xml = "<Config/>";
if (xml == string.Empty)
{
if (_ProcedureInfo.MyDocVersion.MultiUnitCount > 0)
{
xml = "<Config><Slaves>";
for (int i = 1; i <= _ProcedureInfo.MyDocVersion.MultiUnitCount; i++)
{
xml = xml + "<Slave index='" + i.ToString() + "'/>";
}
xml = xml + "</Slaves></Config>";
}
else
xml = "<Config/>";
}
_Xp = new XMLProperties(xml);
_Xp.AncestorLookup = true;
if (procedureInfo.ActiveParent != null) _Xp.LookInAncestor += new XMLPropertiesEvent(Xp_LookInAncestorFolder);