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:
@@ -257,7 +257,7 @@ namespace DataLoader
|
||||
|
||||
private static string GetPartial(string path)
|
||||
{
|
||||
Console.WriteLine(string.Format("GetPartial path = {0}",path));
|
||||
//Console.WriteLine(string.Format("GetPartial path = {0}",path));
|
||||
if (path.Contains("\\"))
|
||||
{
|
||||
string[] parts = path.Split("\\".ToCharArray());
|
||||
|
@@ -214,17 +214,18 @@ namespace DataLoader
|
||||
{
|
||||
//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);
|
||||
SectItm = MigrateSection(parentitem, ProcNumber, cn, drw, ds.Tables["Steps"], SectItm, dicSecCount.Count > 0 ? true : false, pth, docver, activeFormat,addpart ? cont :null);
|
||||
addpart = false;
|
||||
// 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;
|
||||
}
|
||||
//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)
|
||||
|
@@ -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;
|
||||
|
@@ -17,7 +17,7 @@ namespace DataLoader
|
||||
{
|
||||
public partial class Loader
|
||||
{
|
||||
private Item AddStep(OleDbConnection cn, string StepType, string Textm, string Recid, string stpseq, string structtype, Item FromItem, DateTime dts, string userid, bool conv_caret, string pth, DocVersion docver, FormatInfo fmt)
|
||||
private Item AddStep(OleDbConnection cn, string StepType, string Textm, string Recid, string stpseq, string structtype, Item FromItem, DateTime dts, string userid, bool conv_caret, string pth, DocVersion docver, FormatInfo fmt,Item parentItem, int frType)
|
||||
{
|
||||
//if (ProcNumber + "|" + stpseq == "082-002CD|A=S")
|
||||
// Console.WriteLine("here");
|
||||
@@ -133,6 +133,13 @@ namespace DataLoader
|
||||
else
|
||||
item = Item.MakeItem(FromItem, content, content.DTS, content.UserID);
|
||||
|
||||
if (frType > 0)
|
||||
{
|
||||
parentItem.MyContent.ContentParts.Add(frType, item);
|
||||
if (!parentItem.MyContent.IsSavable) ErrorRpt.ErrorReport(parentItem.MyContent);
|
||||
parentItem.MyContent.Save();
|
||||
}
|
||||
|
||||
// Remove styles that user entered but are automatically done via the format
|
||||
string tstr = null;
|
||||
using (ItemInfo myInfo = item.MyItemInfo) // do this so that ItemInfo doesn't stay in cashe
|
||||
@@ -336,7 +343,7 @@ namespace DataLoader
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
private Item MigrateStep(OleDbConnection cn, DataTable dt, DataRowView drv, Item FromItem, bool conv_caret, string pth, DocVersion docver, FormatInfo fmt)
|
||||
private Item MigrateStep(OleDbConnection cn, DataTable dt, DataRowView drv, Item FromItem, bool conv_caret, string pth, DocVersion docver, FormatInfo fmt, Item parentItem, int frTypeParam)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -344,7 +351,8 @@ namespace DataLoader
|
||||
Item item = AddStep(cn, drv["Type"].ToString()
|
||||
, (drv["textm"] == DBNull.Value ? drv["Text"].ToString() : drv["Textm"].ToString())
|
||||
, drv["Recid"].ToString(), drv["CStep"].ToString() + drv["CSequence"].ToString(), "S", FromItem // was str
|
||||
, GetDTS(drv["Date"].ToString(), drv["Time"].ToString()), drv["Initials"].ToString(), conv_caret, pth, docver, fmt);
|
||||
, GetDTS(drv["Date"].ToString(), drv["Time"].ToString()), drv["Initials"].ToString(), conv_caret, pth, docver, fmt, parentItem, frTypeParam);
|
||||
|
||||
//Content cont = Content.MakeContent(null,(drv["textm"] == DBNull.Value ? drv["Text"].ToString() : drv["Textm"].ToString()),drv["Type"]+20000,null,null,
|
||||
// GetDTS(drv["Date"].ToString(), drv["Time"].ToString()), drv["Initials"].ToString());
|
||||
//Item item = Item.MakeItem(FromItem, cont, cont.DTS, cont.UserID);
|
||||
@@ -397,14 +405,14 @@ namespace DataLoader
|
||||
, (drvs["textm"] == DBNull.Value ? drvs["Text"].ToString() : drvs["Textm"].ToString())
|
||||
, drv["Recid"].ToString(), drvs["CStep"].ToString() + drvs["CSequence"].ToString()
|
||||
, GetStructType(drvs["sequence"].ToString()), FrItem
|
||||
, GetDTS(drvs["Date"].ToString(), drvs["Time"].ToString()), drvs["Initials"].ToString(), conv_caret, pth, docver, fmt);
|
||||
, GetDTS(drvs["Date"].ToString(), drvs["Time"].ToString()), drvs["Initials"].ToString(), conv_caret, pth, docver, fmt, itemp, FrType);
|
||||
|
||||
if (FrType > 0 )
|
||||
{
|
||||
itemp.MyContent.ContentParts.Add(FrType, itemc);
|
||||
if (!itemp.MyContent.IsSavable) ErrorRpt.ErrorReport(itemp.MyContent);
|
||||
itemp.MyContent.Save();
|
||||
}
|
||||
//if (FrType > 0 )
|
||||
//{
|
||||
// itemp.MyContent.ContentParts.Add(FrType, itemc);
|
||||
// if (!itemp.MyContent.IsSavable) ErrorRpt.ErrorReport(itemp.MyContent);
|
||||
// itemp.MyContent.Save();
|
||||
//}
|
||||
dicStr[sType] = itemc;
|
||||
dicStruct[drvs["CSequence"].ToString()] = new Dictionary<string, Item>();
|
||||
dicStep[drvs["CSequence"].ToString()] = itemc;
|
||||
|
@@ -179,7 +179,7 @@ namespace DataLoader
|
||||
//if the dash is preceeded byte a token remove the space following the token
|
||||
#if DEBUG
|
||||
if (s2.Contains(@"\super "))
|
||||
Console.WriteLine("Here");
|
||||
Console.WriteLine("RTF Super token");
|
||||
#endif
|
||||
s2 = Regex.Replace(s2, @"(\\[^ \\?]*) \-", @"$1\u8209?");
|
||||
s2 = s2.Replace("-", @"\u8209?");
|
||||
|
Reference in New Issue
Block a user