Removed Debug Print

Moved code to add sections to Procedure parts
Moved code to add steps to Section parts
Moved code to add steps to Step parts
Changed Debug Print
Fixed a Format Flag conversion DontBreakOptEquipmentList
Changed GetItemFont so that parent items would not be left in the cache
Changed AddIncludedStepNumber to allow for ranges to sub levels.
Added a array reference to StepDataList by index.
This commit is contained in:
Rich
2010-06-17 18:42:06 +00:00
parent 332e35c484
commit 5af2c31559
9 changed files with 108 additions and 44 deletions

View File

@@ -303,7 +303,7 @@ namespace DataLoader
}
return menustr;
}
private Item MigrateSection(Item procitem, string procnum, OleDbConnection cn, DataRowView dr, DataTable dt, Item FromItem, bool isSubSection, string pth, DocVersion docver, FormatInfo activeFormat)
private Item MigrateSection(Item procitem, string procnum, OleDbConnection cn, DataRowView dr, DataTable dt, Item FromItem, bool isSubSection, string pth, DocVersion docver, FormatInfo activeFormat,Content cont)
{
Int32 thesectid = 0;
bool isautogen = false;
@@ -467,6 +467,14 @@ namespace DataLoader
Item secitem = AddSection(procitem, num, title, stype, dts, init, ci, step + sequence, fmt, libDocid, pth, FromItem, sectFormat);
if (secitem == null)
throw (new Exception("Null parameter in AddSection"));
if (cont != null)
{
// ContentsParts.Add can use 'fromtype', item - fromtype here = 2, section
cont.ContentParts.Add(2, secitem);
if (cont.MyZContent.OldStepSequence == null || cont.MyZContent.OldStepSequence == "") cont.MyZContent.OldStepSequence = ProcNumber;
if (!cont.IsSavable) ErrorRpt.ErrorReport(cont);
cont.Save();
}
thesectid = secitem.ItemID;
// if the editsectid hasn't been set yet, set it to this section id, i.e. the first
@@ -500,16 +508,18 @@ namespace DataLoader
Item FrItem = null;
frmMain.pbStepMaximum = dt.Rows.Count;
frmMain.pbStepValue = 0;
int type = 6;
foreach (DataRowView drv in dv)
{
FrItem = MigrateStep(cn, dt, drv, FrItem, conv_caret, pth, docver,sectFormat);
if (secitem.MyContent.ContentParts.Count == 0)
{
// type 6 is step
secitem.MyContent.ContentParts.Add(6, FrItem);
if (!secitem.MyContent.IsSavable) ErrorRpt.ErrorReport(secitem.MyContent);
secitem.MyContent.Save();
}
FrItem = MigrateStep(cn, dt, drv, FrItem, conv_caret, pth, docver, sectFormat, secitem, type);
type = 0; // Only add ContentPart for first child
//if (secitem.MyContent.ContentParts.Count == 0)
//{
// // type 6 is step
// secitem.MyContent.ContentParts.Add(6, FrItem);
// if (!secitem.MyContent.IsSavable) ErrorRpt.ErrorReport(secitem.MyContent);
// secitem.MyContent.Save();
//}
}
}
return secitem;