This commit is contained in:
@@ -176,22 +176,25 @@ namespace DataLoader
|
||||
//Console.WriteLine("number {0}", number);
|
||||
//Console.WriteLine("Item Key {0} List {1}", Item.CacheCountPrimaryKey, Item.CacheCountList);
|
||||
//Console.WriteLine("ItemInfo Key {0} List {1}", ItemInfo.CacheCountPrimaryKey, ItemInfo.CacheCountList);
|
||||
DocVersionInfo dvi = DocVersionInfo.Get(docver.VersionID);
|
||||
dvi.ResetProcedures(); // need this to clear out Procedures so that they are retrieved (resolves a caching problem)
|
||||
foreach (ItemInfo ii in dvi.Procedures)
|
||||
{
|
||||
if (ii.MyContent.Number == number)
|
||||
{
|
||||
//Console.WriteLine(number);
|
||||
itm = ii.Get();
|
||||
cont = ii.MyContent.Get();
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!convertProcedures || (docver.VersionType != (int)VEPROMS.CSLA.Library.VersionTypeEnum.WorkingDraft && docver.VersionType != (int)VEPROMS.CSLA.Library.VersionTypeEnum.Approved))
|
||||
{
|
||||
cont = Content.New(number, TextConvert.ConvertText(dr["Title"].ToString(), do_cvt), 0, null, ci == null ? null : ci.ToString(), dts, userid);
|
||||
itm = Item.MakeItem(FromItem, cont, dts, userid);
|
||||
}
|
||||
else
|
||||
{
|
||||
DocVersionInfo dvi = DocVersionInfo.Get(docver.VersionID);
|
||||
foreach (ItemInfo ii in dvi.Procedures)
|
||||
// if this procedure already exists for this docversion, just use it.
|
||||
if (itm == null && cont == null)
|
||||
{
|
||||
if (ii.MyContent.Number == number)
|
||||
{
|
||||
//Console.WriteLine(number);
|
||||
itm = ii.Get();
|
||||
cont = ii.MyContent.Get();
|
||||
}
|
||||
cont = Content.New(number, TextConvert.ConvertText(dr["Title"].ToString(), do_cvt), 0, null, ci == null ? null : ci.ToString(), dts, userid);
|
||||
itm = Item.MakeItem(FromItem, cont, dts, userid);
|
||||
}
|
||||
}
|
||||
if (convertProcedures /* && number == "001\\u8209?007"/* && number == "0POP05-EO-EC00"*/)
|
||||
@@ -359,7 +362,6 @@ namespace DataLoader
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private Item MigrateProcedures(OleDbConnection cn, string pth, DocVersion docver, bool convertProcedures, FormatInfo activeFormat)
|
||||
{
|
||||
|
||||
@@ -403,6 +405,7 @@ namespace DataLoader
|
||||
}
|
||||
//GC.Collect();
|
||||
}
|
||||
ds.Dispose();
|
||||
da.Dispose();
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
Reference in New Issue
Block a user