DataLoader changes during development

This commit is contained in:
2007-11-14 14:49:18 +00:00
parent da9b899424
commit ef81207dbe
28 changed files with 2118 additions and 962 deletions

View File

@@ -19,43 +19,57 @@ using System.Collections.Generic;
using System.Xml;
using System.IO;
using System.Text;
using Volian.CSLA.Library;
using VEPROMS.CSLA.Library;
namespace DataLoader
{
public partial class frmLoader : Form
public partial class Loader
{
private Int32 MigrateDocVersion(string pth)
public Item MigrateDocVersion(DocVersion docver)
{
Int32 iStructureID = 0;
string pth = docver.Title;
// Open connection
OleDbConnection cn = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + pth + ";Extended Properties=dBase III;Persist Security Info=False");
// load rofst (use it later)....
Database.LogInfoFormat("Before ROFST");
rofst = new ROFST(pth + "\\ro.fst");
// Migrate library documents
Database.LogInfoFormat("Before MigrateLibDocs");
MigrateLibDocs(cn, pth);
// Initialize Dictionaries
dicTrans_StrDone = new Dictionary<string, int>();
dicTrans_StrIds = new Dictionary<string, int>();
dicTrans_ItemDone = new Dictionary<string, Item>();
dicTrans_ItemIds = new Dictionary<string, Item>();
// Create a 'dummy' content record. This will be used for any transitions 'to'
// that don't exist when dbf is processed. At end, use this to see if there
// are missing transitions.
TransDummyCont = Content.MakeContent(null, "DUMMY CONTENT FOR TRANSITION MIGRATION", null, null, null);
// Process Procedures
iStructureID = MigrateProcedures(cn,pth);
Item itm = MigrateProcedures(cn,pth,docver);
// Show any Missing Transtitons (i.e. Transitions which have not been processed)
ShowMissingTransitions();
log.InfoFormat("Completed Migration of {0}",pth);
MessageBox.Show("Completed Migration of " + pth);
log.InfoFormat("Completed Migration of {0}", pth);
MessageBox.Show("Completed Migration of " + pth);
rofst.Close();
cn.Close();
dicTrans_StrDone.Clear();
dicTrans_StrDone = null;
return iStructureID;
dicTrans_ItemDone.Clear();
dicTrans_ItemDone = null;
if (itm != null)
{
docver.MyItem = itm;
docver.Title = "";
if (!docver.IsSavable) ErrorRpt.ErrorReport(docver);
docver.Save();
}
return itm;
}
private Volian.CSLA.Library.VersionTypeEnum DocVersionType(string s)
private VEPROMS.CSLA.Library.VersionTypeEnum DocVersionType(string s)
{
if (s.EndsWith("approved")) return Volian.CSLA.Library.VersionTypeEnum.Approved;
if (s.EndsWith("chgsht")) return Volian.CSLA.Library.VersionTypeEnum.Revision;
if (s.EndsWith("tmpchg")) return Volian.CSLA.Library.VersionTypeEnum.Temporary;
return Volian.CSLA.Library.VersionTypeEnum.WorkingDraft;
if (s.EndsWith("approved")) return VEPROMS.CSLA.Library.VersionTypeEnum.Approved;
if (s.EndsWith("chgsht")) return VEPROMS.CSLA.Library.VersionTypeEnum.Revision;
if (s.EndsWith("tmpchg")) return VEPROMS.CSLA.Library.VersionTypeEnum.Temporary;
return VEPROMS.CSLA.Library.VersionTypeEnum.WorkingDraft;
}
}
}