This commit is contained in:
parent
f75c68d4a5
commit
b07dc77100
@ -210,51 +210,51 @@ namespace DataLoader
|
||||
Item parentitem = itm;
|
||||
//if (ProcNumber == "001-002")
|
||||
// Console.WriteLine("proc 001-002");
|
||||
foreach (DataRowView drw in dv)
|
||||
{
|
||||
//if (ProcNumber == "016-001") //"017-001") //"082-002AB")
|
||||
// Console.WriteLine("016-001"); //("017-001"); //"082-002AB");
|
||||
SectItm = MigrateSection(parentitem, ProcNumber, cn, drw, ds.Tables["Steps"], SectItm, dicSecCount.Count > 0 ? true : false, pth, docver, activeFormat);
|
||||
// if no children, add first child (cont)
|
||||
if (addpart)
|
||||
foreach (DataRowView drw in dv)
|
||||
{
|
||||
// ContentsParts.Add can use 'fromtype', item - fromtype here = 2, section
|
||||
cont.ContentParts.Add(2, SectItm);
|
||||
if (cont.MyZContent.OldStepSequence == null || cont.MyZContent.OldStepSequence == "") cont.MyZContent.OldStepSequence = ProcNumber;
|
||||
if (!cont.IsSavable) ErrorRpt.ErrorReport(cont);
|
||||
cont.Save();
|
||||
addpart = false;
|
||||
//if (ProcNumber == "016-001") //"017-001") //"082-002AB")
|
||||
// Console.WriteLine("016-001"); //("017-001"); //"082-002AB");
|
||||
SectItm = MigrateSection(parentitem, ProcNumber, cn, drw, ds.Tables["Steps"], SectItm, dicSecCount.Count > 0 ? true : false, pth, docver, activeFormat);
|
||||
// if no children, add first child (cont)
|
||||
if (addpart)
|
||||
{
|
||||
// ContentsParts.Add can use 'fromtype', item - fromtype here = 2, section
|
||||
cont.ContentParts.Add(2, SectItm);
|
||||
if (cont.MyZContent.OldStepSequence == null || cont.MyZContent.OldStepSequence == "") cont.MyZContent.OldStepSequence = ProcNumber;
|
||||
if (!cont.IsSavable) ErrorRpt.ErrorReport(cont);
|
||||
cont.Save();
|
||||
addpart = false;
|
||||
}
|
||||
//FrType = 0;
|
||||
dicSecParentItem[level] = SectItm;
|
||||
if (level > 0)
|
||||
{
|
||||
if ((dicSecCount[level]) == 1)
|
||||
// shift up a level, i.e. give me the parent for the previous level
|
||||
SectItm = dicSecParentItem[--level];
|
||||
else
|
||||
dicSecCount[level]--; // decrements number of sections to process
|
||||
}
|
||||
// get number of subsections for this section
|
||||
int subSecs = drw["Sequence"].ToString().PadRight(12, ' ')[5] - 48;
|
||||
if (subSecs > 0)
|
||||
{
|
||||
dicSecCount[++level] = subSecs;
|
||||
cont = SectItm.MyContent;
|
||||
parentitem = SectItm;
|
||||
addpart = true;
|
||||
SectItm = null; // no previous sibling for the first child node.
|
||||
}
|
||||
}
|
||||
//FrType = 0;
|
||||
dicSecParentItem[level] = SectItm;
|
||||
if (level > 0)
|
||||
// need section start
|
||||
if (EditSectId != 0)
|
||||
{
|
||||
if ((dicSecCount[level]) == 1)
|
||||
// shift up a level, i.e. give me the parent for the previous level
|
||||
SectItm = dicSecParentItem[--level];
|
||||
else
|
||||
dicSecCount[level]--; // decrements number of sections to process
|
||||
if (ci == null) ci = new ConfigInfo(null);
|
||||
ci.AddItem("Procedure", "SectionStart", string.Format("{0}", EditSectId));
|
||||
itm.MyContent.Config = (ci == null) ? null : ci.ToString();
|
||||
if (!itm.IsSavable) ErrorRpt.ErrorReport(itm);
|
||||
itm.Save();
|
||||
}
|
||||
// get number of subsections for this section
|
||||
int subSecs = drw["Sequence"].ToString().PadRight(12, ' ')[5] - 48;
|
||||
if (subSecs > 0)
|
||||
{
|
||||
dicSecCount[++level] = subSecs;
|
||||
cont = SectItm.MyContent;
|
||||
parentitem = SectItm;
|
||||
addpart = true;
|
||||
SectItm = null; // no previous sibling for the first child node.
|
||||
}
|
||||
}
|
||||
// need section start
|
||||
if (EditSectId != 0)
|
||||
{
|
||||
if (ci == null) ci = new ConfigInfo(null);
|
||||
ci.AddItem("Procedure", "SectionStart", string.Format("{0}", EditSectId));
|
||||
itm.MyContent.Config = (ci == null) ? null : ci.ToString();
|
||||
if (!itm.IsSavable) ErrorRpt.ErrorReport(itm);
|
||||
itm.Save();
|
||||
}
|
||||
}
|
||||
ds.Dispose();
|
||||
return itm;
|
||||
|
Loading…
x
Reference in New Issue
Block a user