DataLoader changes during development
This commit is contained in:
parent
da9b899424
commit
ef81207dbe
@ -21,7 +21,7 @@ namespace DataLoader
|
|||||||
{
|
{
|
||||||
xmldoc = new XmlDocument();
|
xmldoc = new XmlDocument();
|
||||||
if (xml == null)
|
if (xml == null)
|
||||||
xmldoc.LoadXml("<config/>");
|
xmldoc.LoadXml("<Config/>");
|
||||||
else
|
else
|
||||||
xmldoc.LoadXml(xml);
|
xmldoc.LoadXml(xml);
|
||||||
}
|
}
|
||||||
@ -30,7 +30,7 @@ namespace DataLoader
|
|||||||
{
|
{
|
||||||
xmldoc = new XmlDocument();
|
xmldoc = new XmlDocument();
|
||||||
if (xml == null)
|
if (xml == null)
|
||||||
xmldoc.LoadXml("<config/>");
|
xmldoc.LoadXml("<Config/>");
|
||||||
else
|
else
|
||||||
xmldoc.LoadXml(xml);
|
xmldoc.LoadXml(xml);
|
||||||
AddItem(ename, aname.Replace(' ','_'), avalue);
|
AddItem(ename, aname.Replace(' ','_'), avalue);
|
||||||
|
@ -15,7 +15,7 @@ using System.Text;
|
|||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using System.Xml;
|
using System.Xml;
|
||||||
using System.Xml.Serialization;
|
using System.Xml.Serialization;
|
||||||
using Volian.CSLA.Library;
|
using VEPROMS.CSLA.Library;
|
||||||
|
|
||||||
namespace Utils
|
namespace Utils
|
||||||
{
|
{
|
||||||
@ -26,10 +26,12 @@ namespace Utils
|
|||||||
{
|
{
|
||||||
private int NUMCBTEXTYPE = 5; // number of changebar text types.
|
private int NUMCBTEXTYPE = 5; // number of changebar text types.
|
||||||
public string PathName;
|
public string PathName;
|
||||||
|
private string DefaultPlantFmt;
|
||||||
|
|
||||||
public CurSet(string pname)
|
public CurSet(string pname)
|
||||||
{
|
{
|
||||||
PathName = pname;
|
PathName = pname;
|
||||||
|
DefaultPlantFmt = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string ReadTheString(BinaryReader bw, int maxlen)
|
private string ReadTheString(BinaryReader bw, int maxlen)
|
||||||
@ -62,7 +64,7 @@ namespace Utils
|
|||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
DataLoader.frmLoader.log.ErrorFormat("Error migrating Curset.dat, error = {0}", e.Message);
|
DataLoader.frmLoader.log.ErrorFormat("Error migrating {0} Curset.dat, error = {1}", PathName, e.Message);
|
||||||
return cfg;
|
return cfg;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -83,6 +85,7 @@ namespace Utils
|
|||||||
cfg.Print_Pagination=(FolderConfig.PrintPagination) br.ReadSByte();
|
cfg.Print_Pagination=(FolderConfig.PrintPagination) br.ReadSByte();
|
||||||
tmpstring = ReadTheString(br,4); // DefaultPrinter not used
|
tmpstring = ReadTheString(br,4); // DefaultPrinter not used
|
||||||
cfg.Format_Plant = ReadTheString(br,10);
|
cfg.Format_Plant = ReadTheString(br,10);
|
||||||
|
DefaultPlantFmt = cfg.Format_Plant;
|
||||||
tmpstring = ReadTheString(br, 128); // DefaultDestFName not used
|
tmpstring = ReadTheString(br, 128); // DefaultDestFName not used
|
||||||
tmpsbyte = br.ReadSByte(); // DefaultPlotterType not used
|
tmpsbyte = br.ReadSByte(); // DefaultPlotterType not used
|
||||||
tmpsbyte = br.ReadSByte(); // DefaultPlotterPort not used
|
tmpsbyte = br.ReadSByte(); // DefaultPlotterPort not used
|
||||||
@ -95,16 +98,20 @@ namespace Utils
|
|||||||
tmpsbyte = br.ReadSByte(); // DontPrintStatusTree not used
|
tmpsbyte = br.ReadSByte(); // DontPrintStatusTree not used
|
||||||
cfg.Print_UserFormat = ReadTheString(br, 10);
|
cfg.Print_UserFormat = ReadTheString(br, 10);
|
||||||
tmpsbyte = br.ReadSByte();
|
tmpsbyte = br.ReadSByte();
|
||||||
cfg.Print_DisableDuplex = tmpsbyte == 0 ? false : true;
|
//cfg.Print_Duplex = tmpsbyte == 0 ? true : false;
|
||||||
br.Close();
|
br.Close();
|
||||||
}
|
}
|
||||||
catch(Exception e)
|
catch(Exception e)
|
||||||
{
|
{
|
||||||
if(br!=null) br.Close();
|
if(br!=null) br.Close();
|
||||||
DataLoader.frmLoader.log.ErrorFormat("Error migrating Curset.dat, error = {0}", e.Message);
|
DataLoader.frmLoader.log.ErrorFormat("Error migrating {0} Curset.dat, error = {1}", PathName, e.Message);
|
||||||
}
|
}
|
||||||
fs.Close();
|
fs.Close();
|
||||||
return cfg;
|
return cfg;
|
||||||
}
|
}
|
||||||
|
public string GetDefFmt()
|
||||||
|
{
|
||||||
|
return DefaultPlantFmt;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,43 +19,57 @@ using System.Collections.Generic;
|
|||||||
using System.Xml;
|
using System.Xml;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Volian.CSLA.Library;
|
using VEPROMS.CSLA.Library;
|
||||||
|
|
||||||
namespace DataLoader
|
namespace DataLoader
|
||||||
{
|
{
|
||||||
public partial class frmLoader : Form
|
public partial class Loader
|
||||||
{
|
{
|
||||||
private Int32 MigrateDocVersion(string pth)
|
public Item MigrateDocVersion(DocVersion docver)
|
||||||
{
|
{
|
||||||
|
string pth = docver.Title;
|
||||||
Int32 iStructureID = 0;
|
|
||||||
// Open connection
|
// Open connection
|
||||||
OleDbConnection cn = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + pth + ";Extended Properties=dBase III;Persist Security Info=False");
|
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)....
|
// load rofst (use it later)....
|
||||||
|
Database.LogInfoFormat("Before ROFST");
|
||||||
rofst = new ROFST(pth + "\\ro.fst");
|
rofst = new ROFST(pth + "\\ro.fst");
|
||||||
// Migrate library documents
|
// Migrate library documents
|
||||||
|
Database.LogInfoFormat("Before MigrateLibDocs");
|
||||||
MigrateLibDocs(cn, pth);
|
MigrateLibDocs(cn, pth);
|
||||||
// Initialize Dictionaries
|
// Initialize Dictionaries
|
||||||
dicTrans_StrDone = new Dictionary<string, int>();
|
dicTrans_ItemDone = new Dictionary<string, Item>();
|
||||||
dicTrans_StrIds = new Dictionary<string, int>();
|
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
|
// Process Procedures
|
||||||
iStructureID = MigrateProcedures(cn,pth);
|
Item itm = MigrateProcedures(cn,pth,docver);
|
||||||
// Show any Missing Transtitons (i.e. Transitions which have not been processed)
|
// Show any Missing Transtitons (i.e. Transitions which have not been processed)
|
||||||
ShowMissingTransitions();
|
ShowMissingTransitions();
|
||||||
log.InfoFormat("Completed Migration of {0}",pth);
|
log.InfoFormat("Completed Migration of {0}", pth);
|
||||||
MessageBox.Show("Completed Migration of " + pth);
|
MessageBox.Show("Completed Migration of " + pth);
|
||||||
rofst.Close();
|
rofst.Close();
|
||||||
cn.Close();
|
cn.Close();
|
||||||
dicTrans_StrDone.Clear();
|
dicTrans_ItemDone.Clear();
|
||||||
dicTrans_StrDone = null;
|
dicTrans_ItemDone = null;
|
||||||
return iStructureID;
|
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("approved")) return VEPROMS.CSLA.Library.VersionTypeEnum.Approved;
|
||||||
if (s.EndsWith("chgsht")) return Volian.CSLA.Library.VersionTypeEnum.Revision;
|
if (s.EndsWith("chgsht")) return VEPROMS.CSLA.Library.VersionTypeEnum.Revision;
|
||||||
if (s.EndsWith("tmpchg")) return Volian.CSLA.Library.VersionTypeEnum.Temporary;
|
if (s.EndsWith("tmpchg")) return VEPROMS.CSLA.Library.VersionTypeEnum.Temporary;
|
||||||
return Volian.CSLA.Library.VersionTypeEnum.WorkingDraft;
|
return VEPROMS.CSLA.Library.VersionTypeEnum.WorkingDraft;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -20,13 +20,13 @@ using System.Xml;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Volian.MSWord;
|
using Volian.MSWord;
|
||||||
using Volian.CSLA.Library;
|
using VEPROMS.CSLA.Library;
|
||||||
|
|
||||||
namespace DataLoader
|
namespace DataLoader
|
||||||
{
|
{
|
||||||
public partial class frmLoader : Form
|
public partial class Loader
|
||||||
{
|
{
|
||||||
private void SaveSectionDocument(string fname, string stpseq, ref byte ctype, ref int cid)
|
private void SaveSectionDocument(string fname, string stpseq, ref int cid)
|
||||||
{
|
{
|
||||||
int docid = SaveWordDoc(fname);
|
int docid = SaveWordDoc(fname);
|
||||||
switch (docid)
|
switch (docid)
|
||||||
@ -40,7 +40,6 @@ namespace DataLoader
|
|||||||
log.ErrorFormat("Could not complete save of word document, oldstepsequence = {0}", stpseq);
|
log.ErrorFormat("Could not complete save of word document, oldstepsequence = {0}", stpseq);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ctype = 2;
|
|
||||||
cid = docid;
|
cid = docid;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -50,7 +49,7 @@ namespace DataLoader
|
|||||||
int docid = 0;
|
int docid = 0;
|
||||||
if (System.IO.File.Exists(fname))
|
if (System.IO.File.Exists(fname))
|
||||||
{
|
{
|
||||||
if (cbSaveDoc.Checked)
|
if (frmMain.cbSaveDocChecked)
|
||||||
{
|
{
|
||||||
WordDoc d = new WordDoc(fname);
|
WordDoc d = new WordDoc(fname);
|
||||||
string temppath = Path.GetTempFileName();
|
string temppath = Path.GetTempFileName();
|
||||||
@ -62,10 +61,12 @@ namespace DataLoader
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (cbSaveRTF.Checked)
|
if (frmMain.cbSaveRTFChecked)
|
||||||
docid = SaveDoc(fname, title, ci);
|
docid = SaveDoc(fname, title, ci);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
log.ErrorFormat("Missing rtf file: {0}", fname);
|
||||||
return docid;
|
return docid;
|
||||||
}
|
}
|
||||||
private int SaveWordDoc(string temppath)
|
private int SaveWordDoc(string temppath)
|
||||||
@ -81,8 +82,8 @@ namespace DataLoader
|
|||||||
byte[] ByteArray = new byte[len];
|
byte[] ByteArray = new byte[len];
|
||||||
int nBytesRead = fs.Read(ByteArray, 0, (int)len);
|
int nBytesRead = fs.Read(ByteArray, 0, (int)len);
|
||||||
fs.Close();
|
fs.Close();
|
||||||
string t1 = (title == null || title == "") ? "notitle" : title;
|
string t1 = (title == null || title == "") ? null : title;
|
||||||
Document doc = Document.MakeDocument(t1, ByteArray, null, ci == null ? null : ci.ToString());
|
Document doc = Document.MakeDocument(t1, ByteArray, null, ci == null ? null : ci.ToString(), DateTime.Now, "Migration");
|
||||||
return doc.DocID;
|
return doc.DocID;
|
||||||
}
|
}
|
||||||
// for an io exception, keep trying
|
// for an io exception, keep trying
|
||||||
@ -110,5 +111,5 @@ namespace DataLoader
|
|||||||
}
|
}
|
||||||
return done;
|
return done;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
28
PROMS/DataLoader/ErrorReport.cs
Normal file
28
PROMS/DataLoader/ErrorReport.cs
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using VEPROMS.CSLA.Library;
|
||||||
|
using Csla.Validation;
|
||||||
|
|
||||||
|
namespace DataLoader
|
||||||
|
{
|
||||||
|
public static class ErrorRpt
|
||||||
|
{
|
||||||
|
public static void ErrorReport(IVEHasBrokenRules mybr)
|
||||||
|
{
|
||||||
|
string smess = mybr.GetType().Name;
|
||||||
|
IVEHasBrokenRules hbr = mybr.HasBrokenRules;
|
||||||
|
if (hbr == null) smess += "\n Unknown Error";
|
||||||
|
else
|
||||||
|
{
|
||||||
|
smess += "\n In object" + hbr.GetType().Name;
|
||||||
|
foreach (BrokenRule br in hbr.BrokenRules)
|
||||||
|
{
|
||||||
|
smess += "\n" + br.Property + " - " + br.Description;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
MessageBox.Show(smess);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -10,7 +10,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Volian.CSLA.Library;
|
using VEPROMS.CSLA.Library;
|
||||||
using Csla;
|
using Csla;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
@ -69,7 +69,7 @@ namespace DataLoader
|
|||||||
ftp = new FolderTreeNode(fi.ParentID.ToString());
|
ftp = new FolderTreeNode(fi.ParentID.ToString());
|
||||||
dicMissing.Add(fi.ParentID, ftp);
|
dicMissing.Add(fi.ParentID, ftp);
|
||||||
dicExists.Add(fi.ParentID, ftp);
|
dicExists.Add(fi.ParentID, ftp);
|
||||||
if (fi.DocVersionCount > 0)
|
if (fi.FolderDocVersionCount > 0)
|
||||||
{
|
{
|
||||||
TreeNode tn = new TreeNode("dummy");
|
TreeNode tn = new TreeNode("dummy");
|
||||||
tn.Tag = "dummy";
|
tn.Tag = "dummy";
|
||||||
@ -87,7 +87,7 @@ namespace DataLoader
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
ft = new FolderTreeNode(fi);
|
ft = new FolderTreeNode(fi);
|
||||||
if (fi.DocVersionCount > 0)
|
if (fi.FolderDocVersionCount > 0)
|
||||||
{
|
{
|
||||||
TreeNode tn = new TreeNode("dummy");
|
TreeNode tn = new TreeNode("dummy");
|
||||||
tn.Tag = "dummy";
|
tn.Tag = "dummy";
|
||||||
|
145
PROMS/DataLoader/Formats.cs
Normal file
145
PROMS/DataLoader/Formats.cs
Normal file
@ -0,0 +1,145 @@
|
|||||||
|
// ========================================================================
|
||||||
|
// Copyright 2006 - Volian Enterprises, Inc. All rights reserved.
|
||||||
|
// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
|
||||||
|
// ------------------------------------------------------------------------
|
||||||
|
// $Workfile: $ $Revision: $
|
||||||
|
// $Author: $ $Date: $
|
||||||
|
//
|
||||||
|
// $History: $
|
||||||
|
// ========================================================================
|
||||||
|
using System;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Collections;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using System.Data;
|
||||||
|
using System.Data.OleDb;
|
||||||
|
using System.Collections.Specialized;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Xml;
|
||||||
|
using System.Xml.XPath;
|
||||||
|
using System.IO;
|
||||||
|
using System.Text;
|
||||||
|
using VEPROMS.CSLA.Library;
|
||||||
|
|
||||||
|
namespace DataLoader
|
||||||
|
{
|
||||||
|
public partial class Loader
|
||||||
|
{
|
||||||
|
|
||||||
|
private Format AddFormatToDB(Format parent, string format, bool issub, DateTime Dts, string Userid)
|
||||||
|
{
|
||||||
|
string fmtdata = null;
|
||||||
|
string genmacdata = null;
|
||||||
|
XmlDocument xd = null;
|
||||||
|
|
||||||
|
string path = "e:\\fmtall\\" + format + "all.xml";
|
||||||
|
if (File.Exists(path))
|
||||||
|
{
|
||||||
|
xd = new XmlDocument();
|
||||||
|
xd.Load(path);
|
||||||
|
fmtdata = xd.OuterXml;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Do we need genmac - only if non-subformat
|
||||||
|
if (!issub)
|
||||||
|
{
|
||||||
|
path = "e:\\genmacall\\" + format + ".svg";
|
||||||
|
if (File.Exists(path))
|
||||||
|
{
|
||||||
|
XmlDocument xdg = new XmlDocument();
|
||||||
|
xdg.Load(path);
|
||||||
|
genmacdata = xdg.OuterXml;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Get the name & then create the record.
|
||||||
|
if (Userid == null || Userid == "") Userid = "Migration";
|
||||||
|
|
||||||
|
string nmattr = "Default";
|
||||||
|
|
||||||
|
// use xpath to get name.
|
||||||
|
if (parent != null)
|
||||||
|
{
|
||||||
|
XmlNode nmnode = xd.SelectSingleNode("//FormatData");
|
||||||
|
if (nmnode is XmlElement)
|
||||||
|
{
|
||||||
|
XmlElement xm = (XmlElement)nmnode;
|
||||||
|
nmattr = xm.GetAttribute("Name");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// use the format name if base or non sub. If it's a sub, remove the "_".
|
||||||
|
string fname = issub ? format.Replace("_", "") : format;
|
||||||
|
Format rec = Format.MakeFormat(parent, fname, nmattr, fmtdata, genmacdata, Dts, Userid);
|
||||||
|
return rec;
|
||||||
|
}
|
||||||
|
public void LoadAllFormats()
|
||||||
|
{
|
||||||
|
Format basefmt = null;
|
||||||
|
Format parent = null;
|
||||||
|
|
||||||
|
// Load base format.
|
||||||
|
basefmt = AddFormatToDB(null, "base", false, DateTime.Now, "Migration");
|
||||||
|
|
||||||
|
// now loop through all files... If there is an _ in the name, it's a subformat
|
||||||
|
// (for example, AEP_00.xml) skip it in main loop, it's handled for each format.
|
||||||
|
DirectoryInfo di = new DirectoryInfo("e:\\fmtall");
|
||||||
|
FileInfo[] fis = di.GetFiles("*.xml");
|
||||||
|
|
||||||
|
foreach (FileInfo fi in fis)
|
||||||
|
{
|
||||||
|
bool issub = (fi.Name.IndexOf("_") > 0) ? true : false;
|
||||||
|
if (!issub && fi.Name.ToLower()!="baseall.xml")
|
||||||
|
{
|
||||||
|
string fmtname = fi.Name.Substring(0, fi.Name.Length - 7);
|
||||||
|
// remove the all.xml part of the filename.
|
||||||
|
parent = AddFormatToDB(basefmt, fmtname, issub, DateTime.Now, "Migration");
|
||||||
|
|
||||||
|
// now see if there are any subformats associated with this, if so
|
||||||
|
// add them here...
|
||||||
|
DirectoryInfo sdi = new DirectoryInfo("e:\\fmtall");
|
||||||
|
FileInfo[] sfis = di.GetFiles(fmtname+"_*.xml");
|
||||||
|
foreach (FileInfo sfi in sfis)
|
||||||
|
{
|
||||||
|
string nm = sfi.Name.Substring(0, sfi.Name.Length-7);
|
||||||
|
Format subfmt = AddFormatToDB(parent, nm, true, DateTime.Now, "Migration");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public Format GetFormat(string format)
|
||||||
|
{
|
||||||
|
Format parent = null;
|
||||||
|
Format rec = null;
|
||||||
|
|
||||||
|
// get base
|
||||||
|
Format baseparent = Format.Get(1);
|
||||||
|
|
||||||
|
// if there is no format - what should be done? maybe nothing.
|
||||||
|
if (format == null || format == "") return null;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (format.IndexOf(' ') > -1) // will have spaces if it's a user format
|
||||||
|
{
|
||||||
|
string part1 = format.Substring(0, format.IndexOf(' '));
|
||||||
|
string part2 = format.Substring(format.LastIndexOf(' ') + 1, 2);
|
||||||
|
format = part1 + part2;
|
||||||
|
|
||||||
|
// get the parent format's id (for example, AEP for AEP00).
|
||||||
|
parent = Format.GetExistingByParentID_Name(baseparent.FormatID, part1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
parent = baseparent;
|
||||||
|
|
||||||
|
// see if the format has been added, if not go get it.
|
||||||
|
rec = Format.GetExistingByParentID_Name(parent.FormatID, format);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
log.ErrorFormat("Error getting xml version of format {0}", ex.Message);
|
||||||
|
}
|
||||||
|
return rec;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -6,7 +6,7 @@ using System.Drawing;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using Csla;
|
using Csla;
|
||||||
using Volian.CSLA.Library;
|
using VEPROMS.CSLA.Library;
|
||||||
|
|
||||||
namespace DataLoader
|
namespace DataLoader
|
||||||
{
|
{
|
||||||
@ -39,6 +39,7 @@ namespace DataLoader
|
|||||||
}
|
}
|
||||||
private void btnSave_Click(object sender, EventArgs e)
|
private void btnSave_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
if (!grp.IsSavable) ErrorRpt.ErrorReport(grp);
|
||||||
grp.Save();
|
grp.Save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,28 +26,9 @@ using Org.Mentalis.Files;
|
|||||||
|
|
||||||
namespace DataLoader
|
namespace DataLoader
|
||||||
{
|
{
|
||||||
public partial class frmLoader : Form
|
public partial class Loader
|
||||||
{
|
{
|
||||||
private void UpdateLabelsLibDocs(int incLib, int incUsages)
|
|
||||||
{
|
|
||||||
if (incLib == 0 && incUsages == 0)//Reset
|
|
||||||
{
|
|
||||||
lblTime.Tag = DateTime.Now;
|
|
||||||
pbProc.Value = 0;
|
|
||||||
pbSect.Value = 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pbProc.Value += incLib;
|
|
||||||
pbSect.Value += incUsages;
|
|
||||||
}
|
|
||||||
lblProc.Text = string.Format("{0} Lib Docs", pbProc.Value);
|
|
||||||
lblSection.Text = string.Format("{0} Usages", pbSect.Value);
|
|
||||||
lblStep.Text = "";
|
|
||||||
TimeSpan ts = new TimeSpan(DateTime.Now.Ticks - ((DateTime)lblTime.Tag).Ticks);
|
|
||||||
lblTime.Text = string.Format("{0:D2}:{1:D2}:{2:D2} Elapsed", ts.Hours, ts.Minutes, ts.Seconds);
|
|
||||||
Application.DoEvents();
|
|
||||||
}
|
|
||||||
private void MigrateLibDocs(OleDbConnection cn, string pth)
|
private void MigrateLibDocs(OleDbConnection cn, string pth)
|
||||||
{
|
{
|
||||||
// Get all of the library documents - the first list has the entire list of files
|
// Get all of the library documents - the first list has the entire list of files
|
||||||
@ -56,15 +37,15 @@ namespace DataLoader
|
|||||||
// will be migrated. After that, any remaining library documents will be added to
|
// will be migrated. After that, any remaining library documents will be added to
|
||||||
// the section table without a reference from the structuretbl.
|
// the section table without a reference from the structuretbl.
|
||||||
Dictionary<string, int> dicLibDocSect = new Dictionary<string, int>();
|
Dictionary<string, int> dicLibDocSect = new Dictionary<string, int>();
|
||||||
UpdateLabelsLibDocs(0, 0);
|
frmMain.UpdateLabelsLibDocs(0, 0);
|
||||||
if (Directory.Exists(pth + "\\rtffiles"))
|
if (Directory.Exists(pth + "\\rtffiles"))
|
||||||
{
|
{
|
||||||
DirectoryInfo di = new DirectoryInfo(pth + "\\RTFFILES");
|
DirectoryInfo di = new DirectoryInfo(pth + "\\RTFFILES");
|
||||||
FileInfo[] fis = di.GetFiles("DOC_*.LIB");
|
FileInfo[] fis = di.GetFiles("DOC_*.LIB");
|
||||||
pbProc.Maximum = fis.Length;
|
frmMain.UpdateLabelsSetProc(fis.Length);
|
||||||
foreach (FileInfo fi in fis)
|
foreach (FileInfo fi in fis)
|
||||||
{
|
{
|
||||||
UpdateLabelsLibDocs(1, 0);
|
frmMain.UpdateLabelsLibDocs(1, 0);
|
||||||
dicLibDocSect[fi.Name.Substring(0, 8).ToUpper()] = MigrateLibDoc(fi);
|
dicLibDocSect[fi.Name.Substring(0, 8).ToUpper()] = MigrateLibDoc(fi);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -72,10 +53,10 @@ namespace DataLoader
|
|||||||
OleDbDataAdapter da_doc = new OleDbDataAdapter("select [FROMNUMBER], [FROMSEQUEN], [TONUMBER] from [tran] where [TONUMBER] LIKE 'doc_%' or [TONUMBER] like 'DOC_%'", cn);
|
OleDbDataAdapter da_doc = new OleDbDataAdapter("select [FROMNUMBER], [FROMSEQUEN], [TONUMBER] from [tran] where [TONUMBER] LIKE 'doc_%' or [TONUMBER] like 'DOC_%'", cn);
|
||||||
DataSet ds_doc = new DataSet();
|
DataSet ds_doc = new DataSet();
|
||||||
da_doc.Fill(ds_doc);
|
da_doc.Fill(ds_doc);
|
||||||
pbSect.Maximum = ds_doc.Tables[0].Rows.Count;
|
frmMain.UpdateLabelsSetSect(ds_doc.Tables[0].Rows.Count);
|
||||||
foreach (DataRow dr_doc in ds_doc.Tables[0].Rows)
|
foreach (DataRow dr_doc in ds_doc.Tables[0].Rows)
|
||||||
{
|
{
|
||||||
UpdateLabelsLibDocs(0, 1);
|
frmMain.UpdateLabelsLibDocs(0, 1);
|
||||||
string key = dr_doc["FROMNUMBER"].ToString().PadRight(20) + dr_doc["FROMSEQUEN"].ToString().PadRight(10);
|
string key = dr_doc["FROMNUMBER"].ToString().PadRight(20) + dr_doc["FROMSEQUEN"].ToString().PadRight(10);
|
||||||
if (!dicLibDocSect.ContainsKey(dr_doc["TONUMBER"].ToString().ToUpper()))
|
if (!dicLibDocSect.ContainsKey(dr_doc["TONUMBER"].ToString().ToUpper()))
|
||||||
log.ErrorFormat("Error setting library document references: {0}", dr_doc["TONUMBER"].ToString().ToUpper());
|
log.ErrorFormat("Error setting library document references: {0}", dr_doc["TONUMBER"].ToString().ToUpper());
|
||||||
@ -150,4 +131,5 @@ namespace DataLoader
|
|||||||
return tmpRtfFileName;
|
return tmpRtfFileName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -19,7 +19,7 @@ using System.Collections.Generic;
|
|||||||
using System.Xml;
|
using System.Xml;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Volian.CSLA.Library;
|
using VEPROMS.CSLA.Library;
|
||||||
|
|
||||||
namespace Config
|
namespace Config
|
||||||
{
|
{
|
||||||
@ -177,6 +177,22 @@ namespace Config
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
XmlDocument d = IniToXml(inipath);
|
XmlDocument d = IniToXml(inipath);
|
||||||
|
// see if default image file extension was set, if not make it TIF
|
||||||
|
XmlNode gr = d.SelectSingleNode("//Graphics");
|
||||||
|
XmlNode ext = null;
|
||||||
|
if (gr != null) ext = gr.SelectSingleNode("@defaultext");
|
||||||
|
if (ext == null)
|
||||||
|
{
|
||||||
|
// if the graphics node doesn't exist, make it.
|
||||||
|
if (gr == null)
|
||||||
|
{
|
||||||
|
gr = d.CreateElement("Graphics");
|
||||||
|
d.DocumentElement.AppendChild(gr);
|
||||||
|
}
|
||||||
|
XmlAttribute xa = d.CreateAttribute("defaultext");
|
||||||
|
xa.Value = "TIF";
|
||||||
|
gr.Attributes.Append(xa);
|
||||||
|
}
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ using System.Collections.Generic;
|
|||||||
using System.Xml;
|
using System.Xml;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Volian.CSLA.Library;
|
using VEPROMS.CSLA.Library;
|
||||||
using vlnObjectLibrary;
|
using vlnObjectLibrary;
|
||||||
using vlnServerLibrary;
|
using vlnServerLibrary;
|
||||||
using Org.Mentalis.Files;
|
using Org.Mentalis.Files;
|
||||||
@ -28,7 +28,7 @@ using Utils;
|
|||||||
|
|
||||||
namespace DataLoader
|
namespace DataLoader
|
||||||
{
|
{
|
||||||
public partial class frmLoader : Form
|
public partial class Loader
|
||||||
{
|
{
|
||||||
private List<Folder> vlnDataPathFolders() // was vlnDataPath
|
private List<Folder> vlnDataPathFolders() // was vlnDataPath
|
||||||
{
|
{
|
||||||
@ -44,34 +44,44 @@ namespace DataLoader
|
|||||||
if (s1.Length > 0)
|
if (s1.Length > 0)
|
||||||
{
|
{
|
||||||
string[] s2 = s1.Split(",".ToCharArray());
|
string[] s2 = s1.Split(",".ToCharArray());
|
||||||
Folder fld = Folder.MakeFolder(sysFolder.FolderID, dbConn.DBID, s2[1], s2[0], null);
|
Folder fld = Folder.MakeFolder(sysFolder, dbConn, s2[1], s2[0], FolderName(s2[0]), null, null, DateTime.Now, "Migration");
|
||||||
dpf.Add(fld);
|
dpf.Add(fld);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return dpf;
|
return dpf;
|
||||||
}
|
}
|
||||||
private int cslaObject(vlnObject vb, int dbid, int parentid, TreeNode tn)
|
private string FolderName(string Path)
|
||||||
|
{
|
||||||
|
int ind = Path.LastIndexOf("\\");
|
||||||
|
if (ind == Path.Length-1 || ind < 0) return Path;
|
||||||
|
return Path.Substring(ind + 1);
|
||||||
|
}
|
||||||
|
private object cslaObject(vlnObject vb, Connection dbConn, Object parfld, TreeNode tn)
|
||||||
{
|
{
|
||||||
switch (vb.Type)
|
switch (vb.Type)
|
||||||
{
|
{
|
||||||
case "plant":
|
case "plant":
|
||||||
case "set":
|
case "set":
|
||||||
Folder fld = Folder.MakeFolder(parentid, dbid, vb.Title, vb.Path, string.Empty);
|
Folder fld = Folder.MakeFolder((Folder)parfld, dbConn, vb.Title, vb.Path, FolderName(vb.Path), null, null, DateTime.Now, "Migration");
|
||||||
tn.Tag = fld;
|
tn.Tag = fld;
|
||||||
return fld.FolderID;
|
return (object) fld;
|
||||||
case "version":
|
case "version":
|
||||||
ConfigFile cfg = new ConfigFile();
|
ConfigFile cfg = new ConfigFile();
|
||||||
|
|
||||||
XmlDocument d = cfg.IniToXml(vb.Path + "\\proc.ini");
|
XmlDocument d = cfg.IniToXml(vb.Path + "\\proc.ini");
|
||||||
FolderConfig fld_cfg = new FolderConfig(d==null?"":d.InnerXml);
|
//DocVersionConfig fld_cfg = new DocVersionConfig(d == null ? "" : d.InnerXml);
|
||||||
|
FolderConfig fld_cfg = (d==null)?null:new FolderConfig(d.InnerXml);
|
||||||
// translate curset.dat into xml & add to d (somehow).
|
// translate curset.dat into xml & add to d (somehow).
|
||||||
string csfile = string.Format("{0}\\curset.dat",vb.Path);
|
string csfile = string.Format("{0}\\curset.dat",vb.Path);
|
||||||
|
string defPlantFmt = null;
|
||||||
if (File.Exists(csfile))
|
if (File.Exists(csfile))
|
||||||
{
|
{
|
||||||
CurSet cs = new CurSet(csfile);
|
CurSet cs = new CurSet(csfile);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
if (fld_cfg == null) fld_cfg = new FolderConfig();
|
||||||
fld_cfg = cs.Convert(fld_cfg);
|
fld_cfg = cs.Convert(fld_cfg);
|
||||||
|
defPlantFmt = cs.GetDefFmt();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@ -87,13 +97,21 @@ namespace DataLoader
|
|||||||
thetitle = myReader.ReadLine();
|
thetitle = myReader.ReadLine();
|
||||||
myReader.Close();
|
myReader.Close();
|
||||||
}
|
}
|
||||||
DocVersion v = DocVersion.MakeDocVersion(parentid, (int)DocVersionType(vb.Path.ToLower()), thetitle, vb.Path, 0, fld_cfg == null ? null : fld_cfg.ToString());
|
Folder tmpfld = (Folder)parfld;
|
||||||
|
Format format = null;
|
||||||
|
if (defPlantFmt != null && defPlantFmt != "")
|
||||||
|
{
|
||||||
|
format = GetFormat(defPlantFmt);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
format = Format.Get(1);
|
||||||
|
DocVersion v = DocVersion.MakeDocVersion(tmpfld, (int)DocVersionType(vb.Path.ToLower()), thetitle, vb.Path.ToLower(), null, format, fld_cfg == null ? null : fld_cfg.ToString(), DateTime.Now, "Migration");
|
||||||
tn.Tag = v;
|
tn.Tag = v;
|
||||||
return v.VersionID;
|
return (object) v;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
private void MigrateChildren(vlnObject vb, vlnServer vs, int dbid, int parentid, TreeNode tn)
|
private void MigrateChildren(vlnObject vb, vlnServer vs, Connection dbConn, Object parent, TreeNode tn)
|
||||||
{
|
{
|
||||||
if (vb.Type != "version")
|
if (vb.Type != "version")
|
||||||
{
|
{
|
||||||
@ -102,10 +120,12 @@ namespace DataLoader
|
|||||||
foreach (vlnObject vbc in lv)
|
foreach (vlnObject vbc in lv)
|
||||||
{
|
{
|
||||||
TreeNode tnc = tn.Nodes.Add(vbc.Title);
|
TreeNode tnc = tn.Nodes.Add(vbc.Title);
|
||||||
int idc = cslaObject(vbc, dbid, parentid, tnc);
|
object idc = cslaObject(vbc, dbConn, parent, tnc);
|
||||||
MigrateChildren(vbc, vs, dbid, idc, tnc);
|
frmMain.Status = "Loading " + vbc.Title;
|
||||||
|
MigrateChildren(vbc, vs, dbConn, idc, tnc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
frmMain.Status = " ";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -20,21 +20,21 @@ using System.Collections.Generic;
|
|||||||
using System.Xml;
|
using System.Xml;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Volian.CSLA.Library;
|
using VEPROMS.CSLA.Library;
|
||||||
|
|
||||||
namespace DataLoader
|
namespace DataLoader
|
||||||
{
|
{
|
||||||
public partial class frmLoader : Form
|
public partial class Loader
|
||||||
{
|
{
|
||||||
private bool LoadChildren(FolderInfo fld, TreeNode tn)
|
public bool LoadChildren(FolderInfo fld, TreeNode tn)
|
||||||
{
|
{
|
||||||
tn.Nodes.Clear();
|
tn.Nodes.Clear();
|
||||||
bool bLoaded = true;
|
bool bLoaded = true;
|
||||||
foreach (DocVersionInfo fdv in fld.DocVersions)
|
foreach (DocVersionInfo fdv in fld.FolderDocVersions)
|
||||||
{
|
{
|
||||||
TreeNode tnc = tn.Nodes.Add(fdv.Title);
|
TreeNode tnc = tn.Nodes.Add(fdv.Title);
|
||||||
tnc.Tag = fdv;
|
tnc.Tag = fdv;
|
||||||
tnc.Checked = fdv.StructureID != 0;
|
tnc.Checked = fdv.ItemID != 0;
|
||||||
bLoaded &= tnc.Checked;
|
bLoaded &= tnc.Checked;
|
||||||
}
|
}
|
||||||
return bLoaded;
|
return bLoaded;
|
||||||
|
212
PROMS/DataLoader/Loader.cs
Normal file
212
PROMS/DataLoader/Loader.cs
Normal file
@ -0,0 +1,212 @@
|
|||||||
|
using System;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Collections;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using System.Data;
|
||||||
|
using System.Data.OleDb;
|
||||||
|
using System.Collections.Specialized;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Xml;
|
||||||
|
using System.IO;
|
||||||
|
using System.Text;
|
||||||
|
using Volian.MSWord;
|
||||||
|
using vlnObjectLibrary;
|
||||||
|
using vlnServerLibrary;
|
||||||
|
using VEPROMS.CSLA.Library;
|
||||||
|
using Config;
|
||||||
|
|
||||||
|
namespace DataLoader
|
||||||
|
{
|
||||||
|
public partial class Loader
|
||||||
|
{
|
||||||
|
#region ClassProperties
|
||||||
|
private int wms = 500;
|
||||||
|
private static int EDDATA = 0x01;
|
||||||
|
private static int PH = 0x02;
|
||||||
|
private static int TOC = 0x04;
|
||||||
|
private static int AUTOIND = 0x08;
|
||||||
|
private static int AUTOGEN = 0x40;
|
||||||
|
|
||||||
|
private static int STP_MULT_CHGID = 1;
|
||||||
|
private static int STP_LNK_SEQ = 2;
|
||||||
|
private static int STP_OVR_TAB = 3;
|
||||||
|
|
||||||
|
private string ProcFileName;
|
||||||
|
private string ProcNumber;
|
||||||
|
private ROFST rofst;
|
||||||
|
private int EditSectId;
|
||||||
|
private Dictionary<string, int> dicLibDocRef;
|
||||||
|
|
||||||
|
// have a few variables for storing the database id record & the system record.
|
||||||
|
public Connection dbConn;
|
||||||
|
public Folder sysFolder;
|
||||||
|
public AnnotationType CommentType; // this holds the annotationtype of comment for future use
|
||||||
|
public Document MissingDocument=null; // make a document if there is a missing rtf file
|
||||||
|
// any missing will use this.
|
||||||
|
private Content TransDummyCont;
|
||||||
|
// the following two dictionaries are used to handle migration of the
|
||||||
|
// transitions... dicTrans_ItemDone gets an entry for procnumber, sequence
|
||||||
|
// number and the new item id as a step or section is created (transitions
|
||||||
|
// can go to steps or sections). When a transition is encountered, check this
|
||||||
|
// dictionary to see if the step or section was migrated & use the item
|
||||||
|
// for the step or section if it was migrated. When a transition is migrated where
|
||||||
|
// the 'to' has not been migrated yet, check if an entry exists in dicTrans_ItemIds,
|
||||||
|
// if so, use the item listed here. If no entry exists in dicTrans_ItemIds, create
|
||||||
|
// an item table record and use the id as part of the 'to', and add an entry to
|
||||||
|
// dicTrans_ItemIds to flag that the record was already created. As migrating sections
|
||||||
|
// and steps, check this dicTrans_ItemIds to see if the item record has already
|
||||||
|
// been create, if so use it and remove it from the dicTrans_ItemIds dictionary,
|
||||||
|
// otherwise, create a new item record.
|
||||||
|
private Dictionary<string, Item> dicTrans_ItemDone;
|
||||||
|
private Dictionary<string, Item> dicTrans_ItemIds;
|
||||||
|
private Dictionary<object, string> dicOldStepSequence;
|
||||||
|
private Dictionary<TreeNode, TreeNode> dicNeedToLoad;
|
||||||
|
private log4net.ILog log;
|
||||||
|
#endregion
|
||||||
|
private frmLoader frmMain;
|
||||||
|
public Loader(log4net.ILog lg, frmLoader fm)
|
||||||
|
{
|
||||||
|
dicNeedToLoad = new Dictionary<TreeNode, TreeNode>();
|
||||||
|
log = lg;
|
||||||
|
frmMain = fm;
|
||||||
|
}
|
||||||
|
public bool LoadFolders()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
frmMain.Status = "Make Connection";
|
||||||
|
// make the initial database connection record, annotation types & top
|
||||||
|
// system folder.
|
||||||
|
dbConn = Connection.MakeConnection("Default", "Default", "Data Source=.\\SQLEXPRESS;Initial Catalog=VEPROMS;Integrated Security=True", 1, null, DateTime.Now, "Migration");
|
||||||
|
ConfigFile cfg = new ConfigFile();
|
||||||
|
|
||||||
|
frmMain.Status = "Add AnnotationTypes";
|
||||||
|
CommentType = AnnotationType.MakeAnnotationType("Comment", null);
|
||||||
|
|
||||||
|
AnnotationType at = AnnotationType.MakeAnnotationType("Reference", null);
|
||||||
|
at = AnnotationType.MakeAnnotationType("Action Items", null);
|
||||||
|
|
||||||
|
frmMain.Status = "Load veproms.ini";
|
||||||
|
XmlDocument d = cfg.LoadSystemIni();
|
||||||
|
|
||||||
|
frmMain.Status = "Load All Formats";
|
||||||
|
LoadAllFormats();
|
||||||
|
|
||||||
|
Format baseFormat = Format.Get(1);
|
||||||
|
sysFolder = Folder.MakeFolder(null, dbConn, "VEPROMS", "VEPROMS", "VEPROMS", baseFormat, d.InnerXml, DateTime.Now, "Migration");
|
||||||
|
|
||||||
|
// This is to test the vln Libraries
|
||||||
|
List<Folder> lfldr = vlnDataPathFolders();
|
||||||
|
|
||||||
|
List<vlnObject> dp2 = new List<vlnObject>();
|
||||||
|
foreach (Folder fldr in lfldr)
|
||||||
|
{
|
||||||
|
TreeNode tn = frmMain.TV.Nodes.Add(fldr.Name);
|
||||||
|
tn.Tag = fldr;
|
||||||
|
vlnObject vb = new vlnObject(null, "datapath", fldr.Name, fldr.Title);
|
||||||
|
dp2.Add(vb);
|
||||||
|
vlnServer vs = new vlnServer();
|
||||||
|
frmMain.Status = "Loading " + fldr.Name;
|
||||||
|
MigrateChildren(vb, vs, dbConn, fldr, tn);
|
||||||
|
tn.Expand();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
log.ErrorFormat("Could not load data, error = {0}", ex.Message);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
public void ClearData()
|
||||||
|
{
|
||||||
|
Database.PurgeData();
|
||||||
|
}
|
||||||
|
public static string MakeDate(string src)
|
||||||
|
{
|
||||||
|
if (src.Trim() == "") return null;
|
||||||
|
int[] DateOffset ={ 4, 5, 47, 6, 7, 47, 0, 1, 2, 3 }; // 47 = '/'
|
||||||
|
StringBuilder datebuff = new StringBuilder(10);
|
||||||
|
for (int i = 0; i < DateOffset.Length; i++)
|
||||||
|
{
|
||||||
|
if (DateOffset[i] < 9)
|
||||||
|
datebuff.Append(src[DateOffset[i]]);
|
||||||
|
else
|
||||||
|
datebuff.Append(System.Convert.ToChar(DateOffset[i]));
|
||||||
|
}
|
||||||
|
return datebuff.ToString();
|
||||||
|
}
|
||||||
|
public DateTime GetDTS(string date, string time)
|
||||||
|
{
|
||||||
|
// Set the date/time stamp. If there is no 'date', set the date
|
||||||
|
// to 1/1/2000 (this can be changed!). If there is not 'time',
|
||||||
|
// set the time to 0:0:0 (midnight).
|
||||||
|
|
||||||
|
DateTime dts = DateTime.Now;
|
||||||
|
string month = "01";
|
||||||
|
string day = "01";
|
||||||
|
string year = "2000";
|
||||||
|
string hour = "";
|
||||||
|
string minute = "";
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (date != null && date != "")
|
||||||
|
{
|
||||||
|
int indx1 = date.IndexOf("/");
|
||||||
|
month = date.Substring(0, indx1);
|
||||||
|
int indx2 = date.IndexOf("/", indx1 + 1);
|
||||||
|
day = date.Substring(indx1 + 1, indx2 - indx1 - 1);
|
||||||
|
year = date.Substring(indx2 + 1, 4);
|
||||||
|
}
|
||||||
|
if (time == null || time == "")
|
||||||
|
{
|
||||||
|
hour = "0";
|
||||||
|
minute = "0";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
hour = time.Substring(0, 2);
|
||||||
|
int indxc = time.IndexOfAny(":A-".ToCharArray());
|
||||||
|
if (indxc == time.Length - 1)
|
||||||
|
minute = time.Substring(2, 2);
|
||||||
|
else
|
||||||
|
minute = time.Substring(indxc + 1, time.Length - indxc - 1);
|
||||||
|
}
|
||||||
|
dts = new DateTime(System.Convert.ToInt32(year), System.Convert.ToInt32(month), System.Convert.ToInt32(day),
|
||||||
|
System.Convert.ToInt32(hour), System.Convert.ToInt32(minute), 0);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
log.ErrorFormat("Bad Date/Time {0} {1}. Set to NOW.", date, time);
|
||||||
|
log.ErrorFormat("{0}\r\n\r\n{1}", ex.Message, ex.InnerException);
|
||||||
|
//log.ErrorFormat(ex.StackTrace);
|
||||||
|
return dts;
|
||||||
|
}
|
||||||
|
return dts;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool LoadSecurity(string VeSamPath)
|
||||||
|
{
|
||||||
|
Security sec = new Security(VeSamPath);
|
||||||
|
return sec.Migrate();
|
||||||
|
}
|
||||||
|
private void WaitMS(int n)
|
||||||
|
{
|
||||||
|
DateTime dtw = DateTime.Now.AddMilliseconds(n);
|
||||||
|
while (DateTime.Now < dtw)
|
||||||
|
{
|
||||||
|
Application.DoEvents();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void Wait(int n)
|
||||||
|
{
|
||||||
|
DateTime dtw = DateTime.Now.AddSeconds(n);
|
||||||
|
while (DateTime.Now < dtw)
|
||||||
|
{
|
||||||
|
Application.DoEvents();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -55,6 +55,7 @@ namespace Config
|
|||||||
// We now strip spaces before and after any Attribute that is written.
|
// We now strip spaces before and after any Attribute that is written.
|
||||||
sValue = sValue.Trim(' ');
|
sValue = sValue.Trim(' ');
|
||||||
sName = sName.Replace(' ', '_');
|
sName = sName.Replace(' ', '_');
|
||||||
|
sName = sName.Replace("\\", "_slash_");
|
||||||
|
|
||||||
// Add an attribute
|
// Add an attribute
|
||||||
if(sValue=="")
|
if(sValue=="")
|
||||||
@ -82,6 +83,7 @@ namespace Config
|
|||||||
string elename = sSection.Substring(1, sSection.IndexOf("]") - 1);
|
string elename = sSection.Substring(1, sSection.IndexOf("]") - 1);
|
||||||
while(elename.IndexOf(' ')>-1) elename = elename.Remove(elename.IndexOf(' '),1);
|
while(elename.IndexOf(' ')>-1) elename = elename.Remove(elename.IndexOf(' '),1);
|
||||||
if (!ele.Contains(elename.ToLower())) elename = 'z' + elename;
|
if (!ele.Contains(elename.ToLower())) elename = 'z' + elename;
|
||||||
|
elename = elename.Replace("\\", "_slash_");
|
||||||
// Add a section [name]
|
// Add a section [name]
|
||||||
XmlNode nd = AddNode(xParent, elename);
|
XmlNode nd = AddNode(xParent, elename);
|
||||||
//AddAttribute(nd,"name",sSection.Substring(1,sSection.IndexOf("]")-1));
|
//AddAttribute(nd,"name",sSection.Substring(1,sSection.IndexOf("]")-1));
|
||||||
@ -145,7 +147,7 @@ namespace Config
|
|||||||
private void LoadXML()
|
private void LoadXML()
|
||||||
{
|
{
|
||||||
string sLine;
|
string sLine;
|
||||||
ppXml.LoadXml("<ConfigInfo/>");// initialize ppXml
|
ppXml.LoadXml("<Config/>");// initialize ppXml
|
||||||
XmlNode xmlTop=ppXml.DocumentElement;
|
XmlNode xmlTop=ppXml.DocumentElement;
|
||||||
XmlNode xmlNd=ppXml.DocumentElement;
|
XmlNode xmlNd=ppXml.DocumentElement;
|
||||||
//XmlNode xmlNd_UC=ppXml.DocumentElement;
|
//XmlNode xmlNd_UC=ppXml.DocumentElement;
|
||||||
@ -180,7 +182,7 @@ namespace Config
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
log.ErrorFormat("error parsing .INI file: {0} - Directory: {1}", ex.Message,ppName);
|
log.ErrorFormat("error parsing .INI file: {0} - Directory: {1}", ex.Message,ppName);
|
||||||
}
|
}
|
||||||
|
@ -19,13 +19,13 @@ using System.Collections.Generic;
|
|||||||
using System.Xml;
|
using System.Xml;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Volian.CSLA.Library;
|
using VEPROMS.CSLA.Library;
|
||||||
|
|
||||||
namespace DataLoader
|
namespace DataLoader
|
||||||
{
|
{
|
||||||
public partial class frmLoader : Form
|
public partial class Loader
|
||||||
{
|
{
|
||||||
private Int32 MigrateProcedure(OleDbConnection cn, DataRow dr, Byte FromType, Int32 FromID, string pth)
|
private Item MigrateProcedure(OleDbConnection cn, DataRow dr, Item FromItem, string pth, DocVersion docver)
|
||||||
{
|
{
|
||||||
dicOldStepSequence = new Dictionary<object, string>();
|
dicOldStepSequence = new Dictionary<object, string>();
|
||||||
Stack<int> SubSectLevels = new Stack<int>(); // levels of subsections
|
Stack<int> SubSectLevels = new Stack<int>(); // levels of subsections
|
||||||
@ -33,6 +33,7 @@ namespace DataLoader
|
|||||||
ProcNumber = dr["Number"].ToString();
|
ProcNumber = dr["Number"].ToString();
|
||||||
DateTime dts = GetDTS(dr["Date"].ToString(), dr["Time"].ToString());
|
DateTime dts = GetDTS(dr["Date"].ToString(), dr["Time"].ToString());
|
||||||
string userid = dr["initials"].ToString().Trim();
|
string userid = dr["initials"].ToString().Trim();
|
||||||
|
if (userid == null || userid == "") userid = "Migration";
|
||||||
|
|
||||||
ConfigInfo ci = null;
|
ConfigInfo ci = null;
|
||||||
string tstr = dr["Proccode"].ToString();
|
string tstr = dr["Proccode"].ToString();
|
||||||
@ -41,63 +42,92 @@ namespace DataLoader
|
|||||||
ci = new ConfigInfo(null);
|
ci = new ConfigInfo(null);
|
||||||
ci.AddItem("Procedure", "ProcCode", tstr);
|
ci.AddItem("Procedure", "ProcCode", tstr);
|
||||||
}
|
}
|
||||||
tstr = dr["Series"].ToString();
|
|
||||||
if (tstr != null && tstr != "")
|
// check that there is a "Series" column, i.e. the 10th column, some datasets
|
||||||
|
// may not have it, for example vetuec\master.sl1
|
||||||
|
if (dr.ItemArray.Length > 10)
|
||||||
{
|
{
|
||||||
if (ci == null) ci = new ConfigInfo(null);
|
tstr = dr["Series"].ToString();
|
||||||
ci.AddItem("Procedure", "Series", tstr);
|
if (tstr != null && tstr != "")
|
||||||
|
{
|
||||||
|
if (ci == null) ci = new ConfigInfo(null);
|
||||||
|
ci.AddItem("Procedure", "Series", tstr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DataSet ds = new DataSet();
|
DataSet ds = new DataSet();
|
||||||
DataTable dt = null;
|
DataTable dt = null;
|
||||||
|
|
||||||
// See if there is PSI and if so, add it to the xml.
|
// check that file exists, i.e. if proc file doesn't exist but has entry in set
|
||||||
OleDbDataAdapter dapsi = new OleDbDataAdapter("select * from [" + dr["entry"] + "] where [STEP] is null", cn);
|
// file, flag error, but continue.
|
||||||
dapsi.Fill(ds);
|
string fname = frmMain.tbSourceText +"\\"+ dr["entry"] + ".dbf";
|
||||||
dt = ds.Tables[0];
|
if (File.Exists(fname))
|
||||||
|
|
||||||
if (dt.Rows.Count > 0)
|
|
||||||
{
|
{
|
||||||
DataRow drpsi = dt.Rows[0];
|
// if the dbt is bad, fix it.
|
||||||
string psistr = drpsi["TEXTM"].ToString();
|
DbtOk(dr["entry"].ToString());
|
||||||
if (psistr != null && psistr != "")
|
// See if there is PSI and if so, add it to the xml.
|
||||||
{
|
OleDbDataAdapter dapsi = new OleDbDataAdapter("select * from [" + dr["entry"] + "] where [STEP] is null", cn);
|
||||||
StringReader strrd = new StringReader(psistr);
|
try
|
||||||
|
{
|
||||||
|
dapsi.Fill(ds);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Console.WriteLine(ex.Message);
|
||||||
|
Application.Exit();
|
||||||
|
}
|
||||||
|
dt = ds.Tables[0];
|
||||||
|
|
||||||
string sLine;
|
if (dt.Rows.Count > 0)
|
||||||
if (ci == null) ci = new ConfigInfo(null);
|
{
|
||||||
while ((sLine = strrd.ReadLine()) != null)
|
DataRow drpsi = dt.Rows[0];
|
||||||
|
string psistr = drpsi["TEXTM"].ToString();
|
||||||
|
if (psistr != null && psistr != "")
|
||||||
{
|
{
|
||||||
int indx = sLine.IndexOf(' ');
|
StringReader strrd = new StringReader(psistr);
|
||||||
string nm = null;
|
|
||||||
string vl = null;
|
string sLine;
|
||||||
if (indx < 0)
|
if (ci == null) ci = new ConfigInfo(null);
|
||||||
nm = sLine;
|
while ((sLine = strrd.ReadLine()) != null)
|
||||||
else
|
|
||||||
{
|
{
|
||||||
nm = sLine.Substring(0, indx);
|
int indx = sLine.IndexOf(' ');
|
||||||
vl = sLine.Substring(indx+1, sLine.Length-indx-1);
|
string nm = null;
|
||||||
|
string vl = null;
|
||||||
|
if (indx < 0)
|
||||||
|
nm = sLine;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
nm = sLine.Substring(0, indx);
|
||||||
|
vl = sLine.Substring(indx + 1, sLine.Length - indx - 1);
|
||||||
|
}
|
||||||
|
ci.AddItem("PSI", nm, vl == null ? null : vl);
|
||||||
}
|
}
|
||||||
ci.AddItem("PSI", nm, vl==null?null:vl);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
dapsi.Dispose();
|
||||||
|
}
|
||||||
|
else // log an error
|
||||||
|
{
|
||||||
|
log.ErrorFormat("Missing DBF: {0}", fname);
|
||||||
}
|
}
|
||||||
dapsi.Dispose();
|
|
||||||
|
|
||||||
// Note, for now the data from the format field will be saved. Later, xpath, ??
|
// Note, for now the data from the format field will be saved. Later, xpath, ??
|
||||||
EditSectId = 0;
|
EditSectId = 0;
|
||||||
|
|
||||||
Byte FrType = 2;
|
// See if no caret convert...
|
||||||
Int32 FrID = 0;// str.Structureid;
|
Format docverFormat = docver.ActiveFormat;
|
||||||
Procedure prc = Procedure.MakeProcedure(TextConvert.ConvertText(dr["Number"].ToString()), TextConvert.ConvertText(dr["Title"].ToString()), ci==null?null:ci.ToString(), null, 0, 0, dts, userid);
|
bool do_cvt = !(docverFormat.PlantFormat.FormatData.XtraOptions("DontConvertCarrotToDelta"));
|
||||||
Structure str = Structure.MakeStructure(FromType, FromID, 1, prc.ProcID, dts, userid);
|
// pass in a 0 on MakeContent for type of procedure, i.e. procedure = 0 (on type field)
|
||||||
UpdateLabels(1, 0, 0);
|
Content cont = Content.New(TextConvert.ConvertText(dr["Number"].ToString()), TextConvert.ConvertText(dr["Title"].ToString(),do_cvt), 0, null, ci == null ? null : ci.ToString(), dts, userid);
|
||||||
//OleDbDataAdapter da = new OleDbDataAdapter("select * from (select asc(mid(sequence,2,1)) as locb,* from [" + dr["entry"] + "] where sequence like ' %') order by locb asc", cn);
|
Item itm = Item.MakeItem(FromItem, cont, dts, userid);
|
||||||
|
frmMain.UpdateLabels(1, 0, 0);
|
||||||
|
Database.LogInfoFormat("Processing Procedure [{0}] - [{1}] - {2} - {3}", frmMain.pbProcValue, dr["entry"], cont.Number, cont.Text);
|
||||||
|
|
||||||
OleDbDataAdapter da = new OleDbDataAdapter("select * from [" + dr["entry"] + "] where sequence like ' %'", cn);
|
OleDbDataAdapter da = new OleDbDataAdapter("select * from [" + dr["entry"] + "] where sequence like ' %'", cn);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
LoadSection(ds, da, dr["entry"].ToString());
|
LoadSection(ds, da, dr["entry"].ToString());
|
||||||
da.SelectCommand.CommandText = "select * from [" + dr["entry"] + "] where step not like ' '";
|
da.SelectCommand.CommandText = "select * from [" + dr["entry"] + "] where step not like ' ' and step not like '%~'";
|
||||||
da.Fill(ds, "Steps");
|
da.Fill(ds, "Steps");
|
||||||
dt = ds.Tables["Steps"];
|
dt = ds.Tables["Steps"];
|
||||||
dt.CaseSensitive = true;
|
dt.CaseSensitive = true;
|
||||||
@ -119,71 +149,108 @@ namespace DataLoader
|
|||||||
log.ErrorFormat("{0}\r\n\r\n{1}", ex.Message, ex.InnerException);
|
log.ErrorFormat("{0}\r\n\r\n{1}", ex.Message, ex.InnerException);
|
||||||
log.Error(ex.StackTrace);
|
log.Error(ex.StackTrace);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// dicSecCount is dictionary to track number of subsections for the parent at a level
|
||||||
|
// dicSecID is the parent at that level
|
||||||
Dictionary<int, int> dicSecCount = new Dictionary<int, int>();
|
Dictionary<int, int> dicSecCount = new Dictionary<int, int>();
|
||||||
Dictionary<int, int> dicSecID = new Dictionary<int, int>();
|
Dictionary<int, Item> dicSecParentItem = new Dictionary<int, Item>();
|
||||||
pbSect.Maximum = ds.Tables["Sections"].Rows.Count;
|
frmMain.pbSectMaximum = ds.Tables["Sections"].Rows.Count;
|
||||||
pbSect.Value = 0;
|
frmMain.pbSectValue = 0;
|
||||||
|
|
||||||
DataTable dtsect = ds.Tables["Sections"];
|
DataTable dtsect = ds.Tables["Sections"];
|
||||||
dtsect.CaseSensitive = true;
|
dtsect.CaseSensitive = true;
|
||||||
DataView dv = new DataView(dtsect, "", "locb", DataViewRowState.CurrentRows);
|
DataView dv = new DataView(dtsect, "", "locb", DataViewRowState.CurrentRows);
|
||||||
|
Item SectItm = null;
|
||||||
|
int level = 0;
|
||||||
|
bool addpart = true;
|
||||||
|
Item parentitem = itm;
|
||||||
foreach (DataRowView drw in dv)
|
foreach (DataRowView drw in dv)
|
||||||
{
|
{
|
||||||
FrID = MigrateSection(prc, cn, drw, ds.Tables["Steps"], FrType, FrID, dicSecCount.Count > 0 ? true : false, pth);
|
SectItm = MigrateSection(parentitem, cont.Number, cn, drw, ds.Tables["Steps"], SectItm, dicSecCount.Count > 0 ? true : false, pth, docver);
|
||||||
if (prc.StructureID == 0)
|
|
||||||
|
// if no children, add first child (cont)
|
||||||
|
if (addpart)
|
||||||
{
|
{
|
||||||
prc.StructureID = FrID;
|
// ContentsParts.Add can use 'fromtype', item - fromtype here = 2, section
|
||||||
prc.Save(true); //force update
|
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;
|
//FrType = 0;
|
||||||
dicSecID[dicSecCount.Count] = FrID;
|
dicSecParentItem[level] = SectItm;
|
||||||
if (dicSecCount.Count > 0)
|
if (level > 0)
|
||||||
{
|
{
|
||||||
if ((dicSecCount[dicSecCount.Count]) == 1)
|
if ((dicSecCount[level]) == 1)
|
||||||
{
|
// shift up a level, i.e. give me the parent for the previous level
|
||||||
dicSecCount.Remove(dicSecCount.Count);
|
SectItm = dicSecParentItem[--level];
|
||||||
FrID = dicSecID[dicSecCount.Count];
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
dicSecCount[level]--; // decrements number of sections to process
|
||||||
dicSecCount[dicSecCount.Count] = dicSecCount[dicSecCount.Count] - 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
// get number of subsections for this section
|
||||||
int subSecs = drw["Sequence"].ToString().PadRight(12, ' ')[5] - 48;
|
int subSecs = drw["Sequence"].ToString().PadRight(12, ' ')[5] - 48;
|
||||||
if (subSecs > 0)
|
if (subSecs > 0)
|
||||||
{
|
{
|
||||||
dicSecCount[dicSecCount.Count + 1] = subSecs;
|
dicSecCount[++level] = subSecs;
|
||||||
FrType = 2;
|
cont = SectItm.MyContent;
|
||||||
|
parentitem = SectItm;
|
||||||
|
addpart = true;
|
||||||
|
SectItm = null; // no previous sibling for the first child node.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// need section start
|
||||||
if (EditSectId != 0)
|
if (EditSectId != 0)
|
||||||
{
|
{
|
||||||
prc.StructureStart = EditSectId;
|
if (ci == null) ci = new ConfigInfo(null);
|
||||||
EditSectId = 0;
|
ci.AddItem("Procedure", "SectionStart", string.Format("{0}", EditSectId));
|
||||||
prc.Save(true); // force update
|
itm.MyContent.Config = (ci == null) ? null : ci.ToString();
|
||||||
|
if (!itm.IsSavable) ErrorRpt.ErrorReport(itm);
|
||||||
|
itm.Save();
|
||||||
}
|
}
|
||||||
return str.StructureID;
|
return itm;
|
||||||
}
|
}
|
||||||
private Int32 MigrateProcedures(OleDbConnection cn, string pth)
|
private Item MigrateProcedures(OleDbConnection cn, string pth, DocVersion docver)
|
||||||
{
|
{
|
||||||
// Loop through Set File for each Procedure
|
// Loop through Set File for each Procedure
|
||||||
OleDbDataAdapter da = new OleDbDataAdapter("Select * from [set] where entry is not null", cn);
|
OleDbDataAdapter da = new OleDbDataAdapter("Select * from [set] where entry is not null", cn);
|
||||||
DataSet ds = new DataSet();
|
DataSet ds = new DataSet();
|
||||||
da.Fill(ds);
|
da.Fill(ds);
|
||||||
Byte FrType = 1;
|
Item FrItm = null;
|
||||||
Int32 FrID = 0;
|
Item FirstItm = null;
|
||||||
Int32 FirstID = 0;
|
frmMain.pbProcMaximum = ds.Tables[0].Rows.Count;
|
||||||
pbProc.Maximum = ds.Tables[0].Rows.Count;
|
frmMain.UpdateLabels(0, 0, 0);
|
||||||
UpdateLabels(0, 0, 0);
|
|
||||||
foreach (DataRow dr in ds.Tables[0].Rows)
|
foreach (DataRow dr in ds.Tables[0].Rows)
|
||||||
{
|
{
|
||||||
FrID = MigrateProcedure(cn, dr, FrType, FrID, pth);
|
FrItm = MigrateProcedure(cn, dr, FrItm, pth, docver);
|
||||||
if (FirstID == 0) FirstID = FrID;
|
if (FirstItm == null) FirstItm = FrItm;
|
||||||
FrType = 0;
|
|
||||||
}
|
}
|
||||||
da.Dispose();
|
da.Dispose();
|
||||||
return FirstID;
|
return FirstItm;
|
||||||
}
|
}
|
||||||
|
private void DbtOk(string fname)
|
||||||
|
{
|
||||||
|
string dbtname = frmMain.tbSourceText + "\\" + fname + ".dbt";
|
||||||
|
if (File.Exists(dbtname))
|
||||||
|
{
|
||||||
|
// check if dbt is at least 512, if not append 508 bytes. This is to fix
|
||||||
|
// a problem where dbts were created with only 4 bytes in the 16-bit code.
|
||||||
|
// if only 4 bytes, ado.net gives an "External table not in expected format"
|
||||||
|
// error
|
||||||
|
FileInfo fi = new FileInfo(dbtname);
|
||||||
|
if (fi.Length < 512)
|
||||||
|
{
|
||||||
|
FileStream fs = new FileStream(dbtname, FileMode.Open, FileAccess.Write, FileShare.ReadWrite);
|
||||||
|
BinaryWriter bw = new BinaryWriter(fs);
|
||||||
|
bw.Seek(0, SeekOrigin.End);
|
||||||
|
byte[] wrBytes = new byte[512 - fi.Length];
|
||||||
|
for (int i = 0; i < 512 - fi.Length; i++) wrBytes[i] = 0;
|
||||||
|
wrBytes[4] = 0x02;
|
||||||
|
bw.Write(wrBytes);
|
||||||
|
bw.Close();
|
||||||
|
}
|
||||||
|
fi = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -139,7 +139,8 @@ namespace DataLoader
|
|||||||
tmp.children = tmpg.children;
|
tmp.children = tmpg.children;
|
||||||
tmp.value = tmpg.value;
|
tmp.value = tmpg.value;
|
||||||
tmp.appid = tmpg.appid;
|
tmp.appid = tmpg.appid;
|
||||||
tmp.roid = TableID.ToString("X4") + tmp.ID.ToString("X8");
|
string tmpstr = TableID.ToString("X4") + tmp.ID.ToString("X8");
|
||||||
|
tmp.roid = tmpstr.ToUpper();
|
||||||
dicRos.Add(tmp.roid, tmp);
|
dicRos.Add(tmp.roid, tmp);
|
||||||
int j;
|
int j;
|
||||||
for (j = i - 1; j >= 0 && tmp.ID < myGrp.children[j].ID; j--)
|
for (j = i - 1; j >= 0 && tmp.ID < myGrp.children[j].ID; j--)
|
||||||
|
@ -19,19 +19,13 @@ using System.Collections.Generic;
|
|||||||
using System.Xml;
|
using System.Xml;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Volian.CSLA.Library;
|
using VEPROMS.CSLA.Library;
|
||||||
|
|
||||||
namespace DataLoader
|
namespace DataLoader
|
||||||
{
|
{
|
||||||
public partial class frmLoader : Form
|
public partial class Loader
|
||||||
{
|
{
|
||||||
private void AddRoUsage(int structId, string ROID)
|
private string MigrateRos(OleDbConnection cn, string textm, string seqcvt, Content content)
|
||||||
{
|
|
||||||
RoUsage ro = RoUsage.MakeRoUsage(structId, ROID);
|
|
||||||
ro.StructureID = structId;
|
|
||||||
ro.ROID = ROID;
|
|
||||||
}
|
|
||||||
private string MigrateRos(OleDbConnection cn, string textm, string seqcvt, int structId)
|
|
||||||
{
|
{
|
||||||
StringBuilder rotxt = new StringBuilder();
|
StringBuilder rotxt = new StringBuilder();
|
||||||
int instance = 0;
|
int instance = 0;
|
||||||
@ -39,7 +33,7 @@ namespace DataLoader
|
|||||||
DataTable dt = null;
|
DataTable dt = null;
|
||||||
DataSet ds = null;
|
DataSet ds = null;
|
||||||
OleDbDataAdapter da = null;
|
OleDbDataAdapter da = null;
|
||||||
//TODO: ZSteps
|
|
||||||
string cmd = "SELECT * FROM USAGERO WHERE [NUMBER]='" + ProcNumber.Replace("'", "''") + "' AND [SEQUENCE] ='" + seqcvt + "' ORDER BY [INSTANCE]";
|
string cmd = "SELECT * FROM USAGERO WHERE [NUMBER]='" + ProcNumber.Replace("'", "''") + "' AND [SEQUENCE] ='" + seqcvt + "' ORDER BY [INSTANCE]";
|
||||||
da = new OleDbDataAdapter(cmd, cn);
|
da = new OleDbDataAdapter(cmd, cn);
|
||||||
// get usage records for the ROID.
|
// get usage records for the ROID.
|
||||||
@ -63,17 +57,26 @@ namespace DataLoader
|
|||||||
// found a token, add the roid & value into the string and
|
// found a token, add the roid & value into the string and
|
||||||
// add an ro usage for it.
|
// add an ro usage for it.
|
||||||
rotxt.Append(textm.Substring(beg, tok - beg));
|
rotxt.Append(textm.Substring(beg, tok - beg));
|
||||||
DataRow dr = dt.Rows[instance];
|
if (instance < dt.Rows.Count)
|
||||||
string ROID = dr["ROID"].ToString();
|
{
|
||||||
AddRoUsage(structId, ROID);
|
DataRow dr = dt.Rows[instance];
|
||||||
rotxt.Append("\x15{{");
|
string ROID = dr["ROID"].ToString();
|
||||||
rotxt.Append(ROID);
|
RoUsage ro = RoUsage.MakeRoUsage(content, ROID, null, DateTime.Now, "Migration");
|
||||||
rotxt.Append("}{");
|
rotxt.Append("\x15\\v RO\\v0 ");
|
||||||
|
string val = rofst.GetRoValue(ROID.Substring(0, 12).ToUpper());
|
||||||
string val = rofst.GetRoValue(ROID.Substring(0, 12));
|
rotxt.Append(val);
|
||||||
rotxt.Append(val);
|
rotxt.Append("\\v #");
|
||||||
rotxt.Append("}}");
|
rotxt.Append(ro.ROUsageID.ToString());
|
||||||
instance++;
|
rotxt.Append(" ");
|
||||||
|
rotxt.Append(ROID);
|
||||||
|
rotxt.Append("\\v0 ");
|
||||||
|
instance++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
log.Error("Error setting RO data in text field");
|
||||||
|
log.ErrorFormat("proc number = {0}, oldstepsequence = {1}, instance = {2}", ProcNumber, seqcvt, instance);
|
||||||
|
}
|
||||||
beg = tok + 1;
|
beg = tok + 1;
|
||||||
if (beg > textm.Length)
|
if (beg > textm.Length)
|
||||||
{
|
{
|
||||||
@ -89,4 +92,5 @@ namespace DataLoader
|
|||||||
return rotxt.ToString();
|
return rotxt.ToString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -15,7 +15,7 @@ using System.Collections.Generic;
|
|||||||
using System.Collections.Specialized;
|
using System.Collections.Specialized;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Volian.CSLA.Library;
|
using VEPROMS.CSLA.Library;
|
||||||
using Config;
|
using Config;
|
||||||
|
|
||||||
namespace DataLoader
|
namespace DataLoader
|
||||||
@ -584,13 +584,15 @@ namespace DataLoader
|
|||||||
Role role = Role.New();
|
Role role = Role.New();
|
||||||
role.Name = defaultRole[i];
|
role.Name = defaultRole[i];
|
||||||
role.Title = defaultRoleTitle[i];
|
role.Title = defaultRoleTitle[i];
|
||||||
role.Save();
|
if (!role.IsSavable) ErrorRpt.ErrorReport(role);
|
||||||
|
role.Save();
|
||||||
Permission perm = Permission.New();
|
Permission perm = Permission.New();
|
||||||
perm.RID = role.RID;
|
perm.MyRole = role;
|
||||||
perm.PermLevel = defaultPermData[i, 0];
|
perm.PermLevel = defaultPermData[i, 0];
|
||||||
perm.VersionType = defaultPermData[i, 1];
|
perm.VersionType = defaultPermData[i, 1];
|
||||||
perm.PermValue = defaultPermData[i, 2];
|
perm.PermValue = defaultPermData[i, 2];
|
||||||
perm.Save();
|
if (!perm.IsSavable) ErrorRpt.ErrorReport(perm);
|
||||||
|
perm.Save();
|
||||||
rdic.Add(role.RID, role);
|
rdic.Add(role.RID, role);
|
||||||
for (int j = 1; j < accessLevelSetup.Length; j++)
|
for (int j = 1; j < accessLevelSetup.Length; j++)
|
||||||
{
|
{
|
||||||
@ -755,7 +757,7 @@ namespace DataLoader
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
MessageBox.Show("here");
|
MessageBox.Show("here: " + ex.Message);
|
||||||
}
|
}
|
||||||
if (!dicOldFolders.ContainsKey(pl.Path.ToUpper()+"\\"+ps.Path.ToUpper()))dicOldFolders.Add(pl.Path.ToUpper()+"\\"+ps.Path.ToUpper(), oldFolderCount++);
|
if (!dicOldFolders.ContainsKey(pl.Path.ToUpper()+"\\"+ps.Path.ToUpper()))dicOldFolders.Add(pl.Path.ToUpper()+"\\"+ps.Path.ToUpper(), oldFolderCount++);
|
||||||
string sName = FixName(ps.Name);
|
string sName = FixName(ps.Name);
|
||||||
@ -880,12 +882,17 @@ namespace DataLoader
|
|||||||
}
|
}
|
||||||
if (pathInData>0)
|
if (pathInData>0)
|
||||||
{
|
{
|
||||||
|
if (!grp.IsSavable) ErrorRpt.ErrorReport(grp);
|
||||||
|
grp.Save();
|
||||||
|
Folder tmpfld = Folder.Get(pathInData);
|
||||||
foreach (int roleId in accessRights[folderId])
|
foreach (int roleId in accessRights[folderId])
|
||||||
{
|
{
|
||||||
grp.GroupAssignments.Add(roleId, pathInData);
|
Role tmprole = Role.Get(roleId);
|
||||||
|
grp.GroupAssignments.Add(tmprole, tmpfld);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!grp.IsSavable) ErrorRpt.ErrorReport(grp);
|
||||||
grp.Save();
|
grp.Save();
|
||||||
dicGroupIds[s] = grp.GID;
|
dicGroupIds[s] = grp.GID;
|
||||||
}
|
}
|
||||||
@ -901,8 +908,10 @@ namespace DataLoader
|
|||||||
newusr.UserID = sUser;
|
newusr.UserID = sUser;
|
||||||
ConfigFile cfg = new ConfigFile();
|
ConfigFile cfg = new ConfigFile();
|
||||||
cfg.LoadUsrCfg(newusr);
|
cfg.LoadUsrCfg(newusr);
|
||||||
newusr.UserMemberships.Add(dicGroupIds[s]);
|
Group tmpgrp = Group.Get(dicGroupIds[s]);
|
||||||
newusr.Save();
|
newusr.UserMemberships.Add(tmpgrp);
|
||||||
|
if (!newusr.IsSavable) ErrorRpt.ErrorReport(newusr);
|
||||||
|
newusr.Save();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -17,55 +17,52 @@ using System.Data.OleDb;
|
|||||||
using System.Collections.Specialized;
|
using System.Collections.Specialized;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Xml;
|
using System.Xml;
|
||||||
|
using System.Xml.XPath;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Volian.CSLA.Library;
|
using VEPROMS.CSLA.Library;
|
||||||
|
|
||||||
|
|
||||||
namespace DataLoader
|
namespace DataLoader
|
||||||
{
|
{
|
||||||
public partial class frmLoader : Form
|
public partial class Loader
|
||||||
{
|
{
|
||||||
private Section AddSection(string Number, string Title, DateTime Dts, string Userid, ConfigInfo ci, string stpseq, string fmt, int libdocid, string pth)
|
private Dictionary<string, int> dicOldToNew;
|
||||||
|
private Item AddSection(Item procitem, string Number, string Title, string SecType, DateTime Dts, string Userid, ConfigInfo ci, string stpseq, string fmt, int libdocid, string pth, Item FromItem, DocVersion docver)
|
||||||
{
|
{
|
||||||
UpdateLabels(0, 1, 0);
|
frmMain.UpdateLabels(0, 1, 0);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
string Format = null;
|
Format format = null;
|
||||||
|
|
||||||
|
// Tie the section to format used, this will add the format xml if it doesn't exist in
|
||||||
|
// the database yet. Note that if there is no format at this level then none should
|
||||||
|
// be set so that the inheritance works correctly.
|
||||||
|
if (fmt != null && fmt != "") format = GetFormat(fmt);
|
||||||
|
|
||||||
// do the format field, an xpath for the format & last part is column
|
// Find the docstyle based on the section type (step[1]) & the 'type' from the dbf
|
||||||
// mode if a step section.
|
// record sectype[0])
|
||||||
try
|
string dstyleindx = ((stpseq == null || stpseq == "") ? " " : stpseq.Substring(1, 1)) + ((SecType==null||SecType == "") ? " " : SecType.Substring(0, 1));
|
||||||
|
int docstyleindx = GetDocStyleIndx(dstyleindx, format, procitem, docver);
|
||||||
|
|
||||||
|
// tack on the column mode - add to config xml for node.
|
||||||
|
if (stpseq != null && stpseq.Substring(1, 1) == "0" && stpseq.Substring(5, 1) != " ")
|
||||||
{
|
{
|
||||||
if (fmt != null && fmt != "")
|
if (ci == null) ci = new ConfigInfo(null);
|
||||||
{
|
ci.AddItem("Section", "ColumnMode", stpseq.Substring(5, 1));
|
||||||
if (fmt.IndexOf(' ') > -1) // will have spaces if it's a user format
|
|
||||||
{
|
|
||||||
string part1 = "/" + fmt.Substring(0, fmt.IndexOf(' ')) + "/";
|
|
||||||
string part2 = "USER=" + fmt.Substring(fmt.LastIndexOf(' ') + 1, 2);
|
|
||||||
Format = part1 + part2;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
Format = "/" + fmt;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
log.ErrorFormat("Error getting format {0}", ex.Message);
|
|
||||||
}
|
|
||||||
// tack on the column mode:
|
|
||||||
if (stpseq != null && stpseq.Substring(1, 1) == "0" && stpseq.Substring(5, 1) != " ") Format = Format + "/COL=" + stpseq.Substring(5, 1);
|
|
||||||
|
|
||||||
// find rtf file (or use the library document temp file) & read it into the field
|
// find rtf file (or use the library document temp file) & read it into the field
|
||||||
// acccontent
|
// acccontent
|
||||||
int Contentid=0;
|
int Documentid=0;
|
||||||
byte ContentType=0;
|
bool needEntry = false;
|
||||||
if (libdocid != 0 || stpseq.Substring(1, 1) != "0")
|
if (libdocid != 0 || stpseq.Substring(1, 1) != "0")
|
||||||
{
|
{
|
||||||
|
needEntry = true;
|
||||||
string fname = null;
|
string fname = null;
|
||||||
if (libdocid != 0)
|
if (libdocid != 0)
|
||||||
{
|
{
|
||||||
Contentid = libdocid;
|
Documentid = libdocid;
|
||||||
ContentType = 2;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -73,13 +70,53 @@ namespace DataLoader
|
|||||||
string thenum = num.ToString("d2");
|
string thenum = num.ToString("d2");
|
||||||
fname = string.Format("{0}\\rtffiles\\{1}.A{2}", pth, ProcFileName, thenum);
|
fname = string.Format("{0}\\rtffiles\\{1}.A{2}", pth, ProcFileName, thenum);
|
||||||
Application.DoEvents();
|
Application.DoEvents();
|
||||||
SaveSectionDocument(fname, stpseq, ref ContentType, ref Contentid);
|
SaveSectionDocument(fname, stpseq, ref Documentid);
|
||||||
|
if (Documentid == 0)
|
||||||
|
{
|
||||||
|
if (MissingDocument==null) MissingDocument = Document.MakeDocument("MISSING FILE IN CONVERSION", null, null, null);
|
||||||
|
Documentid = MissingDocument.DocID;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (Userid == null || Userid == "") Userid = "Migration";
|
||||||
|
|
||||||
Section sec = Section.MakeSection(Number, Title,ContentType, Contentid, Format, ci.ToString(), Dts, Userid);
|
// test for performance
|
||||||
dicOldStepSequence[sec] = stpseq;
|
Content cont = Content.New(Number, Title, 10000+docstyleindx, format, ci==null?null:ci.ToString(), Dts, Userid);
|
||||||
return sec;
|
Entry entry = cont.MyEntry;
|
||||||
|
if (needEntry)
|
||||||
|
{
|
||||||
|
entry.MyDocument = Document.Get(Documentid);
|
||||||
|
entry.DTS = Dts;
|
||||||
|
entry.UserID = Userid;
|
||||||
|
//entry = Entry.MakeEntry(cont.ContentID, Document.Get(Documentid), Dts, Userid);
|
||||||
|
}
|
||||||
|
cont.MyZContent.OldStepSequence = ProcNumber + "|" + stpseq;
|
||||||
|
Item itm = null;
|
||||||
|
// the stpseq for section records may include a space & some other data. This
|
||||||
|
// was not part of what is stored in the transition records, so just look at
|
||||||
|
// the sequence before the space for section records. Then use the first character
|
||||||
|
// with a '0'. This is what's stored in the transition record, for example, if the
|
||||||
|
// section was BI, the transition record would have B0 (the reasoning is that
|
||||||
|
// for steps, this is what could be stored if there were enough steps.
|
||||||
|
int trindxsp = stpseq.IndexOf(' ');
|
||||||
|
string trstpseq = trindxsp < 0 ? stpseq : stpseq.Substring(0, 1)+ "0";
|
||||||
|
if (dicTrans_ItemIds.ContainsKey(ProcNumber + "|" + trstpseq))
|
||||||
|
{
|
||||||
|
itm = dicTrans_ItemIds[ProcNumber + "|" + trstpseq];
|
||||||
|
itm.MyContent = cont;
|
||||||
|
itm.MyPrevious = FromItem;
|
||||||
|
itm.DTS = Dts;
|
||||||
|
itm.UserID = Userid;
|
||||||
|
if (!itm.IsSavable) ErrorRpt.ErrorReport(itm);
|
||||||
|
itm.Save();
|
||||||
|
dicTrans_ItemIds.Remove(ProcNumber + "|" + trstpseq);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
itm = Item.MakeItem(FromItem, cont, Dts, Userid);
|
||||||
|
|
||||||
|
dicTrans_ItemDone[ProcNumber+"|"+trstpseq] = itm;
|
||||||
|
dicOldStepSequence[itm] = stpseq;
|
||||||
|
return itm;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@ -90,11 +127,106 @@ namespace DataLoader
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
private string SectTitle(OleDbConnection cn, DataRowView dr)
|
|
||||||
|
private int LookupOldToNew(string lkup)
|
||||||
|
{
|
||||||
|
if (dicOldToNew == null)
|
||||||
|
{
|
||||||
|
dicOldToNew = new Dictionary<string, int>();
|
||||||
|
//dicOldToNew.Add("", 1);
|
||||||
|
dicOldToNew.Add("0", 1);
|
||||||
|
dicOldToNew.Add("0 ", 1);
|
||||||
|
dicOldToNew.Add("00", 1);
|
||||||
|
dicOldToNew.Add("01", 2);
|
||||||
|
dicOldToNew.Add("02", 4);
|
||||||
|
dicOldToNew.Add("03", 8);
|
||||||
|
dicOldToNew.Add("04", 16);
|
||||||
|
dicOldToNew.Add("I", 32);
|
||||||
|
dicOldToNew.Add("I ", 32);
|
||||||
|
dicOldToNew.Add("I0", 32);
|
||||||
|
dicOldToNew.Add("I1", 64);
|
||||||
|
dicOldToNew.Add("I2", 128);
|
||||||
|
dicOldToNew.Add("I3", 256);
|
||||||
|
dicOldToNew.Add("I4", 512);
|
||||||
|
dicOldToNew.Add("A", 1024);
|
||||||
|
dicOldToNew.Add("A ", 1024);
|
||||||
|
dicOldToNew.Add("A0", 1024);
|
||||||
|
dicOldToNew.Add("A1", 2048);
|
||||||
|
dicOldToNew.Add("A2", 4096);
|
||||||
|
dicOldToNew.Add("A3", 8192);
|
||||||
|
dicOldToNew.Add("A4", 16384);
|
||||||
|
dicOldToNew.Add("F", 32768);
|
||||||
|
dicOldToNew.Add("F ", 32768);
|
||||||
|
dicOldToNew.Add("F0", 32768);
|
||||||
|
dicOldToNew.Add("F1", 65536);
|
||||||
|
dicOldToNew.Add("F2", 131072);
|
||||||
|
dicOldToNew.Add("F3", 262144);
|
||||||
|
dicOldToNew.Add("F4", 524288);
|
||||||
|
dicOldToNew.Add("05", 1048576);
|
||||||
|
dicOldToNew.Add("06", 2097152);
|
||||||
|
dicOldToNew.Add("07", 4194304);
|
||||||
|
dicOldToNew.Add("08", 8388608);
|
||||||
|
dicOldToNew.Add("09", 16777216);
|
||||||
|
dicOldToNew.Add("0:", 33554432);
|
||||||
|
dicOldToNew.Add("0;", 67108864);
|
||||||
|
dicOldToNew.Add("0<", 134217728);
|
||||||
|
dicOldToNew.Add("0=", 268435456);
|
||||||
|
dicOldToNew.Add("0>", 536870912);
|
||||||
|
}
|
||||||
|
int retval = -1;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
retval = dicOldToNew[lkup];
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Console.WriteLine(string.Format("Error in oldtonew {0}", lkup));
|
||||||
|
Console.WriteLine(string.Format("Error = {0}", ex.Message));
|
||||||
|
}
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
private int GetDocStyleIndx(string dstyleindx, Format format, Item procitem, DocVersion docver)
|
||||||
|
{
|
||||||
|
// get the format, if format is set, use it, otherwise walk
|
||||||
|
if (format == null)
|
||||||
|
{
|
||||||
|
format = GetFormat(procitem, docver);
|
||||||
|
}
|
||||||
|
int docstyle = LookupOldToNew(dstyleindx);
|
||||||
|
foreach (DocStyle ds in format.PlantFormat.DocStyles.DocStyleList)
|
||||||
|
{
|
||||||
|
if ((ds.OldToNew & docstyle)>0) return (int)ds.Index;
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
private Format GetFormat(Item procitem, DocVersion docver)
|
||||||
|
{
|
||||||
|
while (procitem.MyContent.MyFormat == null)
|
||||||
|
{
|
||||||
|
// find the first sibling
|
||||||
|
while (procitem.PreviousID != null)
|
||||||
|
procitem = procitem.MyPrevious;
|
||||||
|
if (procitem.ItemPartCount == 0) return GetFormat(docver);
|
||||||
|
// find the parent node
|
||||||
|
procitem = procitem.ItemParts[0].MyContent.ContentItems[0].MyItem;
|
||||||
|
}
|
||||||
|
return procitem.MyContent.MyFormat;
|
||||||
|
}
|
||||||
|
private Format GetFormat(DocVersion docver)
|
||||||
|
{
|
||||||
|
if (docver.MyFormat != null) return docver.MyFormat;
|
||||||
|
return GetFormat(docver.MyFolder);
|
||||||
|
}
|
||||||
|
private Format GetFormat(Folder folder)
|
||||||
|
{
|
||||||
|
if (folder.MyFormat != null) return folder.MyFormat;
|
||||||
|
return GetFormat(folder.MyParent);
|
||||||
|
}
|
||||||
|
private string SectTitle(OleDbConnection cn, DataRowView dr, bool UseMultiLineSectionTitle, bool ConvertCaret)
|
||||||
{
|
{
|
||||||
string tbuff = null;
|
string tbuff = null;
|
||||||
string menustr = null;
|
string menustr = null;
|
||||||
bool UseMultiLineSectionTitle = false; // TODO KBR: format flag
|
|
||||||
if (UseMultiLineSectionTitle)
|
if (UseMultiLineSectionTitle)
|
||||||
{
|
{
|
||||||
bool titleInMemo = false;
|
bool titleInMemo = false;
|
||||||
@ -112,11 +244,11 @@ namespace DataLoader
|
|||||||
if (ds.Tables[0].Rows.Count == 1)
|
if (ds.Tables[0].Rows.Count == 1)
|
||||||
{
|
{
|
||||||
DataRow row = ds.Tables[0].Rows[0];
|
DataRow row = ds.Tables[0].Rows[0];
|
||||||
tbuff = TextConvert.ConvertText(row["Textm"].ToString());
|
tbuff = TextConvert.ConvertText(row["Textm"].ToString(),ConvertCaret);
|
||||||
if (tbuff != null || tbuff[0] != '\0') titleInMemo = true;
|
if (tbuff != null && tbuff != "") titleInMemo = true;
|
||||||
}
|
}
|
||||||
else // no long section title existed for this accessory page
|
else // no long section title existed for this accessory page
|
||||||
tbuff = TextConvert.ConvertText(dr["Text"].ToString().PadRight(130, ' ').Substring(0, 75).TrimEnd());
|
tbuff = TextConvert.ConvertText(dr["Text"].ToString().PadRight(130, ' ').Substring(0, 75).TrimEnd(), ConvertCaret);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@ -127,45 +259,69 @@ namespace DataLoader
|
|||||||
// (see above comment for accessory pages to see the difference)
|
// (see above comment for accessory pages to see the difference)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
tbuff = TextConvert.ConvertText(dr["TextM"].ToString().Trim());
|
tbuff = TextConvert.ConvertText(dr["TextM"].ToString().Trim(), ConvertCaret);
|
||||||
}
|
}
|
||||||
|
|
||||||
//// TESTS were run & it looked like that whitespace was removed before saving,
|
//// TESTS were run & it looked like that whitespace was removed before saving,
|
||||||
//// so, put up a message box if find out otherwise....
|
//// so, put up a message box if find out otherwise....
|
||||||
int nl = tbuff.IndexOf("\n");
|
//int nl = tbuff.IndexOf("\n");
|
||||||
if (nl > -1)
|
//if (nl > -1)
|
||||||
MessageBox.Show("multiline text for section title, fix this!!");
|
// MessageBox.Show("multiline text for section title, fix this!!");
|
||||||
|
|
||||||
//// remove newlines & any other escape/whitespace chars.
|
//// remove newlines & any other escape/whitespace chars.
|
||||||
//int nl = tbuff.IndexOf("\n");
|
int nl = tbuff.IndexOf("\n");
|
||||||
//if (nl > -1 || titleInMemo)
|
if (nl > -1 || titleInMemo)
|
||||||
//{
|
{
|
||||||
|
|
||||||
// string tmpstr = tbuff.Replace("\r", "");
|
string tmpstr = tbuff.Replace("\r", "");
|
||||||
// tmpstr = tmpstr.Replace("\t", "");
|
tmpstr = tmpstr.Replace("\t", "");
|
||||||
// tmpstr = tmpstr.Replace("\n", " ");
|
tmpstr = tmpstr.Replace("\n", " ");
|
||||||
// // get rid of multiple spaces
|
// get rid of multiple spaces
|
||||||
// while (tmpstr.IndexOf(" ") > -1) tmpstr = tmpstr.Replace(" ", " ");
|
while (tmpstr.IndexOf(" ") > -1) tmpstr = tmpstr.Replace(" ", " ");
|
||||||
// tbuff = tmpstr;
|
tbuff = tmpstr;
|
||||||
// if (tbuff.Substring(tbuff.Length-1, 1) == " ") tbuff = tbuff.Substring(0, tbuff.Length - 1);
|
if (tbuff.Substring(tbuff.Length - 1, 1) == " ") tbuff = tbuff.Substring(0, tbuff.Length - 1);
|
||||||
//}
|
menustr = tbuff;
|
||||||
//menustr = tbuff;
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
menustr = TextConvert.ConvertText(dr["Text"].ToString().PadRight(80, ' ').Substring(0, 75).TrimEnd(), ConvertCaret);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // format does not include long section title
|
{ // format does not include long section title
|
||||||
menustr = TextConvert.ConvertText(dr["Text"].ToString().PadRight(80, ' ').Substring(0, 75).TrimEnd());
|
menustr = TextConvert.ConvertText(dr["Text"].ToString().PadRight(80, ' ').Substring(0, 75).TrimEnd(), ConvertCaret);
|
||||||
}
|
}
|
||||||
return menustr;
|
return menustr;
|
||||||
}
|
}
|
||||||
private Int32 MigrateSection(Procedure prc, OleDbConnection cn, DataRowView dr, DataTable dt, Byte FromType, Int32 FromID, bool isSubSection, string pth)
|
private Item MigrateSection(Item procitem, string procnum, OleDbConnection cn, DataRowView dr, DataTable dt, Item FromItem, bool isSubSection, string pth, DocVersion docver)
|
||||||
{
|
{
|
||||||
Int32 thesectid = 0;
|
Int32 thesectid = 0;
|
||||||
bool islibdoc = false;
|
bool isautogen = false;
|
||||||
//bool hasxml = false;
|
string stype = dr["type"].ToString();
|
||||||
string s = dr["text"].ToString().PadRight(130, ' ');
|
string s = dr["text"].ToString().PadRight(130, ' ');
|
||||||
string num = s.Substring(85, 20).TrimEnd();
|
string num = s.Substring(85, 20).TrimEnd();
|
||||||
string fmt = s.Substring(75, 10).TrimEnd();
|
string fmt = s.Substring(75, 10).TrimEnd();
|
||||||
string title = SectTitle(cn, dr);
|
if (fmt == "") fmt = null;
|
||||||
|
bool ismulti = false;
|
||||||
|
bool conv_caret = true;
|
||||||
|
|
||||||
|
// sectFormat is a local that represents the format to be used by this section.
|
||||||
|
// Note that if the format is set for this section, check it against what the inherited
|
||||||
|
// value would be (for example, what the format is for the set), if they are the same
|
||||||
|
// clear the format at the section level.
|
||||||
|
Format sectFormat = null;
|
||||||
|
Format docverFormat = docver.ActiveFormat;
|
||||||
|
if (fmt != null&& fmt !="") // Is there a long section title (from format flag)
|
||||||
|
sectFormat = GetFormat(fmt);
|
||||||
|
else // either from this format, or the plant.
|
||||||
|
sectFormat = docverFormat;
|
||||||
|
if (sectFormat != null)
|
||||||
|
{
|
||||||
|
ismulti = sectFormat.PlantFormat.FormatData.XtraOptions("UseMultiLineSectionTitle");
|
||||||
|
conv_caret = !(sectFormat.PlantFormat.FormatData.XtraOptions("DontConvertCarrotToDelta"));
|
||||||
|
}
|
||||||
|
if (fmt != null && fmt != "") if (fmt == docverFormat.Name) fmt = null;
|
||||||
|
string title = SectTitle(cn, dr, ismulti, conv_caret);
|
||||||
string init = dr["initials"].ToString().Trim();
|
string init = dr["initials"].ToString().Trim();
|
||||||
string sequence = dr["CSequence"].ToString().PadRight(10);
|
string sequence = dr["CSequence"].ToString().PadRight(10);
|
||||||
string step = dr["CStep"].ToString();
|
string step = dr["CStep"].ToString();
|
||||||
@ -173,7 +329,8 @@ namespace DataLoader
|
|||||||
|
|
||||||
DateTime dts = GetDTS(dr["Date"].ToString(), dr["Time"].ToString());
|
DateTime dts = GetDTS(dr["Date"].ToString(), dr["Time"].ToString());
|
||||||
|
|
||||||
ConfigInfo ci = new ConfigInfo(null);
|
ConfigInfo ci = null;
|
||||||
|
|
||||||
// for steps sections...
|
// for steps sections...
|
||||||
// Step Section Header Format:
|
// Step Section Header Format:
|
||||||
// A0 1X2S51 &Y
|
// A0 1X2S51 &Y
|
||||||
@ -199,37 +356,40 @@ namespace DataLoader
|
|||||||
// set pagination, continuous, separate. If blank, don't create attribute - uses format default.
|
// set pagination, continuous, separate. If blank, don't create attribute - uses format default.
|
||||||
if (sequence.Substring(4, 1) == "T")
|
if (sequence.Substring(4, 1) == "T")
|
||||||
{
|
{
|
||||||
|
if(ci==null) ci = new ConfigInfo(null);
|
||||||
ci.AddItem("Section", "Pagination", "C");
|
ci.AddItem("Section", "Pagination", "C");
|
||||||
//hasxml = SetXml(xmldoc, topElement, "Section", "Pagination", "C");
|
|
||||||
}
|
}
|
||||||
else if (sequence.Substring(4, 1) == "S")
|
else if (sequence.Substring(4, 1) == "S")
|
||||||
{
|
{
|
||||||
|
if (ci == null) ci = new ConfigInfo(null);
|
||||||
ci.AddItem("Section", "Pagination", "S");
|
ci.AddItem("Section", "Pagination", "S");
|
||||||
//hasxml = SetXml(xmldoc, topElement, "Section", "Pagination", "S");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Step: linked to enhanced (!exist = N)
|
// Step: linked to enhanced (!exist = N)
|
||||||
if (sequence.Substring(7, 1) == "1")
|
if (sequence.Substring(7, 1) == "1")
|
||||||
{
|
{
|
||||||
|
if (ci == null) ci = new ConfigInfo(null);
|
||||||
ci.AddItem("Step", "LnkEnh", "Y");
|
ci.AddItem("Step", "LnkEnh", "Y");
|
||||||
//hasxml = SetXml(xmldoc, topElement, "Step", "LnkEnh", "Y");
|
|
||||||
}
|
}
|
||||||
char cbittst = sequence.PadRight(10)[8];
|
char cbittst = sequence.PadRight(10)[8];
|
||||||
if (cbittst == ' ') cbittst = '\0';
|
if (cbittst == ' ')
|
||||||
|
cbittst = '\0';
|
||||||
// determine if TOC element (!exist = N)
|
else
|
||||||
if ((cbittst & TOC) > 1)
|
|
||||||
{
|
{
|
||||||
ci.AddItem("Section", "TOC", "Y");
|
// determine if TOC element (!exist = N)
|
||||||
//hasxml = SetXml(xmldoc, topElement, "Section", "TOC", "Y");
|
if ((cbittst & TOC) > 1)
|
||||||
|
{
|
||||||
|
if (ci == null) ci = new ConfigInfo(null);
|
||||||
|
ci.AddItem("Section", "TOC", "Y");
|
||||||
|
}
|
||||||
|
// determine if autogenerated section (!exist = N)
|
||||||
|
if ((cbittst & AUTOGEN) > 1)
|
||||||
|
{
|
||||||
|
isautogen = true;
|
||||||
|
if (ci == null) ci = new ConfigInfo(null);
|
||||||
|
ci.AddItem("Section", "AutoGen", "Y");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// determine if autogenerated section (!exist = N)
|
|
||||||
if ((cbittst & AUTOGEN) > 1)
|
|
||||||
{
|
|
||||||
ci.AddItem("Section", "AutoGen", "Y");
|
|
||||||
//hasxml = SetXml(xmldoc, topElement, "Section", "AutoGen", "Y");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Here are subsection flags, i.e. the following are only set if this
|
// Here are subsection flags, i.e. the following are only set if this
|
||||||
// is a subsection.
|
// is a subsection.
|
||||||
bool didsub = false;
|
bool didsub = false;
|
||||||
@ -238,29 +398,29 @@ namespace DataLoader
|
|||||||
// Subsection: editable (!exist = Y)
|
// Subsection: editable (!exist = Y)
|
||||||
if ((cbittst & EDDATA) > 0)
|
if ((cbittst & EDDATA) > 0)
|
||||||
{
|
{
|
||||||
|
if (ci == null) ci = new ConfigInfo(null);
|
||||||
ci.AddItem("SubSection", "Edit", "N");
|
ci.AddItem("SubSection", "Edit", "N");
|
||||||
//SetXml(xmldoc, topElement, "SubSection", "Edit", "N");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Subsection: print section headers (!exist = Y)
|
// Subsection: print section headers (!exist = Y)
|
||||||
if ((cbittst & PH) > 0)
|
if ((cbittst & PH) > 0)
|
||||||
{
|
{
|
||||||
|
if (ci == null) ci = new ConfigInfo(null);
|
||||||
didsub = true;
|
didsub = true;
|
||||||
ci.AddItem("SubSection", "PH", "N");
|
ci.AddItem("SubSection", "PH", "N");
|
||||||
//SetXml(xmldoc, topElement, "SubSection", "PH", "N");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Subsection: autoindent (!exist = Y)
|
// Subsection: autoindent (!exist = Y)
|
||||||
if ((cbittst & AUTOIND) > 0)
|
if ((cbittst & AUTOIND) > 0)
|
||||||
{
|
{
|
||||||
|
if (ci == null) ci = new ConfigInfo(null);
|
||||||
ci.AddItem("SubSection", "AutoIndent", "N");
|
ci.AddItem("SubSection", "AutoIndent", "N");
|
||||||
//SetXml(xmldoc, topElement, "SubSection", "AutoIndent", "N");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!didsub && sequence.Substring(4, 1) == "N")
|
if (!didsub && sequence.Substring(4, 1) == "N")
|
||||||
{
|
{
|
||||||
|
if (ci == null) ci = new ConfigInfo(null);
|
||||||
ci.AddItem("SubSection", "PH", "N");
|
ci.AddItem("SubSection", "PH", "N");
|
||||||
//SetXml(xmldoc, topElement, "SubSection", "PH", "N");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -273,26 +433,29 @@ namespace DataLoader
|
|||||||
// || `--- Position within the procedure
|
// || `--- Position within the procedure
|
||||||
// |`----- Acc. page type (A,I, or F)
|
// |`----- Acc. page type (A,I, or F)
|
||||||
// `------ Internal section number (starts at A)
|
// `------ Internal section number (starts at A)
|
||||||
|
if (ci == null) ci = new ConfigInfo(null);
|
||||||
ci.AddItem("Section", "NumPages", sequence.Substring(3, 1));
|
ci.AddItem("Section", "NumPages", sequence.Substring(3, 1));
|
||||||
//hasxml = SetXml(xmldoc, topElement, "Section", "NumPages", sequence.Substring(3, 1));
|
|
||||||
|
|
||||||
// see if it's a libdoc too.0
|
// see if it's a libdoc too
|
||||||
string thekey = prc.Number.PadRight(20) + step.Substring(0, 1).PadRight(10);
|
string thekey = procnum.PadRight(20) + step.Substring(0, 1).PadRight(10);
|
||||||
if (dicLibDocRef.ContainsKey(thekey))
|
if (dicLibDocRef.ContainsKey(thekey))
|
||||||
{
|
{
|
||||||
// if it is a library document, see if the section record has already been
|
// if it is a library document, see if the section record has already been
|
||||||
// saved. If it has, just use this section id, otherwise, create the
|
// saved. If it has, just use this section id, otherwise, create the
|
||||||
// section record with info from the library document file.
|
// section record with info from the library document file.
|
||||||
libDocid = dicLibDocRef[thekey];
|
libDocid = dicLibDocRef[thekey];
|
||||||
islibdoc = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Section sec = AddSection(num, title, dts, init, ci, step + sequence, fmt, libDocid, pth);
|
Item secitem = AddSection(procitem, num, title, stype, dts, init, ci, step + sequence, fmt, libDocid, pth, FromItem, docver);
|
||||||
thesectid = sec.SectID;
|
thesectid = secitem.ItemID;
|
||||||
|
|
||||||
// if this section has the original edit section flag (sequence[2]) save the id.
|
// if the editsectid hasn't been set yet, set it to this section id, i.e. the first
|
||||||
if (!islibdoc && step[1] == '0' && (sequence[2] == 'x' || sequence[2] == 'X'))
|
// one processed. Then if this section has the original edit section flag (sequence[2])
|
||||||
|
// save the id. The first step is necessary in case there is no original edit section
|
||||||
|
// flag set, so that the first section is the default one to get opened in edit.
|
||||||
|
if (EditSectId==0)EditSectId = thesectid;
|
||||||
|
if (libDocid<1 && step[1] == '0' && (sequence[2] == 'x' || sequence[2] == 'X'))
|
||||||
EditSectId = thesectid;
|
EditSectId = thesectid;
|
||||||
// ContentType (2 in the following call) are:
|
// ContentType (2 in the following call) are:
|
||||||
// 0 = structure,
|
// 0 = structure,
|
||||||
@ -301,36 +464,36 @@ namespace DataLoader
|
|||||||
// 3 = step
|
// 3 = step
|
||||||
// 4 = branch
|
// 4 = branch
|
||||||
|
|
||||||
// fromtype values are (see steps.cs too)
|
// fromtype values are (see steps.cs too)
|
||||||
// 0 = next of same type
|
|
||||||
// 1 = procedure,
|
// 1 = procedure,
|
||||||
// 2 = section,
|
// 2 = section,
|
||||||
// 3 = caution
|
// 3 = caution
|
||||||
// 4 = note
|
// 4 = note
|
||||||
// 5 = RNO
|
// 5 = RNO
|
||||||
// 6 = substep
|
// 6 = step
|
||||||
// 7 = table
|
// 7 = table
|
||||||
|
|
||||||
Structure str = AddStructure(FromType, FromID, 2, thesectid, step + sequence, dts, init);
|
if (!isautogen)
|
||||||
// Process the Data Table - First look for High Level Steps
|
|
||||||
string sQry = string.Format("Step like '[{0}]%' and Sequence='S'", dr["Step"].ToString().Substring(0, 1));
|
|
||||||
DataView dv = new DataView(dt, sQry, "StepNo", DataViewRowState.CurrentRows);
|
|
||||||
Byte FrType = 6;
|
|
||||||
Int32 FrID = 0;
|
|
||||||
pbStep.Maximum = dt.Rows.Count;
|
|
||||||
pbStep.Value = 0;
|
|
||||||
foreach (DataRowView drv in dv)
|
|
||||||
{
|
{
|
||||||
FrID = MigrateStep(cn, dt, drv, FrType, FrID);
|
// Process the Data Table - First look for High Level Steps
|
||||||
if (sec.ContentID == 0)
|
string sQry = string.Format("Step like '[{0}]%' and Sequence='S'", dr["Step"].ToString().Substring(0, 1));
|
||||||
|
DataView dv = new DataView(dt, sQry, "StepNo", DataViewRowState.CurrentRows);
|
||||||
|
Item FrItem = null;
|
||||||
|
frmMain.pbStepMaximum = dt.Rows.Count;
|
||||||
|
frmMain.pbStepValue = 0;
|
||||||
|
foreach (DataRowView drv in dv)
|
||||||
{
|
{
|
||||||
sec.ContentID = FrID;
|
FrItem = MigrateStep(cn, dt, drv, FrItem, conv_caret);
|
||||||
sec.ContentType = 1;
|
if (secitem.MyContent.ContentParts.Count == 0)
|
||||||
sec.Save(true);
|
{
|
||||||
|
// type 6 is step
|
||||||
|
secitem.MyContent.ContentParts.Add(6, FrItem);
|
||||||
|
if (!secitem.MyContent.IsSavable) ErrorRpt.ErrorReport(secitem.MyContent);
|
||||||
|
secitem.MyContent.Save();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
FrType = 0;
|
|
||||||
}
|
}
|
||||||
return str.StructureID;
|
return secitem;
|
||||||
}
|
}
|
||||||
private void LoadSection(DataSet ds, OleDbDataAdapter da, string FileName)
|
private void LoadSection(DataSet ds, OleDbDataAdapter da, string FileName)
|
||||||
{
|
{
|
||||||
@ -359,12 +522,12 @@ namespace DataLoader
|
|||||||
switch (ex.Message)
|
switch (ex.Message)
|
||||||
{
|
{
|
||||||
case "Index file not found.":// then delete inf file
|
case "Index file not found.":// then delete inf file
|
||||||
fi = new FileInfo(tbSource.Text + "\\" + FileName + ".inf");
|
fi = new FileInfo(frmMain.tbSourceText + "\\" + FileName + ".inf");
|
||||||
fi.Delete();
|
fi.Delete();
|
||||||
LoadSection(ds, da, FileName);// Try Again
|
LoadSection(ds, da, FileName);// Try Again
|
||||||
break;
|
break;
|
||||||
case "External table is not in the expected format.": // then pad dbt file with 128 zeros.
|
case "External table is not in the expected format.": // then pad dbt file with 128 zeros.
|
||||||
fi = new FileInfo(tbSource.Text + "\\" + FileName + ".dbt");
|
fi = new FileInfo(frmMain.tbSourceText + "\\" + FileName + ".dbt");
|
||||||
FileStream fs = fi.OpenWrite();
|
FileStream fs = fi.OpenWrite();
|
||||||
fs.Position = fs.Length;
|
fs.Position = fs.Length;
|
||||||
byte[] buf = new byte[128];
|
byte[] buf = new byte[128];
|
||||||
|
@ -10,19 +10,21 @@ using System.Collections.Generic;
|
|||||||
using System.Xml;
|
using System.Xml;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Volian.CSLA.Library;
|
using VEPROMS.CSLA.Library;
|
||||||
|
|
||||||
namespace DataLoader
|
namespace DataLoader
|
||||||
{
|
{
|
||||||
public partial class frmLoader : Form
|
public partial class Loader
|
||||||
{
|
{
|
||||||
private Step AddStep(OleDbConnection cn, string StepType, string Textm, string Recid, string stpseq, string structtype, int structid, DateTime dts, string userid)
|
private Item AddStep(OleDbConnection cn, string StepType, string Textm, string Recid, string stpseq, string structtype, Item FromItem, DateTime dts, string userid, bool conv_caret)
|
||||||
{
|
{
|
||||||
Step stp = null;
|
Content content = null;
|
||||||
UpdateLabels(0, 0, 1);
|
Item item = null;
|
||||||
bool hasxml = false;
|
|
||||||
ConfigInfo ci = new ConfigInfo(null);
|
frmMain.UpdateLabels(0, 0, 1);
|
||||||
|
ConfigInfo ci = null;
|
||||||
string stptext = null;
|
string stptext = null;
|
||||||
|
if (userid == null || userid == "") userid = "Migration";
|
||||||
int tok = -1;
|
int tok = -1;
|
||||||
char[] chrarr = { '\x1', '\x2', '\x3', '\x5' };
|
char[] chrarr = { '\x1', '\x2', '\x3', '\x5' };
|
||||||
try
|
try
|
||||||
@ -31,9 +33,9 @@ namespace DataLoader
|
|||||||
// with it with a 'token' as a separator (see below).
|
// with it with a 'token' as a separator (see below).
|
||||||
tok = Textm.IndexOfAny(chrarr);
|
tok = Textm.IndexOfAny(chrarr);
|
||||||
if (tok < 0)
|
if (tok < 0)
|
||||||
stptext = TextConvert.ConvertText(Textm);
|
stptext = TextConvert.ConvertText(Textm, conv_caret);
|
||||||
else
|
else
|
||||||
stptext = TextConvert.ConvertText(Textm.Substring(0, tok));
|
stptext = TextConvert.ConvertText(Textm.Substring(0, tok), conv_caret);
|
||||||
|
|
||||||
string seqcvt = TextConvert.ConvertSeq(stpseq);
|
string seqcvt = TextConvert.ConvertSeq(stpseq);
|
||||||
|
|
||||||
@ -44,9 +46,30 @@ namespace DataLoader
|
|||||||
log.Error("Found a old style figure!");
|
log.Error("Found a old style figure!");
|
||||||
log.ErrorFormat("oldstepsequence = {0}", stpseq);
|
log.ErrorFormat("oldstepsequence = {0}", stpseq);
|
||||||
}
|
}
|
||||||
|
string newstptyp = null;
|
||||||
|
bool ManualPagebreak = false;
|
||||||
|
char cbittst = StepType.PadRight(2)[0];
|
||||||
|
if (cbittst != ' ' && (cbittst & 0x80) > 1)
|
||||||
|
{
|
||||||
|
ManualPagebreak = true;
|
||||||
|
if (ci==null) ci = new ConfigInfo(null);
|
||||||
|
ci.AddItem("Step", "ManualPagebreak", "True");
|
||||||
|
newstptyp = StepType.Substring(1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Need the content record for the RO & transitions.
|
||||||
|
//content = Content.MakeContent(null, stptext, 20000 + int.Parse(newstptyp!=null?newstptyp:StepType),null, ManualPagebreak?ci.ToString():null, dts, userid);
|
||||||
|
content = Content.New(null, stptext, 20000 + int.Parse(newstptyp != null ? newstptyp : StepType), null, ManualPagebreak ? ci.ToString() : null, dts, userid);
|
||||||
|
content.MyZContent.OldStepSequence = ProcNumber + "|" + stpseq;
|
||||||
|
|
||||||
// Before we save it, handle RO & Transitions tokens.
|
// Before we save it, handle RO & Transitions tokens.
|
||||||
int tokrt = Textm.IndexOf('\x15');
|
int tokrt = Textm.IndexOf('\x15');
|
||||||
if (tokrt > -1) stptext = MigrateRos(cn, stptext, seqcvt, structid);
|
bool txtdirty = false;
|
||||||
|
if (tokrt > -1)
|
||||||
|
{
|
||||||
|
txtdirty = true;
|
||||||
|
stptext = MigrateRos(cn, stptext, seqcvt, content);
|
||||||
|
}
|
||||||
|
|
||||||
// 16-bit code has the following two defines.
|
// 16-bit code has the following two defines.
|
||||||
// #define TransitionMarker 0xC2
|
// #define TransitionMarker 0xC2
|
||||||
@ -55,10 +78,34 @@ namespace DataLoader
|
|||||||
// use the unicode chars.
|
// use the unicode chars.
|
||||||
char[] chrrotrn = { '\x252C', '\x2566' };
|
char[] chrrotrn = { '\x252C', '\x2566' };
|
||||||
tokrt = Textm.IndexOfAny(chrrotrn);
|
tokrt = Textm.IndexOfAny(chrrotrn);
|
||||||
if (tokrt > -1) stptext = MigrateTrans(cn, stptext, seqcvt, structid);
|
if (tokrt > -1)
|
||||||
TextM tm = TextM.MakeTextM(stptext);
|
{
|
||||||
stp = Step.MakeStep(StepType, tm.TextMID, null, dts, userid);
|
txtdirty = true;
|
||||||
dicOldStepSequence[stp] = seqcvt;
|
stptext = MigrateTrans(cn, stptext, seqcvt, content);
|
||||||
|
}
|
||||||
|
if (txtdirty)
|
||||||
|
{
|
||||||
|
content.Text = stptext;
|
||||||
|
//content.Save();
|
||||||
|
}
|
||||||
|
if (!content.IsSavable) ErrorRpt.ErrorReport(content);
|
||||||
|
content.Save();
|
||||||
|
// check if already created thru new during transition migration...
|
||||||
|
if (dicTrans_ItemIds.ContainsKey(ProcNumber + "|" + seqcvt))
|
||||||
|
{
|
||||||
|
item = dicTrans_ItemIds[ProcNumber + "|" + seqcvt];
|
||||||
|
item.MyPrevious = FromItem;
|
||||||
|
item.MyContent = content;
|
||||||
|
item.DTS = dts;
|
||||||
|
item.UserID = userid;
|
||||||
|
if (!item.IsSavable) ErrorRpt.ErrorReport(item);
|
||||||
|
item.Save();
|
||||||
|
dicTrans_ItemIds.Remove(ProcNumber + "|" + seqcvt);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
item = Item.MakeItem(FromItem, content, content.DTS, content.UserID);
|
||||||
|
dicTrans_ItemDone[ProcNumber + "|" + seqcvt] = item;
|
||||||
|
dicOldStepSequence[content] = seqcvt;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@ -66,7 +113,7 @@ namespace DataLoader
|
|||||||
log.ErrorFormat("oldstepsequence = {0}", stpseq);
|
log.ErrorFormat("oldstepsequence = {0}", stpseq);
|
||||||
log.ErrorFormat("{0}\r\n\r\n{1}", ex.Message, ex.InnerException);
|
log.ErrorFormat("{0}\r\n\r\n{1}", ex.Message, ex.InnerException);
|
||||||
log.ErrorFormat(ex.StackTrace);
|
log.ErrorFormat(ex.StackTrace);
|
||||||
stp = null;
|
item = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// now add on any support pieces of text associated with the step.
|
// now add on any support pieces of text associated with the step.
|
||||||
@ -77,53 +124,61 @@ namespace DataLoader
|
|||||||
// '\3\3'override tab
|
// '\3\3'override tab
|
||||||
// '\5' continuous action summary flag
|
// '\5' continuous action summary flag
|
||||||
|
|
||||||
|
bool recdirty = false;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
while (tok >= 0 && tok != Textm.Length)
|
while (tok >= 0 && tok != Textm.Length)
|
||||||
{
|
{
|
||||||
int nxttok = Textm.IndexOfAny(chrarr, tok + 1);
|
int nxttok = Textm.IndexOfAny(chrarr, tok + 1);
|
||||||
|
|
||||||
char chr = Textm[tok];
|
char chr = Textm[tok];
|
||||||
int typ = 0;
|
int typ = 0;
|
||||||
if (chr == '\x1')
|
if (chr == '\x1')
|
||||||
typ = STP_COMMENT;
|
{
|
||||||
else if (chr == '\x2')
|
// add the comment to annotation table. Set type to comment.
|
||||||
typ = STP_MULT_CHGID;
|
if (nxttok < 0) nxttok = Textm.Length;
|
||||||
else if (chr == '\x3')
|
Annotation annot = Annotation.MakeAnnotation(item, CommentType, null, Textm.Substring(tok + 1, nxttok - tok - 1), null, dts, userid);
|
||||||
{
|
}
|
||||||
typ = STP_LNK_SEQ;
|
else if (chr == '\x2')
|
||||||
// check for a double \3 - override tab.
|
typ = STP_MULT_CHGID;
|
||||||
if (tok + 1 < Textm.Length)
|
else if (chr == '\x3')
|
||||||
{
|
{
|
||||||
char nxttokchr = Textm[tok + 1];
|
typ = STP_LNK_SEQ;
|
||||||
if (nxttokchr == '\x3')
|
// check for a double \3 - override tab.
|
||||||
{
|
if (tok + 1 < Textm.Length)
|
||||||
typ = STP_OVR_TAB;
|
{
|
||||||
tok++; // this was a double \3, get past 1st one.
|
char nxttokchr = Textm[tok + 1];
|
||||||
nxttok = Textm.IndexOfAny(chrarr, tok + 1);
|
if (nxttokchr == '\x3')
|
||||||
}
|
{
|
||||||
}
|
typ = STP_OVR_TAB;
|
||||||
}
|
tok++; // this was a double \3, get past 1st one.
|
||||||
else if (chr == '\x5')
|
nxttok = Textm.IndexOfAny(chrarr, tok + 1);
|
||||||
{
|
}
|
||||||
ci.AddItem("Step", "ContActSum", "True");
|
}
|
||||||
//hasxml = SetXml(xmldoc, topElement, "Step", "ContActSum", "True");
|
}
|
||||||
if (nxttok < 0) nxttok = Textm.Length;
|
else if (chr == '\x5')
|
||||||
}
|
{
|
||||||
|
recdirty = true;
|
||||||
|
if (ci == null) ci = new ConfigInfo(null);
|
||||||
|
ci.AddItem("Step", "ContActSum", "True");
|
||||||
|
if (nxttok < 0) nxttok = Textm.Length;
|
||||||
|
}
|
||||||
|
|
||||||
// if not xml, i.e. chr=='\x5', make a textm element
|
// if not comment or ContActSum (xml) make a steptext element
|
||||||
if (chr != '\x5')
|
if (typ == STP_MULT_CHGID || typ == STP_LNK_SEQ || typ == STP_OVR_TAB)
|
||||||
{
|
{
|
||||||
if (nxttok < 0) nxttok = Textm.Length;
|
if (nxttok < 0) nxttok = Textm.Length;
|
||||||
// if this is a sequence number - may need to convert hi-end chars
|
// if this is a sequence number - may need to convert hi-end chars
|
||||||
string str = null;
|
string strn = null;
|
||||||
if (typ == STP_LNK_SEQ)
|
if (typ == STP_LNK_SEQ)
|
||||||
str = TextConvert.ConvertSeq(Textm.Substring(tok + 1, nxttok - tok - 1));
|
strn = TextConvert.ConvertSeq(Textm.Substring(tok + 1, nxttok - tok - 1));
|
||||||
else
|
else
|
||||||
str = Textm.Substring(tok + 1, nxttok - tok - 1);
|
strn = Textm.Substring(tok + 1, nxttok - tok - 1);
|
||||||
//StepText stptxt = StepText.MakeStepText(typ, str, true);
|
if (strn != null && strn != "")
|
||||||
//stptxt.ItemType = typ;
|
{
|
||||||
//stptxt.Textm = str;
|
recdirty = true;
|
||||||
//stp.StepStepTexts.Add(
|
content.ContentDetails.Add(typ, strn);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
tok = nxttok;
|
tok = nxttok;
|
||||||
}
|
}
|
||||||
@ -131,9 +186,10 @@ namespace DataLoader
|
|||||||
// also see if a check-off needs added.
|
// also see if a check-off needs added.
|
||||||
if (Recid[0] != '0')
|
if (Recid[0] != '0')
|
||||||
{
|
{
|
||||||
|
recdirty = true;
|
||||||
string chkindx = Recid[0].ToString();
|
string chkindx = Recid[0].ToString();
|
||||||
|
if (ci == null) ci = new ConfigInfo(null);
|
||||||
ci.AddItem("Step", "CheckOffIndex", chkindx);
|
ci.AddItem("Step", "CheckOffIndex", chkindx);
|
||||||
//hasxml = SetXml(xmldoc, topElement, "Step", "CheckOffIndex", chkindx);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// here's where it knows if it's a linked step (or in processstep)
|
// here's where it knows if it's a linked step (or in processstep)
|
||||||
@ -143,15 +199,12 @@ namespace DataLoader
|
|||||||
}
|
}
|
||||||
|
|
||||||
// if checkoffs or the continuous action summary flag, save the xml.
|
// if checkoffs or the continuous action summary flag, save the xml.
|
||||||
if (hasxml)
|
if (recdirty)
|
||||||
{
|
{
|
||||||
stp.Config = ci.ToString();
|
if (ci != null) content.Config = ci.ToString();
|
||||||
stp.Save(true);
|
if (!content.IsSavable) ErrorRpt.ErrorReport(content);
|
||||||
|
content.Save();
|
||||||
}
|
}
|
||||||
// if this has associated steptext, such as tab override or comment,
|
|
||||||
// save it.
|
|
||||||
//else if (stp.StepStepTexts.Count > 0)
|
|
||||||
// stp.Save(true);
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@ -160,29 +213,8 @@ namespace DataLoader
|
|||||||
log.ErrorFormat("{0}\r\n\r\n{1}", ex.Message, ex.InnerException);
|
log.ErrorFormat("{0}\r\n\r\n{1}", ex.Message, ex.InnerException);
|
||||||
log.ErrorFormat(ex.StackTrace);
|
log.ErrorFormat(ex.StackTrace);
|
||||||
}
|
}
|
||||||
return stp;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
// private void ProcessSubStep(DataTable dt,DataRowView drv,StepTbl stpP)
|
|
||||||
// {
|
|
||||||
// // TODO: Need logic for TextM Support
|
|
||||||
// StepTbl stp = AddStep(stpP,drv["Type"].ToString(),drv["Text"].ToString(),drv["Step"].ToString()+drv["sequence"].ToString());
|
|
||||||
// // TODO: Logic to add Sub-steps
|
|
||||||
// string sPre = drv["Sequence"].ToString();
|
|
||||||
// ProcessSubSteps(dt,drv["Step"].ToString(),sPre+"[*!]?",stp);// Cautions and Notes
|
|
||||||
// ProcessSubSteps(dt,drv["Step"].ToString(),sPre+"$",stp);// RNOs
|
|
||||||
// ProcessSubSteps(dt,drv["Step"].ToString(),sPre+"?",stp);// Substeps
|
|
||||||
// //ProcessSubSteps(dt,drv["Step"],"S_",stp);// Tables
|
|
||||||
// }
|
|
||||||
// private void ProcessSubSteps(DataTable dt,string step,string lookfor,StepTbl stp)
|
|
||||||
// {
|
|
||||||
// DataView dv = new DataView(dt,"Step='" + step + "' and Sequence like'" + lookfor + "'",
|
|
||||||
// "sequence",DataViewRowState.OriginalRows);
|
|
||||||
// foreach(DataRowView drv in dv)
|
|
||||||
// {
|
|
||||||
// ProcessSubStep(dt,drv,stp);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
private string GetParent(string s)
|
private string GetParent(string s)
|
||||||
{
|
{
|
||||||
string retval = "S";
|
string retval = "S";
|
||||||
@ -219,30 +251,30 @@ namespace DataLoader
|
|||||||
}
|
}
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
private Int32 MigrateStep(OleDbConnection cn, DataTable dt, DataRowView drv, Byte FromType, Int32 FromID)
|
private Item MigrateStep(OleDbConnection cn, DataTable dt, DataRowView drv, Item FromItem, bool conv_caret)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
int tmpid = 1;
|
|
||||||
|
|
||||||
// Do the structure record first because usages from the step require a structure
|
|
||||||
// id.
|
|
||||||
string sType = GetStructType(drv["CSequence"].ToString());
|
string sType = GetStructType(drv["CSequence"].ToString());
|
||||||
// Structures str = AddStructure(FromType, FromID, (byte)(3 + ("CNRST".IndexOf(sType))), tmpid, drv["CStep"].ToString() + drv["CSequence"].ToString(),
|
Item item = AddStep(cn, drv["Type"].ToString()
|
||||||
Structure str = AddStructure(FromType, FromID, 3, tmpid, drv["CStep"].ToString() + drv["CSequence"].ToString(),
|
, (drv["textm"] == DBNull.Value ? drv["Text"].ToString() : drv["Textm"].ToString())
|
||||||
GetDTS(drv["Date"].ToString(), drv["Time"].ToString()), drv["Initials"].ToString());
|
, drv["Recid"].ToString(), drv["CStep"].ToString() + drv["CSequence"].ToString(), "S", FromItem // was str
|
||||||
Step stp = AddStep(cn, drv["Type"].ToString()
|
, GetDTS(drv["Date"].ToString(), drv["Time"].ToString()), drv["Initials"].ToString(), conv_caret);
|
||||||
, (drv["textm"] == DBNull.Value ? drv["Text"].ToString() : drv["Textm"].ToString())
|
//Content cont = Content.MakeContent(null,(drv["textm"] == DBNull.Value ? drv["Text"].ToString() : drv["Textm"].ToString()),drv["Type"]+20000,null,null,
|
||||||
, drv["Recid"].ToString(), drv["CStep"].ToString() + drv["CSequence"].ToString(), "S", str.StructureID
|
// GetDTS(drv["Date"].ToString(), drv["Time"].ToString()), drv["Initials"].ToString());
|
||||||
, GetDTS(drv["Date"].ToString(), drv["Time"].ToString()), drv["Initials"].ToString());
|
//Item item = Item.MakeItem(FromItem, cont, cont.DTS, cont.UserID);
|
||||||
str.ContentID = stp.StepID;
|
//Structure str = AddStructure(FromType, FromID, 3, tmpid, drv["CStep"].ToString() + drv["CSequence"].ToString(),
|
||||||
str.Save(true);
|
// GetDTS(drv["Date"].ToString(), drv["Time"].ToString()), drv["Initials"].ToString());
|
||||||
Dictionary<string, Step> dicStep = new Dictionary<string, Step>();
|
//Step stp = AddStep(cn, drv["Type"].ToString()
|
||||||
dicStep[drv["CSequence"].ToString()] = stp;
|
// , (drv["textm"] == DBNull.Value ? drv["Text"].ToString() : drv["Textm"].ToString())
|
||||||
Dictionary<string, Dictionary<string, int>> dicStruct = new Dictionary<string, Dictionary<string, int>>();
|
// , drv["Recid"].ToString(), drv["CStep"].ToString() + drv["CSequence"].ToString(), "S", str
|
||||||
Dictionary<string, int> dicBase = new Dictionary<string, int>();
|
// , GetDTS(drv["Date"].ToString(), drv["Time"].ToString()), drv["Initials"].ToString());
|
||||||
|
Dictionary<string, Item> dicStep = new Dictionary<string, Item>();
|
||||||
|
dicStep[drv["CSequence"].ToString()] = item;
|
||||||
|
Dictionary<string, Dictionary<string, Item>> dicStruct = new Dictionary<string, Dictionary<string, Item>>();
|
||||||
|
Dictionary<string, Item> dicBase = new Dictionary<string, Item>();
|
||||||
dicStruct[drv["CSequence"].ToString()] = dicBase;
|
dicStruct[drv["CSequence"].ToString()] = dicBase;
|
||||||
dicBase[""] = str.StructureID;
|
dicBase[""] = item;
|
||||||
// Logic to add Sub-steps
|
// Logic to add Sub-steps
|
||||||
string sQry = "CStep = '" + drv["CStep"].ToString() + "' and CSequence <> 'S'";
|
string sQry = "CStep = '" + drv["CStep"].ToString() + "' and CSequence <> 'S'";
|
||||||
// sort order - for sections use currentrows.
|
// sort order - for sections use currentrows.
|
||||||
@ -250,8 +282,8 @@ namespace DataLoader
|
|||||||
//dataGrid1.DataSource=dv;
|
//dataGrid1.DataSource=dv;
|
||||||
//Loop through DataView and add Steps one at a time
|
//Loop through DataView and add Steps one at a time
|
||||||
//Console.WriteLine("={0}",drv["Step"]);
|
//Console.WriteLine("={0}",drv["Step"]);
|
||||||
Byte FrType = 0;
|
int FrType = 0; // type of relationship (not type of step)
|
||||||
Int32 FrID = str.StructureID;
|
Item FrItem = item;
|
||||||
foreach (DataRowView drvs in dv)
|
foreach (DataRowView drvs in dv)
|
||||||
{
|
{
|
||||||
//Console.WriteLine(">{0}",drvs["CStep"]);
|
//Console.WriteLine(">{0}",drvs["CStep"]);
|
||||||
@ -259,49 +291,53 @@ namespace DataLoader
|
|||||||
string sParent = GetParent(drvs["CSequence"].ToString());
|
string sParent = GetParent(drvs["CSequence"].ToString());
|
||||||
if (dicStep.ContainsKey(sParent))
|
if (dicStep.ContainsKey(sParent))
|
||||||
{
|
{
|
||||||
Step stpp = dicStep[sParent];
|
Item itemp = dicStep[sParent];
|
||||||
sType = GetStructType(drvs["CSequence"].ToString());
|
sType = GetStructType(drvs["CSequence"].ToString());
|
||||||
Dictionary<string,int> dicStr = dicStruct[sParent];
|
Dictionary<string,Item> dicStr = dicStruct[sParent];
|
||||||
if (dicStr.ContainsKey(sType))
|
// check if a step type of 'sType' exists to see if child/sibling
|
||||||
|
//Content contc = Content.MakeContent(null,(drvs["textm"] == DBNull.Value ? drvs["Text"].ToString() : drvs["Textm"].ToString()),drvs["Type"]+20000,null,null,
|
||||||
|
// GetDTS(drvs["Date"].ToString(), drvs["Time"].ToString()), drvs["Initials"].ToString()));
|
||||||
|
Item itemc = null;
|
||||||
|
if (dicStr.ContainsKey(sType)) // next sibling
|
||||||
{
|
{
|
||||||
FrID = (Int32)dicStr[sType];
|
FrItem = dicStr[sType];
|
||||||
FrType = 0;
|
FrType = 0;
|
||||||
}
|
}
|
||||||
else
|
else // child of a node
|
||||||
{
|
{
|
||||||
FrID = (Int32)dicStr[""];
|
FrItem = null;
|
||||||
FrType = (byte)(3 + ("CNRST".IndexOf(sType)));
|
FrType = (3 + ("CNRST".IndexOf(sType)));
|
||||||
}
|
}
|
||||||
Structure str1 = AddStructure(FrType, FrID, 3, tmpid++, drvs["CStep"].ToString() + drvs["CSequence"].ToString(),
|
itemc = AddStep(cn, drvs["Type"].ToString()
|
||||||
GetDTS(drvs["Date"].ToString(), drvs["Time"].ToString()), drvs["Initials"].ToString());
|
, (drvs["textm"] == DBNull.Value ? drvs["Text"].ToString() : drvs["Textm"].ToString())
|
||||||
Step stpc = AddStep(cn, drvs["Type"].ToString()
|
, drv["Recid"].ToString(), drvs["CStep"].ToString() + drvs["CSequence"].ToString()
|
||||||
, (drvs["textm"] == DBNull.Value ? drvs["Text"].ToString() : drvs["Textm"].ToString())
|
, GetStructType(drvs["sequence"].ToString()), FrItem
|
||||||
, drv["Recid"].ToString(), drvs["CStep"].ToString() + drvs["CSequence"].ToString(), GetStructType(drvs["sequence"].ToString()), str1.StructureID
|
, GetDTS(drvs["Date"].ToString(), drvs["Time"].ToString()), drvs["Initials"].ToString(), conv_caret);
|
||||||
, GetDTS(drvs["Date"].ToString(), drvs["Time"].ToString()), drvs["Initials"].ToString());
|
|
||||||
str1.ContentID = stpc.StepID;
|
if (FrType > 0 )
|
||||||
str1.Save(true);
|
{
|
||||||
dicStep[drvs["CSequence"].ToString()] = stpc;
|
itemp.MyContent.ContentParts.Add(FrType, itemc);
|
||||||
|
if (!itemp.MyContent.IsSavable) ErrorRpt.ErrorReport(itemp.MyContent);
|
||||||
dicBase = new Dictionary<string, int>();
|
itemp.MyContent.Save();
|
||||||
dicStruct[drvs["CSequence"].ToString()] = dicBase;
|
}
|
||||||
dicBase[""] = str1.StructureID;
|
dicStr[sType] = itemc;
|
||||||
dicStr[sType] = str1.StructureID;
|
dicStruct[drvs["CSequence"].ToString()] = new Dictionary<string, Item>();
|
||||||
|
dicStep[drvs["CSequence"].ToString()] = itemc;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
log.ErrorFormat("Parent {0} Could not be found for {1}", sParent, drvs["sequence"].ToString());
|
log.ErrorFormat("Parent {0} Could not be found for {1}", sParent, drvs["sequence"].ToString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return str.StructureID;
|
return item;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
log.Error("PROCESS STEP");
|
log.Error("PROCESS STEP");
|
||||||
log.ErrorFormat("{0}\r\n\r\n{1}", ex.Message, ex.InnerException);
|
log.ErrorFormat("{0}\r\n\r\n{1}", ex.Message, ex.InnerException);
|
||||||
log.ErrorFormat(ex.StackTrace);
|
log.ErrorFormat(ex.StackTrace);
|
||||||
return 0;
|
return null;
|
||||||
}
|
}
|
||||||
//return 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -88,6 +88,8 @@ namespace DataLoader
|
|||||||
dicChar[8734] = 8857;
|
dicChar[8734] = 8857;
|
||||||
dicChar[7] = 9679;
|
dicChar[7] = 9679;
|
||||||
dicChar[8976] = 9830;
|
dicChar[8976] = 9830;
|
||||||
|
dicChar[9632] = 9604;
|
||||||
|
//dicChar[236] = 38914;
|
||||||
char[] creg = new char[dicChar.Count];
|
char[] creg = new char[dicChar.Count];
|
||||||
int i = 0;
|
int i = 0;
|
||||||
foreach (int ic in dicChar.Keys)
|
foreach (int ic in dicChar.Keys)
|
||||||
@ -111,9 +113,86 @@ namespace DataLoader
|
|||||||
}
|
}
|
||||||
return new string(cs);
|
return new string(cs);
|
||||||
}
|
}
|
||||||
|
public static string ConvertText(string s1, bool DoCaret)
|
||||||
|
{
|
||||||
|
string s2 = s1;
|
||||||
|
if (DoCaret) s2 = s2.Replace("^", @"\u916");
|
||||||
|
return ConvertText(s2);
|
||||||
|
}
|
||||||
|
public static string ReplaceUnicode(string s2)
|
||||||
|
{
|
||||||
|
char[] tmp;
|
||||||
|
tmp = s2.ToCharArray();
|
||||||
|
s2 = s2.Replace("`", "\'b0"); // convert backquote to degree - left over from DOS days.
|
||||||
|
s2 = s2.Replace("\'a0",@"\'a0"); // hardspace
|
||||||
|
s2 = s2.Replace("\xb0", @"\'b0"); // degree
|
||||||
|
s2 = s2.Replace("\x7f", @"\u916?"); // delta
|
||||||
|
s2 = s2.Replace("\x2265",@"\u8805?"); // greater than or equal
|
||||||
|
s2 = s2.Replace("\x2264",@"\u8804?"); // less than or equal
|
||||||
|
s2 = s2.Replace("\xB1",@"\'b1"); // plus minus
|
||||||
|
s2 = s2.Replace("\x3A3",@"\u931?"); // sigma
|
||||||
|
s2 = s2.Replace("\x3C4",@"\u947?"); // gamma
|
||||||
|
s2 = s2.Replace("\xBD",@"\'bd"); // half
|
||||||
|
s2 = s2.Replace("\x25A0",@"\u9604?"); // accum 2584
|
||||||
|
s2 = s2.Replace("\x7",@"\u9679?"); // bullet 25CF
|
||||||
|
s2 = s2.Replace("\x2248",@"\u8776?"); // approx eq
|
||||||
|
s2 = s2.Replace("\x2261",@"\u8773?"); // similar eq 2245
|
||||||
|
s2 = s2.Replace("\xF7",@"\'f7"); // division
|
||||||
|
s2 = s2.Replace("\x221A",@"\u8730?"); // square root
|
||||||
|
s2 = s2.Replace("\x393",@"\u961?"); // rho 3C1
|
||||||
|
s2 = s2.Replace("\x3C0",@"\u960?"); // pi
|
||||||
|
s2 = s2.Replace("\xb5", @"\u956?"); // micro 3BC (try e6, if not work try 109)
|
||||||
|
s2 = s2.Replace("\x3B4", @"\u948?"); // lower case delta
|
||||||
|
s2 = s2.Replace("\x3C3", @"\u963?"); // lower case sigma
|
||||||
|
s2 = s2.Replace("\xBC", @"\'bc"); // quarter
|
||||||
|
s2 = s2.Replace("\x3C6", @"\'d8"); // dist zero, D8
|
||||||
|
s2 = s2.Replace("\xC9", @"\u274?"); // energy, 112
|
||||||
|
s2 = s2.Replace("\xEC", @"\'ec"); // grave
|
||||||
|
s2 = s2.Replace("\x2502", @"\u9474?"); // bar
|
||||||
|
s2 = s2.Replace("\x3B5", @"\u949?"); // epsilon
|
||||||
|
s2 = s2.Replace("\x398", @"\u952?"); // theta, 3B8
|
||||||
|
s2 = s2.Replace("\x221E", @"\u8857?"); // dot in oval, 2299
|
||||||
|
s2 = s2.Replace("\xBF", @"\u964?"); // tau, 3C4
|
||||||
|
s2 = s2.Replace("\x2310", @"\u9830?"); // diamond, 2666
|
||||||
|
s2 = s2.Replace("\x2192", @"\u8594?");
|
||||||
|
s2 = s2.Replace("\x2190", @"\u8592?");
|
||||||
|
s2 = s2.Replace("\x2191", @"\u8593?");
|
||||||
|
s2 = s2.Replace("\x2193", @"\u8595?");
|
||||||
|
s2 = s2.Replace("\x2207", @"\u8711?");
|
||||||
|
|
||||||
|
return s2;
|
||||||
|
}
|
||||||
public static string ConvertText(string s1)
|
public static string ConvertText(string s1)
|
||||||
{
|
{
|
||||||
string s2 = Reg2.Replace(s1, new MatchEvaluator(ReplaceChars));
|
string s2 = s1;
|
||||||
|
|
||||||
|
s2 = ReplaceUnicode(s2);
|
||||||
|
// now replace underline on/off (AE,AF), super on/off (C6,C7)
|
||||||
|
// bold on/off (D5, D6), subscript on/off (D1 A6), and
|
||||||
|
// italics on/off (B2, DD)
|
||||||
|
s2 = s2.Replace("\xAB", "\\ul ");
|
||||||
|
s2 = s2.Replace("\xBB", "\\ul0 ");
|
||||||
|
s2 = s2.Replace("\x255E", "\\super ");
|
||||||
|
s2 = s2.Replace("\x255F", "\\nosupersub ");
|
||||||
|
s2 = s2.Replace("\x2552", "\\b ");
|
||||||
|
s2 = s2.Replace("\x2553", "\\b0 ");
|
||||||
|
s2 = s2.Replace("\x2564", "\\sub ");
|
||||||
|
s2 = s2.Replace("\xAA", "\\nosupersub ");
|
||||||
|
s2 = s2.Replace("\x2593", "\\i ");
|
||||||
|
s2 = s2.Replace("\x258C", "\\i0 ");
|
||||||
|
s2 = s2.Replace("\x2559", "\\ul\\b ");
|
||||||
|
s2 = s2.Replace("\x2558", "\\b0\\ul0 ");
|
||||||
|
|
||||||
|
// underline next word is 0x17
|
||||||
|
// superscript next is 0x18
|
||||||
|
// subscript next is 0x19
|
||||||
|
// bold next is 0x13
|
||||||
|
s2 = Regex.Replace(s2, @"\x17([^\x17 ]*?)(?:[\x17]|(?= )|\Z)(.*?)", @"\ul $1\ul0 $2");
|
||||||
|
s2 = Regex.Replace(s2, @"\x18([^\x18 ]*?)(?:[\x18]|(?= )|\Z)(.*?)", @"\super $1\nosupersub $2");
|
||||||
|
s2 = Regex.Replace(s2, @"\x19([^\x19 ]*?)(?:[\x19]|(?= )|\Z)(.*?)", @"\sub $1\nosupersub $2");
|
||||||
|
s2 = Regex.Replace(s2, @"\x13([^\x13 ]*?)(?:[\x13]|(?= )|\Z)(.*?)", @"\b $1\b0 $2");
|
||||||
|
|
||||||
|
s2 = Reg2.Replace(s2, new MatchEvaluator(ReplaceChars));
|
||||||
return s2;
|
return s2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,43 +20,147 @@ using System.Collections.Generic;
|
|||||||
using System.Xml;
|
using System.Xml;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Volian.CSLA.Library;
|
using VEPROMS.CSLA.Library;
|
||||||
|
|
||||||
namespace DataLoader
|
namespace DataLoader
|
||||||
{
|
{
|
||||||
public partial class frmLoader : Form
|
public partial class Loader
|
||||||
{
|
{
|
||||||
private int AddTrans(int fromId, DataRow dr)
|
private string AddTrans(Content fromCon, DataRow dr, DataRow dr2)
|
||||||
{
|
{
|
||||||
//TODO: ZTransitions tr.Oldto = dr["OLDTO"].ToString();
|
//TODO: ZTransitions tr.Oldto = dr["OLDTO"].ToString();
|
||||||
string thekey = dr["TONUMBER"].ToString() + "|" + dr["TOSEQUENCE"].ToString();
|
string thekey = dr["TONUMBER"].ToString() + "|" + dr["TOSEQUENCE"].ToString();
|
||||||
string dti = dr["DTI"].ToString().PadRight(18, ' ');
|
string dti = dr["DTI"].ToString().PadRight(18, ' ');
|
||||||
string userid = dti.Substring(13, 5).Trim();
|
string userid = dti.Substring(13, 5).Trim();
|
||||||
|
int itype = 0;
|
||||||
|
ConfigInfo ci = null;
|
||||||
|
// The transition type was stored as a character & also, when read in thru
|
||||||
|
// ado.net may have been converted into unicode. So in order to get the
|
||||||
|
// correct type, first, use the TextConvert to eliminate the conversion done
|
||||||
|
// by ado.net. Then convert to a number. The 'anding of 0x80' flags that it
|
||||||
|
// is a formatted transition (i.e. this was done for byron/braidwood to
|
||||||
|
// show the transition with a page number or not). The 'anding of 0x7f' gets
|
||||||
|
// the actual number when subtracted from 0x30 (the value of the 0 character).
|
||||||
|
try
|
||||||
|
{
|
||||||
|
char typech = TextConvert.ConvertSeq(dr["TYPE"].ToString())[0];
|
||||||
|
int tmpitype = Convert.ToInt32(typech);
|
||||||
|
if ((tmpitype & 0x80) > 0)
|
||||||
|
{
|
||||||
|
ci = new ConfigInfo(null);
|
||||||
|
ci.AddItem("Transition", "Formatted", "True");
|
||||||
|
}
|
||||||
|
itype = (tmpitype&0x7F) - 0x30;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
log.Error("Error converting transition type");
|
||||||
|
log.ErrorFormat("type from database = {0}", dr["TYPE"].ToString());
|
||||||
|
log.ErrorFormat("{0}\r\n\r\n{1}", ex.Message, ex.InnerException);
|
||||||
|
itype = -1;
|
||||||
|
}
|
||||||
DateTime dts = GetDTS(MakeDate(dti.Substring(0, 8).Trim()), dti.Substring(8, 5).Trim());
|
DateTime dts = GetDTS(MakeDate(dti.Substring(0, 8).Trim()), dti.Substring(8, 5).Trim());
|
||||||
// if it's in the dictionary of structure elements already migrated, just use this
|
// if it's in the dictionary of structure elements already migrated, just use this
|
||||||
// structure id, or if it's in the dictionary of structure elements that have
|
// structure id, or if it's in the dictionary of structure elements that have
|
||||||
// not been migrated but a record was created from this code, use it. Otherwise
|
// not been migrated but a record was created from this code, use it. Otherwise
|
||||||
// create a new structure record and use its id, its data will be updated later.
|
// create a new structure record and use its id, its data will be updated later.
|
||||||
// a structure record.
|
// a structure record.
|
||||||
int toid;
|
Item toItem = null;
|
||||||
if (dicTrans_StrDone.ContainsKey(thekey))
|
Item toItem2 = null;
|
||||||
toid = dicTrans_StrDone[thekey];
|
if (dicTrans_ItemDone.ContainsKey(thekey))
|
||||||
|
{
|
||||||
|
toItem = dicTrans_ItemDone[thekey];
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (dicTrans_StrIds.ContainsKey(thekey))
|
if (dicTrans_ItemIds.ContainsKey(thekey))
|
||||||
toid = dicTrans_StrIds[thekey];
|
{
|
||||||
|
toItem = dicTrans_ItemIds[thekey];
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Structure str = Structure.MakeStructure(0, 0, 0, 0);
|
// note that parent is null right now - it will be filled in later.
|
||||||
toid = str.StructureID;
|
//toItem = Item.MakeItem(null, fromCon, DateTime.Now, "Migration");
|
||||||
dicTrans_StrIds.Add(thekey, toid);
|
toItem = Item.New(null, TransDummyCont, DateTime.Now, "Migration");
|
||||||
|
dicTrans_ItemIds.Add(thekey, toItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Transition tr = Transition.MakeTransition(fromId, toid, System.Convert.ToInt32(dr["TYPE"].ToString()),0,0,0,0,dts,userid);
|
|
||||||
return tr.TransitionId;
|
// if there is data in dr2, it means that it is a range transition. Get its item
|
||||||
|
// data too.
|
||||||
|
toItem2 = toItem;
|
||||||
|
if (dr2 != null)
|
||||||
|
{
|
||||||
|
string thekey2 = dr2["TONUMBER"].ToString() + "|" + dr2["TOSEQUENCE"].ToString();
|
||||||
|
if (dicTrans_ItemDone.ContainsKey(thekey2))
|
||||||
|
{
|
||||||
|
toItem2 = dicTrans_ItemDone[thekey2];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (dicTrans_ItemIds.ContainsKey(thekey2))
|
||||||
|
{
|
||||||
|
toItem2 = dicTrans_ItemIds[thekey2];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
toItem2 = Item.MakeItem(null, TransDummyCont, DateTime.Now, "Migration");
|
||||||
|
dicTrans_ItemIds.Add(thekey2, toItem2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (userid == null || userid == "") userid = "Migration";
|
||||||
|
Transition tr = null;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
tr = Transition.New(fromCon, toItem, toItem2, itype, ci!=null?ci.ToString():null, dts, userid);
|
||||||
|
tr.MyZTransition.Oldto = dr["OLDTO"].ToString();
|
||||||
|
if (!tr.IsSavable) ErrorRpt.ErrorReport(tr);
|
||||||
|
tr.Save();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
log.Error("Error addition transition record");
|
||||||
|
log.ErrorFormat("{0}\r\n\r\n{1}", ex.Message, ex.InnerException);
|
||||||
|
}
|
||||||
|
StringBuilder trtxt = new StringBuilder();
|
||||||
|
|
||||||
|
// the following is pre RTB link code, i.e. <token>{tranid {type toid (rangeid}}
|
||||||
|
trtxt.Append("\\v TRAN\\v0 (Resolved Transition Text)\\v ");
|
||||||
|
|
||||||
|
trtxt.Append(tr.TranType.ToString());
|
||||||
|
trtxt.Append(" ");
|
||||||
|
trtxt.Append(tr.TransitionID.ToString());
|
||||||
|
trtxt.Append(" ");
|
||||||
|
trtxt.Append(tr.ToID.ToString());
|
||||||
|
if (toItem.ItemID == toItem2.ItemID)
|
||||||
|
trtxt.Append("\\v0 ");
|
||||||
|
else
|
||||||
|
{
|
||||||
|
trtxt.Append(" ");
|
||||||
|
trtxt.Append(tr.RangeID.ToString());
|
||||||
|
trtxt.Append("\\v0 ");
|
||||||
|
}
|
||||||
|
//trtxt.Append("{");
|
||||||
|
//trtxt.Append(tr.TransitionID.ToString());
|
||||||
|
//trtxt.Append("{");
|
||||||
|
//trtxt.Append(tr.TranType.ToString());
|
||||||
|
//trtxt.Append(" ");
|
||||||
|
//trtxt.Append(tr.ToID.ToString());
|
||||||
|
//if (toItem.ItemID == toItem2.ItemID)
|
||||||
|
// trtxt.Append("}}");
|
||||||
|
//else
|
||||||
|
//{
|
||||||
|
// trtxt.Append(" ");
|
||||||
|
// trtxt.Append(tr.RangeID.ToString());
|
||||||
|
// trtxt.Append("}}");
|
||||||
|
//}
|
||||||
|
|
||||||
|
return trtxt.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
private string MigrateTrans(OleDbConnection cn, string textm, string seqcvt, int structId)
|
private string MigrateTrans(OleDbConnection cn, string textm, string seqcvt, Content content)
|
||||||
{
|
{
|
||||||
StringBuilder trtxt = new StringBuilder();
|
StringBuilder trtxt = new StringBuilder();
|
||||||
int instance = 0;
|
int instance = 0;
|
||||||
@ -95,17 +199,30 @@ namespace DataLoader
|
|||||||
// we have too many tokens and not enough usage records - report an error...
|
// we have too many tokens and not enough usage records - report an error...
|
||||||
if (instance >= dt.Rows.Count)
|
if (instance >= dt.Rows.Count)
|
||||||
{
|
{
|
||||||
log.ErrorFormat("Error - ran out of usage records for step, check data ");
|
log.ErrorFormat("Error - ran out of transition records for step, check data ");
|
||||||
log.ErrorFormat("from number = {0} oldstepsequence = {1}", ProcNumber, seqcvt);
|
log.ErrorFormat("from number = {0} oldstepsequence = {1}", ProcNumber, seqcvt);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DataRow dr = dt.Rows[instance];
|
DataRow dr = dt.Rows[instance];
|
||||||
int trid = AddTrans(structId, dr);
|
|
||||||
|
// if type is 2 or 3, this is a range transition, need to get the next
|
||||||
|
// record too
|
||||||
|
bool trange = false;
|
||||||
|
if (dr["Type"].ToString() == "2" || dr["Type"].ToString() == "3")
|
||||||
|
trange = true;
|
||||||
|
|
||||||
|
string rectxt = null;
|
||||||
|
if (trange)
|
||||||
|
{
|
||||||
|
instance++;
|
||||||
|
DataRow dr2 = dt.Rows[instance];
|
||||||
|
rectxt = AddTrans(content, dr, dr2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
rectxt = AddTrans(content, dr, null);
|
||||||
trtxt.Append(textm[tok]);
|
trtxt.Append(textm[tok]);
|
||||||
trtxt.Append("{{");
|
trtxt.Append(rectxt);
|
||||||
trtxt.Append(trid.ToString());
|
|
||||||
trtxt.Append("}}");
|
|
||||||
}
|
}
|
||||||
instance++;
|
instance++;
|
||||||
beg = tok + 1;
|
beg = tok + 1;
|
||||||
@ -121,18 +238,25 @@ namespace DataLoader
|
|||||||
trtxt.Append(textm.Substring(beg, textm.Length - beg));
|
trtxt.Append(textm.Substring(beg, textm.Length - beg));
|
||||||
if (dt.Rows.Count > instance + 1)
|
if (dt.Rows.Count > instance + 1)
|
||||||
{
|
{
|
||||||
log.ErrorFormat("Error - extra usage records for step, check data ");
|
log.ErrorFormat("Error - extra transition records for step, check data ");
|
||||||
log.ErrorFormat("from number = {0} oldstepsequence = {1}", ProcNumber, seqcvt);
|
log.ErrorFormat("from number = {0} oldstepsequence = {1}", ProcNumber, seqcvt);
|
||||||
}
|
}
|
||||||
return trtxt.ToString();
|
return trtxt.ToString();
|
||||||
}
|
}
|
||||||
private void ShowMissingTransitions()
|
private void ShowMissingTransitions()
|
||||||
{
|
{
|
||||||
log.Info("Missing Transitions");
|
log.Info("Missing Transitions from Dictionary");
|
||||||
foreach (string s in dicTrans_StrIds.Keys)
|
foreach (string s in dicTrans_ItemIds.Keys)
|
||||||
{
|
{
|
||||||
log.InfoFormat("{0} - {1}", s, dicTrans_StrIds[s]);
|
log.InfoFormat("{0} - {1}", s, dicTrans_ItemIds[s]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log.Info("Bad transitions to 'dummy' content");
|
||||||
|
foreach (ContentItem itm in TransDummyCont.ContentItems)
|
||||||
|
{
|
||||||
|
log.InfoFormat("ItemID = {0}", itm.ItemID);
|
||||||
|
}
|
||||||
|
|
||||||
log.Info("End of Missing Transitions");
|
log.Info("End of Missing Transitions");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
74
PROMS/DataLoader/frmCntTkn.Designer.cs
generated
Normal file
74
PROMS/DataLoader/frmCntTkn.Designer.cs
generated
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
namespace DataLoader
|
||||||
|
{
|
||||||
|
partial class frmCntTkn
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
this.button1 = new System.Windows.Forms.Button();
|
||||||
|
this.listBox1 = new System.Windows.Forms.ListBox();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// button1
|
||||||
|
//
|
||||||
|
this.button1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
|
this.button1.Location = new System.Drawing.Point(12, 8);
|
||||||
|
this.button1.Name = "button1";
|
||||||
|
this.button1.Size = new System.Drawing.Size(132, 22);
|
||||||
|
this.button1.TabIndex = 0;
|
||||||
|
this.button1.Text = "Count Chars/Tokens";
|
||||||
|
this.button1.UseVisualStyleBackColor = true;
|
||||||
|
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||||
|
//
|
||||||
|
// listBox1
|
||||||
|
//
|
||||||
|
this.listBox1.Font = new System.Drawing.Font("Arial Unicode MS", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
|
this.listBox1.FormattingEnabled = true;
|
||||||
|
this.listBox1.ItemHeight = 15;
|
||||||
|
this.listBox1.Location = new System.Drawing.Point(12, 36);
|
||||||
|
this.listBox1.Name = "listBox1";
|
||||||
|
this.listBox1.Size = new System.Drawing.Size(225, 409);
|
||||||
|
this.listBox1.TabIndex = 55;
|
||||||
|
//
|
||||||
|
// frmCntTkn
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.ClientSize = new System.Drawing.Size(331, 486);
|
||||||
|
this.Controls.Add(this.listBox1);
|
||||||
|
this.Controls.Add(this.button1);
|
||||||
|
this.Name = "frmCntTkn";
|
||||||
|
this.Text = "frmCntTkn";
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private System.Windows.Forms.Button button1;
|
||||||
|
private System.Windows.Forms.ListBox listBox1;
|
||||||
|
}
|
||||||
|
}
|
71
PROMS/DataLoader/frmCntTkn.cs
Normal file
71
PROMS/DataLoader/frmCntTkn.cs
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Data;
|
||||||
|
using System.Data.OleDb;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Text;
|
||||||
|
using System.IO;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using VEPROMS.CSLA.Library;
|
||||||
|
|
||||||
|
namespace DataLoader
|
||||||
|
{
|
||||||
|
public partial class frmCntTkn : Form
|
||||||
|
{
|
||||||
|
private Dictionary<char, int> dicCharCount;
|
||||||
|
|
||||||
|
public frmCntTkn()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CountChars(string txt)
|
||||||
|
{
|
||||||
|
foreach (char ch in txt)
|
||||||
|
{
|
||||||
|
//'A' is a newline
|
||||||
|
int ich = Convert.ToInt32(ch);
|
||||||
|
if (ich == 0xD) Console.WriteLine("D is {0}", txt);
|
||||||
|
if (ich == 0x17) Console.WriteLine("17 is {0}", txt);
|
||||||
|
if (!dicCharCount.ContainsKey(ch))
|
||||||
|
dicCharCount[ch] = 1;
|
||||||
|
else
|
||||||
|
dicCharCount[ch] = dicCharCount[ch] + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//private void ProcessText()
|
||||||
|
//{
|
||||||
|
// TextMInfoList txtMList = TextMInfoList.Get();
|
||||||
|
// foreach (TextMInfo txtM in txtMList)
|
||||||
|
// {
|
||||||
|
// string thetext = txtM.TextMValue;
|
||||||
|
// CountChars(thetext);
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
private void button1_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// Create a dictionary that stores characters
|
||||||
|
// read in data from dbf
|
||||||
|
// list chars
|
||||||
|
dicCharCount = new Dictionary<char, int>();
|
||||||
|
//ProcessText();
|
||||||
|
|
||||||
|
// now display dictionary results..
|
||||||
|
Console.WriteLine("Char\t\tHex\t\tDec\t\tCount");
|
||||||
|
foreach (char ch in dicCharCount.Keys)
|
||||||
|
{
|
||||||
|
// if character is a 'token' and not a hardspace (A0), linefeed (A), RO token (15)
|
||||||
|
// Transition tokens (0x252c & -x2566) then show it.
|
||||||
|
if ((ch < 0x20 || ch > 0x7E) && ch!= 0xA0 && ch != 0xA && ch != 0x15 && ch != 0x252C && ch != 0x2566)
|
||||||
|
{
|
||||||
|
int ich = Convert.ToInt32(ch);
|
||||||
|
string cntstr = String.Format("{0}\t\t{1}\t\t{2}\t\t{3}", ch, ich.ToString("X4"), ich.ToString(), dicCharCount[ch]);
|
||||||
|
listBox1.Items.Add(cntstr);
|
||||||
|
Console.WriteLine(cntstr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
120
PROMS/DataLoader/frmCntTkn.resx
Normal file
120
PROMS/DataLoader/frmCntTkn.resx
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
681
PROMS/DataLoader/frmLoader.Designer.cs
generated
681
PROMS/DataLoader/frmLoader.Designer.cs
generated
@ -28,326 +28,364 @@ namespace DataLoader
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
this.sc = new System.Windows.Forms.SplitContainer();
|
this.sc = new System.Windows.Forms.SplitContainer();
|
||||||
this.btnVETree_CSLA = new System.Windows.Forms.Button();
|
this.btnCtTok = new System.Windows.Forms.Button();
|
||||||
this.btnBrowseVesam = new System.Windows.Forms.Button();
|
this.btnGroup = new System.Windows.Forms.Button();
|
||||||
this.tbVesamPath = new System.Windows.Forms.TextBox();
|
this.btnVETree_CSLA = new System.Windows.Forms.Button();
|
||||||
this.btnVesam = new System.Windows.Forms.Button();
|
this.btnBrowseVesam = new System.Windows.Forms.Button();
|
||||||
this.btnLoadTreeCSLA = new System.Windows.Forms.Button();
|
this.tbVesamPath = new System.Windows.Forms.TextBox();
|
||||||
this.cbLazy = new System.Windows.Forms.CheckBox();
|
this.btnVesam = new System.Windows.Forms.Button();
|
||||||
this.btnConvertSelected = new System.Windows.Forms.Button();
|
this.btnLoadTreeCSLA = new System.Windows.Forms.Button();
|
||||||
this.btnLoadTreeDB = new System.Windows.Forms.Button();
|
this.cbLazy = new System.Windows.Forms.CheckBox();
|
||||||
this.cbPurgeData = new System.Windows.Forms.CheckBox();
|
this.btnConvertSelected = new System.Windows.Forms.Button();
|
||||||
this.lblTime = new System.Windows.Forms.Label();
|
this.btnLoadTreeDB = new System.Windows.Forms.Button();
|
||||||
this.pbStep = new System.Windows.Forms.ProgressBar();
|
this.cbPurgeData = new System.Windows.Forms.CheckBox();
|
||||||
this.pbSect = new System.Windows.Forms.ProgressBar();
|
this.lblTime = new System.Windows.Forms.Label();
|
||||||
this.pbProc = new System.Windows.Forms.ProgressBar();
|
this.pbStep = new System.Windows.Forms.ProgressBar();
|
||||||
this.cbSaveDoc = new System.Windows.Forms.CheckBox();
|
this.pbSect = new System.Windows.Forms.ProgressBar();
|
||||||
this.cbSaveRTF = new System.Windows.Forms.CheckBox();
|
this.pbProc = new System.Windows.Forms.ProgressBar();
|
||||||
this.btnBrowse = new System.Windows.Forms.Button();
|
this.cbSaveDoc = new System.Windows.Forms.CheckBox();
|
||||||
this.tbSource = new System.Windows.Forms.TextBox();
|
this.cbSaveRTF = new System.Windows.Forms.CheckBox();
|
||||||
this.lblStep = new System.Windows.Forms.Label();
|
this.btnBrowse = new System.Windows.Forms.Button();
|
||||||
this.lblSection = new System.Windows.Forms.Label();
|
this.tbSource = new System.Windows.Forms.TextBox();
|
||||||
this.lblProc = new System.Windows.Forms.Label();
|
this.lblStep = new System.Windows.Forms.Label();
|
||||||
this.btnConvert = new System.Windows.Forms.Button();
|
this.lblSection = new System.Windows.Forms.Label();
|
||||||
this.tv = new System.Windows.Forms.TreeView();
|
this.lblProc = new System.Windows.Forms.Label();
|
||||||
this.fbd = new System.Windows.Forms.FolderBrowserDialog();
|
this.btnConvert = new System.Windows.Forms.Button();
|
||||||
this.btnGroup = new System.Windows.Forms.Button();
|
this.tv = new System.Windows.Forms.TreeView();
|
||||||
this.sc.Panel1.SuspendLayout();
|
this.fbd = new System.Windows.Forms.FolderBrowserDialog();
|
||||||
this.sc.Panel2.SuspendLayout();
|
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
|
||||||
this.sc.SuspendLayout();
|
this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
|
||||||
this.SuspendLayout();
|
this.sc.Panel1.SuspendLayout();
|
||||||
//
|
this.sc.Panel2.SuspendLayout();
|
||||||
// sc
|
this.sc.SuspendLayout();
|
||||||
//
|
this.statusStrip1.SuspendLayout();
|
||||||
this.sc.Dock = System.Windows.Forms.DockStyle.Fill;
|
this.SuspendLayout();
|
||||||
this.sc.Location = new System.Drawing.Point(0, 0);
|
//
|
||||||
this.sc.Margin = new System.Windows.Forms.Padding(2);
|
// sc
|
||||||
this.sc.Name = "sc";
|
//
|
||||||
this.sc.Orientation = System.Windows.Forms.Orientation.Horizontal;
|
this.sc.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
//
|
this.sc.Location = new System.Drawing.Point(0, 0);
|
||||||
// sc.Panel1
|
this.sc.Margin = new System.Windows.Forms.Padding(2);
|
||||||
//
|
this.sc.Name = "sc";
|
||||||
this.sc.Panel1.Controls.Add(this.btnGroup);
|
this.sc.Orientation = System.Windows.Forms.Orientation.Horizontal;
|
||||||
this.sc.Panel1.Controls.Add(this.btnVETree_CSLA);
|
//
|
||||||
this.sc.Panel1.Controls.Add(this.btnBrowseVesam);
|
// sc.Panel1
|
||||||
this.sc.Panel1.Controls.Add(this.tbVesamPath);
|
//
|
||||||
this.sc.Panel1.Controls.Add(this.btnVesam);
|
this.sc.Panel1.Controls.Add(this.btnCtTok);
|
||||||
this.sc.Panel1.Controls.Add(this.btnLoadTreeCSLA);
|
this.sc.Panel1.Controls.Add(this.btnGroup);
|
||||||
this.sc.Panel1.Controls.Add(this.cbLazy);
|
this.sc.Panel1.Controls.Add(this.btnVETree_CSLA);
|
||||||
this.sc.Panel1.Controls.Add(this.btnConvertSelected);
|
this.sc.Panel1.Controls.Add(this.btnBrowseVesam);
|
||||||
this.sc.Panel1.Controls.Add(this.btnLoadTreeDB);
|
this.sc.Panel1.Controls.Add(this.tbVesamPath);
|
||||||
this.sc.Panel1.Controls.Add(this.cbPurgeData);
|
this.sc.Panel1.Controls.Add(this.btnVesam);
|
||||||
this.sc.Panel1.Controls.Add(this.lblTime);
|
this.sc.Panel1.Controls.Add(this.btnLoadTreeCSLA);
|
||||||
this.sc.Panel1.Controls.Add(this.pbStep);
|
this.sc.Panel1.Controls.Add(this.cbLazy);
|
||||||
this.sc.Panel1.Controls.Add(this.pbSect);
|
this.sc.Panel1.Controls.Add(this.btnConvertSelected);
|
||||||
this.sc.Panel1.Controls.Add(this.pbProc);
|
this.sc.Panel1.Controls.Add(this.btnLoadTreeDB);
|
||||||
this.sc.Panel1.Controls.Add(this.cbSaveDoc);
|
this.sc.Panel1.Controls.Add(this.cbPurgeData);
|
||||||
this.sc.Panel1.Controls.Add(this.cbSaveRTF);
|
this.sc.Panel1.Controls.Add(this.lblTime);
|
||||||
this.sc.Panel1.Controls.Add(this.btnBrowse);
|
this.sc.Panel1.Controls.Add(this.pbStep);
|
||||||
this.sc.Panel1.Controls.Add(this.tbSource);
|
this.sc.Panel1.Controls.Add(this.pbSect);
|
||||||
this.sc.Panel1.Controls.Add(this.lblStep);
|
this.sc.Panel1.Controls.Add(this.pbProc);
|
||||||
this.sc.Panel1.Controls.Add(this.lblSection);
|
this.sc.Panel1.Controls.Add(this.cbSaveDoc);
|
||||||
this.sc.Panel1.Controls.Add(this.lblProc);
|
this.sc.Panel1.Controls.Add(this.cbSaveRTF);
|
||||||
this.sc.Panel1.Controls.Add(this.btnConvert);
|
this.sc.Panel1.Controls.Add(this.btnBrowse);
|
||||||
//
|
this.sc.Panel1.Controls.Add(this.tbSource);
|
||||||
// sc.Panel2
|
this.sc.Panel1.Controls.Add(this.lblStep);
|
||||||
//
|
this.sc.Panel1.Controls.Add(this.lblSection);
|
||||||
this.sc.Panel2.Controls.Add(this.tv);
|
this.sc.Panel1.Controls.Add(this.lblProc);
|
||||||
this.sc.Size = new System.Drawing.Size(623, 413);
|
this.sc.Panel1.Controls.Add(this.btnConvert);
|
||||||
this.sc.SplitterDistance = 172;
|
//
|
||||||
this.sc.SplitterWidth = 3;
|
// sc.Panel2
|
||||||
this.sc.TabIndex = 46;
|
//
|
||||||
//
|
this.sc.Panel2.Controls.Add(this.tv);
|
||||||
// btnVETree_CSLA
|
this.sc.Size = new System.Drawing.Size(623, 413);
|
||||||
//
|
this.sc.SplitterDistance = 190;
|
||||||
this.btnVETree_CSLA.Location = new System.Drawing.Point(293, 121);
|
this.sc.SplitterWidth = 3;
|
||||||
this.btnVETree_CSLA.Name = "btnVETree_CSLA";
|
this.sc.TabIndex = 46;
|
||||||
this.btnVETree_CSLA.Size = new System.Drawing.Size(145, 21);
|
//
|
||||||
this.btnVETree_CSLA.TabIndex = 68;
|
// btnCtTok
|
||||||
this.btnVETree_CSLA.Text = "Load VETree from CSLA";
|
//
|
||||||
this.btnVETree_CSLA.UseVisualStyleBackColor = true;
|
this.btnCtTok.Location = new System.Drawing.Point(482, 0);
|
||||||
this.btnVETree_CSLA.Click += new System.EventHandler(this.btnVETree_CSLA_Click);
|
this.btnCtTok.Name = "btnCtTok";
|
||||||
//
|
this.btnCtTok.Size = new System.Drawing.Size(96, 20);
|
||||||
// btnBrowseVesam
|
this.btnCtTok.TabIndex = 70;
|
||||||
//
|
this.btnCtTok.Text = "Count Tokens";
|
||||||
this.btnBrowseVesam.Location = new System.Drawing.Point(479, 150);
|
this.btnCtTok.UseVisualStyleBackColor = true;
|
||||||
this.btnBrowseVesam.Margin = new System.Windows.Forms.Padding(2);
|
this.btnCtTok.Click += new System.EventHandler(this.btnCtTok_Click);
|
||||||
this.btnBrowseVesam.Name = "btnBrowseVesam";
|
//
|
||||||
this.btnBrowseVesam.Size = new System.Drawing.Size(119, 19);
|
// btnGroup
|
||||||
this.btnBrowseVesam.TabIndex = 67;
|
//
|
||||||
this.btnBrowseVesam.Text = "Browse for Vesam...";
|
this.btnGroup.Location = new System.Drawing.Point(387, -3);
|
||||||
this.btnBrowseVesam.UseVisualStyleBackColor = true;
|
this.btnGroup.Name = "btnGroup";
|
||||||
this.btnBrowseVesam.Click += new System.EventHandler(this.btnBrowseVesam_Click);
|
this.btnGroup.Size = new System.Drawing.Size(89, 23);
|
||||||
//
|
this.btnGroup.TabIndex = 69;
|
||||||
// tbVesamPath
|
this.btnGroup.Text = "Group/Security";
|
||||||
//
|
this.btnGroup.UseVisualStyleBackColor = true;
|
||||||
this.tbVesamPath.Location = new System.Drawing.Point(114, 150);
|
this.btnGroup.Click += new System.EventHandler(this.btnGroup_Click);
|
||||||
this.tbVesamPath.Name = "tbVesamPath";
|
//
|
||||||
this.tbVesamPath.Size = new System.Drawing.Size(353, 20);
|
// btnVETree_CSLA
|
||||||
this.tbVesamPath.TabIndex = 66;
|
//
|
||||||
this.tbVesamPath.Text = "e:\\ve-proms\\vesam.opt";
|
this.btnVETree_CSLA.Location = new System.Drawing.Point(248, -1);
|
||||||
//
|
this.btnVETree_CSLA.Name = "btnVETree_CSLA";
|
||||||
// btnVesam
|
this.btnVETree_CSLA.Size = new System.Drawing.Size(133, 21);
|
||||||
//
|
this.btnVETree_CSLA.TabIndex = 68;
|
||||||
this.btnVesam.Location = new System.Drawing.Point(2, 148);
|
this.btnVETree_CSLA.Text = "Load VETree from CSLA";
|
||||||
this.btnVesam.Name = "btnVesam";
|
this.btnVETree_CSLA.UseVisualStyleBackColor = true;
|
||||||
this.btnVesam.Size = new System.Drawing.Size(108, 21);
|
this.btnVETree_CSLA.Click += new System.EventHandler(this.btnVETree_CSLA_Click);
|
||||||
this.btnVesam.TabIndex = 65;
|
//
|
||||||
this.btnVesam.Text = "Convert Security";
|
// btnBrowseVesam
|
||||||
this.btnVesam.UseVisualStyleBackColor = true;
|
//
|
||||||
this.btnVesam.Click += new System.EventHandler(this.btnVesam_Click);
|
this.btnBrowseVesam.Location = new System.Drawing.Point(479, 26);
|
||||||
//
|
this.btnBrowseVesam.Margin = new System.Windows.Forms.Padding(2);
|
||||||
// btnLoadTreeCSLA
|
this.btnBrowseVesam.Name = "btnBrowseVesam";
|
||||||
//
|
this.btnBrowseVesam.Size = new System.Drawing.Size(119, 19);
|
||||||
this.btnLoadTreeCSLA.Location = new System.Drawing.Point(295, 96);
|
this.btnBrowseVesam.TabIndex = 67;
|
||||||
this.btnLoadTreeCSLA.Name = "btnLoadTreeCSLA";
|
this.btnBrowseVesam.Text = "Browse for Vesam...";
|
||||||
this.btnLoadTreeCSLA.Size = new System.Drawing.Size(144, 20);
|
this.btnBrowseVesam.UseVisualStyleBackColor = true;
|
||||||
this.btnLoadTreeCSLA.TabIndex = 64;
|
this.btnBrowseVesam.Click += new System.EventHandler(this.btnBrowseVesam_Click);
|
||||||
this.btnLoadTreeCSLA.Text = "Load Tree from CSLA";
|
//
|
||||||
this.btnLoadTreeCSLA.UseVisualStyleBackColor = true;
|
// tbVesamPath
|
||||||
this.btnLoadTreeCSLA.Click += new System.EventHandler(this.btnLoadTreeCSLA_Click);
|
//
|
||||||
//
|
this.tbVesamPath.Location = new System.Drawing.Point(114, 26);
|
||||||
// cbLazy
|
this.tbVesamPath.Name = "tbVesamPath";
|
||||||
//
|
this.tbVesamPath.Size = new System.Drawing.Size(353, 20);
|
||||||
this.cbLazy.AutoSize = true;
|
this.tbVesamPath.TabIndex = 66;
|
||||||
this.cbLazy.Checked = true;
|
this.tbVesamPath.Text = "e:\\ve-proms\\vesam.opt";
|
||||||
this.cbLazy.CheckState = System.Windows.Forms.CheckState.Checked;
|
//
|
||||||
this.cbLazy.Location = new System.Drawing.Point(11, 126);
|
// btnVesam
|
||||||
this.cbLazy.Margin = new System.Windows.Forms.Padding(2);
|
//
|
||||||
this.cbLazy.Name = "cbLazy";
|
this.btnVesam.Location = new System.Drawing.Point(2, 24);
|
||||||
this.cbLazy.Size = new System.Drawing.Size(75, 17);
|
this.btnVesam.Name = "btnVesam";
|
||||||
this.cbLazy.TabIndex = 63;
|
this.btnVesam.Size = new System.Drawing.Size(108, 21);
|
||||||
this.cbLazy.Text = "Lazy Load";
|
this.btnVesam.TabIndex = 65;
|
||||||
this.cbLazy.UseVisualStyleBackColor = true;
|
this.btnVesam.Text = "Convert Security";
|
||||||
//
|
this.btnVesam.UseVisualStyleBackColor = true;
|
||||||
// btnConvertSelected
|
this.btnVesam.Click += new System.EventHandler(this.btnVesam_Click);
|
||||||
//
|
//
|
||||||
this.btnConvertSelected.Location = new System.Drawing.Point(170, 97);
|
// btnLoadTreeCSLA
|
||||||
this.btnConvertSelected.Margin = new System.Windows.Forms.Padding(2);
|
//
|
||||||
this.btnConvertSelected.Name = "btnConvertSelected";
|
this.btnLoadTreeCSLA.Location = new System.Drawing.Point(123, 0);
|
||||||
this.btnConvertSelected.Size = new System.Drawing.Size(108, 19);
|
this.btnLoadTreeCSLA.Name = "btnLoadTreeCSLA";
|
||||||
this.btnConvertSelected.TabIndex = 62;
|
this.btnLoadTreeCSLA.Size = new System.Drawing.Size(119, 20);
|
||||||
this.btnConvertSelected.Text = "Convert Selected";
|
this.btnLoadTreeCSLA.TabIndex = 64;
|
||||||
this.btnConvertSelected.UseVisualStyleBackColor = true;
|
this.btnLoadTreeCSLA.Text = "Load Tree from CSLA";
|
||||||
this.btnConvertSelected.Click += new System.EventHandler(this.btnConvertSelected_Click);
|
this.btnLoadTreeCSLA.UseVisualStyleBackColor = true;
|
||||||
//
|
this.btnLoadTreeCSLA.Click += new System.EventHandler(this.btnLoadTreeCSLA_Click);
|
||||||
// btnLoadTreeDB
|
//
|
||||||
//
|
// cbLazy
|
||||||
this.btnLoadTreeDB.Location = new System.Drawing.Point(450, 97);
|
//
|
||||||
this.btnLoadTreeDB.Margin = new System.Windows.Forms.Padding(2);
|
this.cbLazy.AutoSize = true;
|
||||||
this.btnLoadTreeDB.Name = "btnLoadTreeDB";
|
this.cbLazy.Checked = true;
|
||||||
this.btnLoadTreeDB.Size = new System.Drawing.Size(124, 19);
|
this.cbLazy.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||||
this.btnLoadTreeDB.TabIndex = 60;
|
this.cbLazy.Location = new System.Drawing.Point(478, 142);
|
||||||
this.btnLoadTreeDB.Text = "Load Tree from dBase";
|
this.cbLazy.Margin = new System.Windows.Forms.Padding(2);
|
||||||
this.btnLoadTreeDB.UseVisualStyleBackColor = true;
|
this.cbLazy.Name = "cbLazy";
|
||||||
this.btnLoadTreeDB.Click += new System.EventHandler(this.btnLoadTreeDB_Click);
|
this.cbLazy.Size = new System.Drawing.Size(75, 17);
|
||||||
//
|
this.cbLazy.TabIndex = 63;
|
||||||
// cbPurgeData
|
this.cbLazy.Text = "Lazy Load";
|
||||||
//
|
this.cbLazy.UseVisualStyleBackColor = true;
|
||||||
this.cbPurgeData.AutoSize = true;
|
//
|
||||||
this.cbPurgeData.Checked = true;
|
// btnConvertSelected
|
||||||
this.cbPurgeData.CheckState = System.Windows.Forms.CheckState.Checked;
|
//
|
||||||
this.cbPurgeData.Location = new System.Drawing.Point(479, 75);
|
this.btnConvertSelected.Location = new System.Drawing.Point(2, 166);
|
||||||
this.cbPurgeData.Margin = new System.Windows.Forms.Padding(2);
|
this.btnConvertSelected.Margin = new System.Windows.Forms.Padding(2);
|
||||||
this.cbPurgeData.Name = "cbPurgeData";
|
this.btnConvertSelected.Name = "btnConvertSelected";
|
||||||
this.cbPurgeData.Size = new System.Drawing.Size(119, 17);
|
this.btnConvertSelected.Size = new System.Drawing.Size(160, 19);
|
||||||
this.cbPurgeData.TabIndex = 59;
|
this.btnConvertSelected.TabIndex = 62;
|
||||||
this.cbPurgeData.Text = "Purge Existing Data";
|
this.btnConvertSelected.Text = "Convert Dbf Selected In Tree";
|
||||||
this.cbPurgeData.UseVisualStyleBackColor = true;
|
this.btnConvertSelected.UseVisualStyleBackColor = true;
|
||||||
//
|
this.btnConvertSelected.Click += new System.EventHandler(this.btnConvertSelected_Click);
|
||||||
// lblTime
|
//
|
||||||
//
|
// btnLoadTreeDB
|
||||||
this.lblTime.BackColor = System.Drawing.SystemColors.ButtonShadow;
|
//
|
||||||
this.lblTime.Location = new System.Drawing.Point(70, 92);
|
this.btnLoadTreeDB.Location = new System.Drawing.Point(0, 0);
|
||||||
this.lblTime.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
this.btnLoadTreeDB.Margin = new System.Windows.Forms.Padding(2);
|
||||||
this.lblTime.Name = "lblTime";
|
this.btnLoadTreeDB.Name = "btnLoadTreeDB";
|
||||||
this.lblTime.Size = new System.Drawing.Size(84, 20);
|
this.btnLoadTreeDB.Size = new System.Drawing.Size(118, 19);
|
||||||
this.lblTime.TabIndex = 58;
|
this.btnLoadTreeDB.TabIndex = 60;
|
||||||
//
|
this.btnLoadTreeDB.Text = "Convert Top Folders";
|
||||||
// pbStep
|
this.btnLoadTreeDB.UseVisualStyleBackColor = true;
|
||||||
//
|
this.btnLoadTreeDB.Click += new System.EventHandler(this.btnLoadTreeDB_Click);
|
||||||
this.pbStep.Location = new System.Drawing.Point(160, 76);
|
//
|
||||||
this.pbStep.Margin = new System.Windows.Forms.Padding(2);
|
// cbPurgeData
|
||||||
this.pbStep.Name = "pbStep";
|
//
|
||||||
this.pbStep.Size = new System.Drawing.Size(308, 15);
|
this.cbPurgeData.AutoSize = true;
|
||||||
this.pbStep.TabIndex = 57;
|
this.cbPurgeData.Checked = true;
|
||||||
//
|
this.cbPurgeData.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||||
// pbSect
|
this.cbPurgeData.Location = new System.Drawing.Point(478, 121);
|
||||||
//
|
this.cbPurgeData.Margin = new System.Windows.Forms.Padding(2);
|
||||||
this.pbSect.Location = new System.Drawing.Point(160, 56);
|
this.cbPurgeData.Name = "cbPurgeData";
|
||||||
this.pbSect.Margin = new System.Windows.Forms.Padding(2);
|
this.cbPurgeData.Size = new System.Drawing.Size(119, 17);
|
||||||
this.pbSect.Name = "pbSect";
|
this.cbPurgeData.TabIndex = 59;
|
||||||
this.pbSect.Size = new System.Drawing.Size(307, 15);
|
this.cbPurgeData.Text = "Purge Existing Data";
|
||||||
this.pbSect.TabIndex = 56;
|
this.cbPurgeData.UseVisualStyleBackColor = true;
|
||||||
//
|
//
|
||||||
// pbProc
|
// lblTime
|
||||||
//
|
//
|
||||||
this.pbProc.Location = new System.Drawing.Point(160, 37);
|
this.lblTime.BackColor = System.Drawing.SystemColors.ButtonShadow;
|
||||||
this.pbProc.Margin = new System.Windows.Forms.Padding(2);
|
this.lblTime.Location = new System.Drawing.Point(70, 135);
|
||||||
this.pbProc.Name = "pbProc";
|
this.lblTime.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||||
this.pbProc.Size = new System.Drawing.Size(308, 15);
|
this.lblTime.Name = "lblTime";
|
||||||
this.pbProc.TabIndex = 55;
|
this.lblTime.Size = new System.Drawing.Size(84, 20);
|
||||||
//
|
this.lblTime.TabIndex = 58;
|
||||||
// cbSaveDoc
|
//
|
||||||
//
|
// pbStep
|
||||||
this.cbSaveDoc.AutoSize = true;
|
//
|
||||||
this.cbSaveDoc.Checked = true;
|
this.pbStep.Location = new System.Drawing.Point(160, 119);
|
||||||
this.cbSaveDoc.CheckState = System.Windows.Forms.CheckState.Checked;
|
this.pbStep.Margin = new System.Windows.Forms.Padding(2);
|
||||||
this.cbSaveDoc.Location = new System.Drawing.Point(480, 34);
|
this.pbStep.Name = "pbStep";
|
||||||
this.cbSaveDoc.Margin = new System.Windows.Forms.Padding(2);
|
this.pbStep.Size = new System.Drawing.Size(308, 15);
|
||||||
this.cbSaveDoc.Name = "cbSaveDoc";
|
this.pbStep.TabIndex = 57;
|
||||||
this.cbSaveDoc.Size = new System.Drawing.Size(77, 17);
|
//
|
||||||
this.cbSaveDoc.TabIndex = 54;
|
// pbSect
|
||||||
this.cbSaveDoc.Text = "Save DOC";
|
//
|
||||||
this.cbSaveDoc.UseVisualStyleBackColor = true;
|
this.pbSect.Location = new System.Drawing.Point(160, 99);
|
||||||
this.cbSaveDoc.Click += new System.EventHandler(this.cbSaveDoc_Click);
|
this.pbSect.Margin = new System.Windows.Forms.Padding(2);
|
||||||
//
|
this.pbSect.Name = "pbSect";
|
||||||
// cbSaveRTF
|
this.pbSect.Size = new System.Drawing.Size(307, 15);
|
||||||
//
|
this.pbSect.TabIndex = 56;
|
||||||
this.cbSaveRTF.AutoSize = true;
|
//
|
||||||
this.cbSaveRTF.Location = new System.Drawing.Point(480, 54);
|
// pbProc
|
||||||
this.cbSaveRTF.Margin = new System.Windows.Forms.Padding(2);
|
//
|
||||||
this.cbSaveRTF.Name = "cbSaveRTF";
|
this.pbProc.Location = new System.Drawing.Point(160, 80);
|
||||||
this.cbSaveRTF.Size = new System.Drawing.Size(75, 17);
|
this.pbProc.Margin = new System.Windows.Forms.Padding(2);
|
||||||
this.cbSaveRTF.TabIndex = 53;
|
this.pbProc.Name = "pbProc";
|
||||||
this.cbSaveRTF.Text = "Save RTF";
|
this.pbProc.Size = new System.Drawing.Size(308, 15);
|
||||||
this.cbSaveRTF.UseVisualStyleBackColor = true;
|
this.pbProc.TabIndex = 55;
|
||||||
this.cbSaveRTF.Click += new System.EventHandler(this.cbSaveRTF_Click);
|
//
|
||||||
//
|
// cbSaveDoc
|
||||||
// btnBrowse
|
//
|
||||||
//
|
this.cbSaveDoc.AutoSize = true;
|
||||||
this.btnBrowse.Location = new System.Drawing.Point(479, 10);
|
this.cbSaveDoc.Checked = true;
|
||||||
this.btnBrowse.Margin = new System.Windows.Forms.Padding(2);
|
this.cbSaveDoc.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||||
this.btnBrowse.Name = "btnBrowse";
|
this.cbSaveDoc.Location = new System.Drawing.Point(479, 80);
|
||||||
this.btnBrowse.Size = new System.Drawing.Size(56, 19);
|
this.cbSaveDoc.Margin = new System.Windows.Forms.Padding(2);
|
||||||
this.btnBrowse.TabIndex = 52;
|
this.cbSaveDoc.Name = "cbSaveDoc";
|
||||||
this.btnBrowse.Text = "Browse...";
|
this.cbSaveDoc.Size = new System.Drawing.Size(77, 17);
|
||||||
this.btnBrowse.UseVisualStyleBackColor = true;
|
this.cbSaveDoc.TabIndex = 54;
|
||||||
this.btnBrowse.Click += new System.EventHandler(this.btnBrowse_Click);
|
this.cbSaveDoc.Text = "Save DOC";
|
||||||
//
|
this.cbSaveDoc.UseVisualStyleBackColor = true;
|
||||||
// tbSource
|
this.cbSaveDoc.Click += new System.EventHandler(this.cbSaveDoc_Click);
|
||||||
//
|
//
|
||||||
this.tbSource.Location = new System.Drawing.Point(71, 10);
|
// cbSaveRTF
|
||||||
this.tbSource.Margin = new System.Windows.Forms.Padding(2);
|
//
|
||||||
this.tbSource.Name = "tbSource";
|
this.cbSaveRTF.AutoSize = true;
|
||||||
this.tbSource.Size = new System.Drawing.Size(397, 20);
|
this.cbSaveRTF.Location = new System.Drawing.Point(479, 100);
|
||||||
this.tbSource.TabIndex = 51;
|
this.cbSaveRTF.Margin = new System.Windows.Forms.Padding(2);
|
||||||
this.tbSource.Text = "i:\\vedata\\vewcnfp\\fp.prc";
|
this.cbSaveRTF.Name = "cbSaveRTF";
|
||||||
//
|
this.cbSaveRTF.Size = new System.Drawing.Size(75, 17);
|
||||||
// lblStep
|
this.cbSaveRTF.TabIndex = 53;
|
||||||
//
|
this.cbSaveRTF.Text = "Save RTF";
|
||||||
this.lblStep.BackColor = System.Drawing.SystemColors.ButtonShadow;
|
this.cbSaveRTF.UseVisualStyleBackColor = true;
|
||||||
this.lblStep.Location = new System.Drawing.Point(70, 72);
|
this.cbSaveRTF.Click += new System.EventHandler(this.cbSaveRTF_Click);
|
||||||
this.lblStep.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
//
|
||||||
this.lblStep.Name = "lblStep";
|
// btnBrowse
|
||||||
this.lblStep.Size = new System.Drawing.Size(84, 20);
|
//
|
||||||
this.lblStep.TabIndex = 49;
|
this.btnBrowse.Location = new System.Drawing.Point(479, 53);
|
||||||
//
|
this.btnBrowse.Margin = new System.Windows.Forms.Padding(2);
|
||||||
// lblSection
|
this.btnBrowse.Name = "btnBrowse";
|
||||||
//
|
this.btnBrowse.Size = new System.Drawing.Size(56, 19);
|
||||||
this.lblSection.BackColor = System.Drawing.SystemColors.ButtonShadow;
|
this.btnBrowse.TabIndex = 52;
|
||||||
this.lblSection.Location = new System.Drawing.Point(70, 53);
|
this.btnBrowse.Text = "Browse...";
|
||||||
this.lblSection.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
this.btnBrowse.UseVisualStyleBackColor = true;
|
||||||
this.lblSection.Name = "lblSection";
|
this.btnBrowse.Click += new System.EventHandler(this.btnBrowse_Click);
|
||||||
this.lblSection.Size = new System.Drawing.Size(84, 19);
|
//
|
||||||
this.lblSection.TabIndex = 48;
|
// tbSource
|
||||||
//
|
//
|
||||||
// lblProc
|
this.tbSource.Location = new System.Drawing.Point(71, 53);
|
||||||
//
|
this.tbSource.Margin = new System.Windows.Forms.Padding(2);
|
||||||
this.lblProc.BackColor = System.Drawing.SystemColors.ButtonShadow;
|
this.tbSource.Name = "tbSource";
|
||||||
this.lblProc.Location = new System.Drawing.Point(70, 34);
|
this.tbSource.Size = new System.Drawing.Size(397, 20);
|
||||||
this.lblProc.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
this.tbSource.TabIndex = 51;
|
||||||
this.lblProc.Name = "lblProc";
|
this.tbSource.Text = "i:\\vedata\\vewcnfp\\fp.prc";
|
||||||
this.lblProc.Size = new System.Drawing.Size(84, 19);
|
this.tbSource.TextChanged += new System.EventHandler(this.tbSource_TextChanged);
|
||||||
this.lblProc.TabIndex = 47;
|
//
|
||||||
//
|
// lblStep
|
||||||
// btnConvert
|
//
|
||||||
//
|
this.lblStep.BackColor = System.Drawing.SystemColors.ButtonShadow;
|
||||||
this.btnConvert.Location = new System.Drawing.Point(2, 9);
|
this.lblStep.Location = new System.Drawing.Point(70, 115);
|
||||||
this.btnConvert.Margin = new System.Windows.Forms.Padding(2);
|
this.lblStep.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||||
this.btnConvert.Name = "btnConvert";
|
this.lblStep.Name = "lblStep";
|
||||||
this.btnConvert.Size = new System.Drawing.Size(56, 19);
|
this.lblStep.Size = new System.Drawing.Size(84, 20);
|
||||||
this.btnConvert.TabIndex = 46;
|
this.lblStep.TabIndex = 49;
|
||||||
this.btnConvert.Text = "Convert";
|
//
|
||||||
this.btnConvert.Click += new System.EventHandler(this.btnConvert_Click);
|
// lblSection
|
||||||
//
|
//
|
||||||
// tv
|
this.lblSection.BackColor = System.Drawing.SystemColors.ButtonShadow;
|
||||||
//
|
this.lblSection.Location = new System.Drawing.Point(70, 96);
|
||||||
this.tv.CheckBoxes = true;
|
this.lblSection.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||||
this.tv.Dock = System.Windows.Forms.DockStyle.Bottom;
|
this.lblSection.Name = "lblSection";
|
||||||
this.tv.Location = new System.Drawing.Point(0, 1);
|
this.lblSection.Size = new System.Drawing.Size(84, 19);
|
||||||
this.tv.Margin = new System.Windows.Forms.Padding(2);
|
this.lblSection.TabIndex = 48;
|
||||||
this.tv.Name = "tv";
|
//
|
||||||
this.tv.Size = new System.Drawing.Size(623, 237);
|
// lblProc
|
||||||
this.tv.TabIndex = 24;
|
//
|
||||||
this.tv.BeforeExpand += new System.Windows.Forms.TreeViewCancelEventHandler(this.tv_BeforeExpand);
|
this.lblProc.BackColor = System.Drawing.SystemColors.ButtonShadow;
|
||||||
this.tv.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.tv_AfterSelect);
|
this.lblProc.Location = new System.Drawing.Point(70, 77);
|
||||||
//
|
this.lblProc.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||||
// btnGroup
|
this.lblProc.Name = "lblProc";
|
||||||
//
|
this.lblProc.Size = new System.Drawing.Size(84, 19);
|
||||||
this.btnGroup.Location = new System.Drawing.Point(505, 118);
|
this.lblProc.TabIndex = 47;
|
||||||
this.btnGroup.Name = "btnGroup";
|
//
|
||||||
this.btnGroup.Size = new System.Drawing.Size(75, 23);
|
// btnConvert
|
||||||
this.btnGroup.TabIndex = 69;
|
//
|
||||||
this.btnGroup.Text = "Group";
|
this.btnConvert.Location = new System.Drawing.Point(2, 54);
|
||||||
this.btnGroup.UseVisualStyleBackColor = true;
|
this.btnConvert.Margin = new System.Windows.Forms.Padding(2);
|
||||||
this.btnGroup.Click += new System.EventHandler(this.btnGroup_Click);
|
this.btnConvert.Name = "btnConvert";
|
||||||
//
|
this.btnConvert.Size = new System.Drawing.Size(56, 40);
|
||||||
// frmLoader
|
this.btnConvert.TabIndex = 46;
|
||||||
//
|
this.btnConvert.Text = "Convert Dbf";
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
this.btnConvert.Click += new System.EventHandler(this.btnConvert_Click);
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
//
|
||||||
this.ClientSize = new System.Drawing.Size(623, 413);
|
// tv
|
||||||
this.Controls.Add(this.sc);
|
//
|
||||||
this.Margin = new System.Windows.Forms.Padding(2);
|
this.tv.CheckBoxes = true;
|
||||||
this.Name = "frmLoader";
|
this.tv.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||||
this.Text = "frmLoader";
|
this.tv.Location = new System.Drawing.Point(0, -4);
|
||||||
this.sc.Panel1.ResumeLayout(false);
|
this.tv.Margin = new System.Windows.Forms.Padding(2);
|
||||||
this.sc.Panel1.PerformLayout();
|
this.tv.Name = "tv";
|
||||||
this.sc.Panel2.ResumeLayout(false);
|
this.tv.Size = new System.Drawing.Size(623, 224);
|
||||||
this.sc.ResumeLayout(false);
|
this.tv.TabIndex = 24;
|
||||||
this.ResumeLayout(false);
|
this.tv.BeforeExpand += new System.Windows.Forms.TreeViewCancelEventHandler(this.tv_BeforeExpand);
|
||||||
|
this.tv.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.tv_AfterSelect);
|
||||||
|
//
|
||||||
|
// statusStrip1
|
||||||
|
//
|
||||||
|
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||||
|
this.toolStripStatusLabel1});
|
||||||
|
this.statusStrip1.Location = new System.Drawing.Point(0, 391);
|
||||||
|
this.statusStrip1.Name = "statusStrip1";
|
||||||
|
this.statusStrip1.Size = new System.Drawing.Size(623, 22);
|
||||||
|
this.statusStrip1.TabIndex = 47;
|
||||||
|
this.statusStrip1.Text = "statusStrip1";
|
||||||
|
//
|
||||||
|
// toolStripStatusLabel1
|
||||||
|
//
|
||||||
|
this.toolStripStatusLabel1.Name = "toolStripStatusLabel1";
|
||||||
|
this.toolStripStatusLabel1.Size = new System.Drawing.Size(97, 17);
|
||||||
|
this.toolStripStatusLabel1.Text = "Status Information";
|
||||||
|
//
|
||||||
|
// frmLoader
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.ClientSize = new System.Drawing.Size(623, 413);
|
||||||
|
this.Controls.Add(this.statusStrip1);
|
||||||
|
this.Controls.Add(this.sc);
|
||||||
|
this.Margin = new System.Windows.Forms.Padding(2);
|
||||||
|
this.Name = "frmLoader";
|
||||||
|
this.Text = "frmLoader";
|
||||||
|
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmLoader_FormClosing);
|
||||||
|
this.Load += new System.EventHandler(this.frmLoader_Load);
|
||||||
|
this.sc.Panel1.ResumeLayout(false);
|
||||||
|
this.sc.Panel1.PerformLayout();
|
||||||
|
this.sc.Panel2.ResumeLayout(false);
|
||||||
|
this.sc.ResumeLayout(false);
|
||||||
|
this.statusStrip1.ResumeLayout(false);
|
||||||
|
this.statusStrip1.PerformLayout();
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
this.PerformLayout();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -378,5 +416,8 @@ namespace DataLoader
|
|||||||
private System.Windows.Forms.Button btnBrowseVesam;
|
private System.Windows.Forms.Button btnBrowseVesam;
|
||||||
private System.Windows.Forms.Button btnVETree_CSLA;
|
private System.Windows.Forms.Button btnVETree_CSLA;
|
||||||
private System.Windows.Forms.Button btnGroup;
|
private System.Windows.Forms.Button btnGroup;
|
||||||
|
private System.Windows.Forms.Button btnCtTok;
|
||||||
|
private System.Windows.Forms.StatusStrip statusStrip1;
|
||||||
|
private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -13,7 +13,7 @@ using System.Collections;
|
|||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Data.OleDb;
|
using System.Data.OleDb;
|
||||||
using System.Collections.Specialized;
|
using System.Collections.Specialized;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Xml;
|
using System.Xml;
|
||||||
@ -22,64 +22,49 @@ using System.Text;
|
|||||||
using Volian.MSWord;
|
using Volian.MSWord;
|
||||||
using vlnObjectLibrary;
|
using vlnObjectLibrary;
|
||||||
using vlnServerLibrary;
|
using vlnServerLibrary;
|
||||||
using Volian.CSLA.Library;
|
using VEPROMS.CSLA.Library;
|
||||||
using Config;
|
using Config;
|
||||||
|
|
||||||
|
|
||||||
[assembly: log4net.Config.XmlConfigurator(Watch = true)]
|
[assembly: log4net.Config.XmlConfigurator(Watch = true)]
|
||||||
|
|
||||||
namespace DataLoader
|
namespace DataLoader
|
||||||
{
|
{
|
||||||
public partial class frmLoader : Form
|
public partial class frmLoader : Form
|
||||||
{
|
{
|
||||||
|
private bool _Loading = true;
|
||||||
|
|
||||||
|
private FolderTreeNode _topnode;
|
||||||
|
private bool UseVeTree = false;
|
||||||
#region Log4Net
|
#region Log4Net
|
||||||
public static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
public static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
#endregion
|
#endregion
|
||||||
#region ClassProperties
|
private Loader ldr;
|
||||||
private int wms = 500;
|
public bool cbSaveDocChecked { get { return cbSaveDoc.Checked; } }
|
||||||
private static int EDDATA = 0x01;
|
public bool cbSaveRTFChecked { get { return cbSaveRTF.Checked; } }
|
||||||
private static int PH = 0x02;
|
public TreeView TV { get { return tv; } }
|
||||||
private static int TOC = 0x04;
|
public int pbProcMaximum { get { return pbProc.Maximum; } set { pbProc.Maximum = value; } }
|
||||||
private static int AUTOIND = 0x08;
|
public int pbSectMaximum { get { return pbSect.Maximum; } set { pbSect.Maximum = value; } }
|
||||||
private static int AUTOGEN = 0x40;
|
public int pbSectValue { get { return pbSect.Value; } set { pbSect.Value = value; } }
|
||||||
|
public int pbStepMaximum { get { return pbStep.Maximum; } set { pbStep.Maximum = value; } }
|
||||||
private static int STP_COMMENT = 0;
|
public int pbStepValue { get { return pbStep.Value; } set { pbStep.Value = value; } }
|
||||||
private static int STP_MULT_CHGID = 1;
|
public int pbProcValue { get { return pbProc.Value; } set { pbProc.Value = value; } }
|
||||||
private static int STP_LNK_SEQ = 2;
|
|
||||||
private static int STP_OVR_TAB = 3;
|
|
||||||
|
|
||||||
private string ProcFileName;
|
|
||||||
private string ProcNumber;
|
|
||||||
private ROFST rofst;
|
|
||||||
private int EditSectId;
|
|
||||||
private Dictionary<string, int> dicLibDocRef;
|
|
||||||
|
|
||||||
// have a few variables for storing the database id record & the system record.
|
|
||||||
private Connection dbConn;
|
|
||||||
private Folder sysFolder;
|
|
||||||
FolderTreeNode _topnode;
|
|
||||||
|
|
||||||
// the following two dictionaries are used to handle migration of the
|
public string Status
|
||||||
// transitions... dicTrans_StrDone gets an entry for procnumber, sequence
|
|
||||||
// number and the new structure id as a step or section is created (transitions
|
|
||||||
// can go to steps or sections). When a transition is encountered, check this
|
|
||||||
// dictionary to see if the step or section was migrated & use the structureid
|
|
||||||
// for the step or section if it was migrated. When a transition is migrated where
|
|
||||||
// the 'to' has not been migrated yet, check if an entry exists in dicTrans_StrIds,
|
|
||||||
// if so, use the id listed here. If no entry exists in dicTrans_StrIds, create
|
|
||||||
// a structure table record and use the id as part of the 'to', and add an entry to
|
|
||||||
// dicTrans_StpIds to flag that the record was already created. As migrating sections
|
|
||||||
// and steps, check this dicTrans_StrIds to see if the structure record has already
|
|
||||||
// been create, if so use it and remove it from the dicTrans_StrIds dictionary,
|
|
||||||
// otherwise, create a new structure record.
|
|
||||||
private Dictionary<string, int> dicTrans_StrDone;
|
|
||||||
private Dictionary<string, int> dicTrans_StrIds;
|
|
||||||
private Dictionary<object, string> dicOldStepSequence;
|
|
||||||
private Dictionary<TreeNode, TreeNode> dicNeedToLoad;
|
|
||||||
private bool UseVeTree = false;
|
|
||||||
#endregion
|
|
||||||
public frmLoader()
|
|
||||||
{
|
{
|
||||||
|
get { return toolStripStatusLabel1.Text; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
toolStripStatusLabel1.Text = value;
|
||||||
|
Application.DoEvents();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string tbSourceText { get { return tbSource.Text; } set { tbSource.Text = value; } }
|
||||||
|
|
||||||
|
public frmLoader()
|
||||||
|
{
|
||||||
|
ldr = new Loader(log, this);
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
lblTime.Tag = DateTime.Now;
|
lblTime.Tag = DateTime.Now;
|
||||||
switch (SystemInformation.ComputerName.ToUpper())
|
switch (SystemInformation.ComputerName.ToUpper())
|
||||||
@ -88,7 +73,7 @@ namespace DataLoader
|
|||||||
//tbSource.Text = "G:\\VEIP2\\PROCS"; // basic data
|
//tbSource.Text = "G:\\VEIP2\\PROCS"; // basic data
|
||||||
//tbSource.Text = "G:\\VEFNP\\AOP1.PRC"; // test subsections, checkoffs, comments & continuous action flag
|
//tbSource.Text = "G:\\VEFNP\\AOP1.PRC"; // test subsections, checkoffs, comments & continuous action flag
|
||||||
//tbSource.Text = "G:\\vecal\\eops.bck"; // test link seq STP_LNK_SEQ
|
//tbSource.Text = "G:\\vecal\\eops.bck"; // test link seq STP_LNK_SEQ
|
||||||
tbSource.Text = "G:\\vehlp\\procs";// multiple change ids.
|
tbSource.Text = "G:\\vewcnckl\\ckl.prc";// multiple change ids.
|
||||||
break;
|
break;
|
||||||
case "RHMDESKTOP":
|
case "RHMDESKTOP":
|
||||||
//tbSource.Text = @"I:\UNZIPPED ACTIVE BASELINE DATA\vehlp\Procs"; // Sub-sections
|
//tbSource.Text = @"I:\UNZIPPED ACTIVE BASELINE DATA\vehlp\Procs"; // Sub-sections
|
||||||
@ -97,7 +82,6 @@ namespace DataLoader
|
|||||||
default:
|
default:
|
||||||
throw new Exception("Not configured for " + SystemInformation.ComputerName);
|
throw new Exception("Not configured for " + SystemInformation.ComputerName);
|
||||||
}
|
}
|
||||||
dicNeedToLoad = new Dictionary<TreeNode, TreeNode>();
|
|
||||||
}
|
}
|
||||||
private void btnConvertSelected_Click(object sender, EventArgs e)
|
private void btnConvertSelected_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
@ -110,23 +94,18 @@ namespace DataLoader
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
object o = tn.VEObject;
|
object o = tn.VEObject;
|
||||||
//object o = tn.Tag;
|
|
||||||
if (o.GetType() != typeof(DocVersionInfo))
|
if (o.GetType() != typeof(DocVersionInfo))
|
||||||
{
|
{
|
||||||
MessageBox.Show("Must select a version node (working draft, approved, etc)", "No Node Selected");
|
MessageBox.Show("Must select a version node (working draft, approved, etc)", "No Node Selected");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DocVersion v = ((DocVersionInfo)o).Get();
|
DocVersion v = ((DocVersionInfo)o).Get();
|
||||||
int istr = MigrateDocVersion(v.Title);
|
Item itm = ldr.MigrateDocVersion(v);
|
||||||
if (istr > 0)
|
if (itm != null)
|
||||||
{
|
{
|
||||||
|
tn.Checked = true;
|
||||||
v.StructureID = istr;
|
|
||||||
v.Title = "";
|
|
||||||
v.Save(true); // true forces save.
|
|
||||||
tn.Checked = true;
|
|
||||||
//TODO: Walk up structure and set check boxes appropriately.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -143,15 +122,10 @@ namespace DataLoader
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DocVersion v = (DocVersion)o;
|
DocVersion v = (DocVersion)o;
|
||||||
int istr = MigrateDocVersion(v.Title);
|
Item itm = ldr.MigrateDocVersion(v);
|
||||||
if (istr > 0)
|
if (itm != null)
|
||||||
{
|
{
|
||||||
|
|
||||||
v.StructureID = istr;
|
|
||||||
v.Title = "";
|
|
||||||
v.Save(true); // true forces save.
|
|
||||||
tn.Checked = true;
|
tn.Checked = true;
|
||||||
//TODO: Walk up structure and set check boxes appropriately.
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -169,8 +143,8 @@ namespace DataLoader
|
|||||||
{
|
{
|
||||||
case "Volian.CSLA.Library.FolderInfo":
|
case "Volian.CSLA.Library.FolderInfo":
|
||||||
FolderInfo fld = (FolderInfo)o;
|
FolderInfo fld = (FolderInfo)o;
|
||||||
if (fld.DocVersionCount>0)
|
if (fld.ChildFolderCount>0)
|
||||||
tn.Checked = LoadChildren(fld, tn); // load docversions.
|
tn.Checked = ldr.LoadChildren(fld, tn); // load docversions.
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -186,61 +160,44 @@ namespace DataLoader
|
|||||||
if (o.GetType() == typeof(DocVersion)) tbSource.Text = ((DocVersion)o).Title;
|
if (o.GetType() == typeof(DocVersion)) tbSource.Text = ((DocVersion)o).Title;
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool LoadFolders()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
// make the initial database connection record
|
|
||||||
dbConn = Connection.MakeConnection("Default", "Default", "Data Source=.\\SQLEXPRESS;Initial Catalog=VEPROMS;Integrated Security=True", 1, null);
|
|
||||||
ConfigFile cfg = new ConfigFile();
|
|
||||||
|
|
||||||
|
|
||||||
XmlDocument d = cfg.LoadSystemIni();
|
|
||||||
sysFolder = Folder.MakeFolder(0, dbConn.DBID, "system", "system", d.InnerXml);
|
|
||||||
|
|
||||||
// This is to test the vln Libraries
|
|
||||||
List<Folder> lfldr = vlnDataPathFolders();
|
|
||||||
|
|
||||||
List<vlnObject> dp2 = new List<vlnObject>();
|
|
||||||
foreach (Folder fldr in lfldr)
|
|
||||||
{
|
|
||||||
TreeNode tn = tv.Nodes.Add(fldr.Name);
|
|
||||||
tn.Tag = fldr;
|
|
||||||
vlnObject vb = new vlnObject(null, "datapath", fldr.Name, fldr.Title);
|
|
||||||
dp2.Add(vb);
|
|
||||||
vlnServer vs = new vlnServer();
|
|
||||||
MigrateChildren(vb, vs, fldr.DBID, fldr.FolderID, tn);
|
|
||||||
tn.Expand();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
log.ErrorFormat("Could not load data, error = {0}", ex.Message);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
private void btnLoadTreeDB_Click(object sender, EventArgs e)
|
private void btnLoadTreeDB_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
// When loading folders, i.e. the tree from dBase (old 16-bit)
|
// When loading folders, i.e. the tree from dBase (old 16-bit)
|
||||||
// always clear the data
|
// always clear the data
|
||||||
ClearData();
|
ldr.ClearData();
|
||||||
bool suc = LoadFolders();
|
bool suc = ldr.LoadFolders();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnConvert_Click(object sender, System.EventArgs e)
|
private void btnConvert_Click(object sender, System.EventArgs e)
|
||||||
{
|
{
|
||||||
|
Database.LoggingInfo = false;
|
||||||
bool success = true;
|
bool success = true;
|
||||||
// if purge data, purge it all & reload folders & security.
|
// if purge data, purge it all & reload folders & security.
|
||||||
if (cbPurgeData.Checked)
|
if (cbPurgeData.Checked)
|
||||||
{
|
{
|
||||||
ClearData();
|
ldr.ClearData();
|
||||||
success=LoadFolders();
|
success=ldr.LoadFolders();
|
||||||
if (success)success=LoadSecurity();
|
if (success) success = ldr.LoadSecurity(tbVesamPath.Text);
|
||||||
|
}
|
||||||
|
if (success)
|
||||||
|
{
|
||||||
|
DateTime tstart = DateTime.Now;
|
||||||
|
DocVersionInfoList vl = DocVersionInfoList.Get();
|
||||||
|
DocVersion v = null;
|
||||||
|
foreach (DocVersionInfo vi in vl)
|
||||||
|
{
|
||||||
|
if (vi.Title.ToUpper() == tbSource.Text.ToUpper())
|
||||||
|
{
|
||||||
|
v = DocVersion.Get(vi.VersionID);
|
||||||
|
Database.LogInfoFormat("Before MigrateDocVersion");
|
||||||
|
Item itm = ldr.MigrateDocVersion(v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
MessageBox.Show(string.Format("{0} seconds",TimeSpan.FromTicks(DateTime.Now.Ticks-tstart.Ticks).TotalSeconds));
|
||||||
}
|
}
|
||||||
if (success) MigrateDocVersion(tbSource.Text);
|
|
||||||
}
|
}
|
||||||
private void UpdateLabels(int incPrc, int incSec, int incStp)
|
public void UpdateLabels(int incPrc, int incSec, int incStp)
|
||||||
{
|
{
|
||||||
if (incPrc == 0 && incSec == 0 && incStp == 0)//Reset
|
if (incPrc == 0 && incSec == 0 && incStp == 0)//Reset
|
||||||
{
|
{
|
||||||
@ -262,6 +219,7 @@ namespace DataLoader
|
|||||||
log.ErrorFormat("{0}\r\n\r\n{1}", ex.Message, ex.InnerException);
|
log.ErrorFormat("{0}\r\n\r\n{1}", ex.Message, ex.InnerException);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//Database.LoggingInfo = (pbProc.Value > 153 && pbSect.Value > 11 && pbStep.Value > 61);
|
||||||
lblProc.Text = string.Format("{0} Procedures", pbProc.Value);
|
lblProc.Text = string.Format("{0} Procedures", pbProc.Value);
|
||||||
lblSection.Text = string.Format("{0} Sections", pbSect.Value);
|
lblSection.Text = string.Format("{0} Sections", pbSect.Value);
|
||||||
lblStep.Text = string.Format("{0} Steps", pbStep.Value);
|
lblStep.Text = string.Format("{0} Steps", pbStep.Value);
|
||||||
@ -286,89 +244,8 @@ namespace DataLoader
|
|||||||
{
|
{
|
||||||
if (cbSaveDoc.Checked) cbSaveRTF.Checked = false;
|
if (cbSaveDoc.Checked) cbSaveRTF.Checked = false;
|
||||||
}
|
}
|
||||||
private void Wait(int n)
|
|
||||||
{
|
|
||||||
DateTime dtw = DateTime.Now.AddSeconds(n);
|
|
||||||
while (DateTime.Now < dtw)
|
|
||||||
{
|
|
||||||
Application.DoEvents();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
private void WaitMS(int n)
|
|
||||||
{
|
|
||||||
DateTime dtw = DateTime.Now.AddMilliseconds(n);
|
|
||||||
while (DateTime.Now < dtw)
|
|
||||||
{
|
|
||||||
Application.DoEvents();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
private void ClearData()
|
|
||||||
{
|
|
||||||
Database.PurgeData();
|
|
||||||
}
|
|
||||||
public static string MakeDate(string src)
|
|
||||||
{
|
|
||||||
if (src.Trim() == "") return null;
|
|
||||||
int[] DateOffset ={ 4, 5, 47, 6, 7, 47, 0, 1, 2, 3 }; // 47 = '/'
|
|
||||||
StringBuilder datebuff = new StringBuilder(10);
|
|
||||||
for (int i = 0; i < DateOffset.Length; i++)
|
|
||||||
{
|
|
||||||
if (DateOffset[i] < 9)
|
|
||||||
datebuff.Append(src[DateOffset[i]]);
|
|
||||||
else
|
|
||||||
datebuff.Append(System.Convert.ToChar(DateOffset[i]));
|
|
||||||
}
|
|
||||||
return datebuff.ToString();
|
|
||||||
}
|
|
||||||
private DateTime GetDTS(string date, string time)
|
|
||||||
{
|
|
||||||
// Set the date/time stamp. If there is no 'date', set the date
|
|
||||||
// to 1/1/2000 (this can be changed!). If there is not 'time',
|
|
||||||
// set the time to 0:0:0 (midnight).
|
|
||||||
|
|
||||||
DateTime dts = DateTime.Now;
|
|
||||||
string month = "01";
|
|
||||||
string day = "01";
|
|
||||||
string year = "2000";
|
|
||||||
string hour = "";
|
|
||||||
string minute = "";
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (date != null && date != "")
|
|
||||||
{
|
|
||||||
int indx1 = date.IndexOf("/");
|
|
||||||
month = date.Substring(0, indx1);
|
|
||||||
int indx2 = date.IndexOf("/", indx1 + 1);
|
|
||||||
day = date.Substring(indx1 + 1, indx2 - indx1 - 1);
|
|
||||||
year = date.Substring(indx2 + 1, 4);
|
|
||||||
}
|
|
||||||
if (time == null || time == "")
|
|
||||||
{
|
|
||||||
hour = "0";
|
|
||||||
minute = "0";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
|
|
||||||
hour = time.Substring(0, 2);
|
|
||||||
int indxc = time.IndexOfAny(":A-".ToCharArray());
|
|
||||||
if (indxc == time.Length - 1)
|
|
||||||
minute = time.Substring(2, 2);
|
|
||||||
else
|
|
||||||
minute = time.Substring(indxc + 1, time.Length - indxc - 1);
|
|
||||||
}
|
|
||||||
dts = new DateTime(System.Convert.ToInt32(year), System.Convert.ToInt32(month), System.Convert.ToInt32(day),
|
|
||||||
System.Convert.ToInt32(hour), System.Convert.ToInt32(minute), 0);
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
log.ErrorFormat("DATE/TIME {0} {1}", date, time);
|
|
||||||
log.ErrorFormat("{0}\r\n\r\n{1}", ex.Message, ex.InnerException);
|
|
||||||
log.ErrorFormat(ex.StackTrace);
|
|
||||||
return dts;
|
|
||||||
}
|
|
||||||
return dts;
|
|
||||||
}
|
|
||||||
private void btnLoadTreeCSLA_Click(object sender, EventArgs e)
|
private void btnLoadTreeCSLA_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
_topnode = FolderTreeNode.BuildTreeList();
|
_topnode = FolderTreeNode.BuildTreeList();
|
||||||
@ -384,26 +261,21 @@ namespace DataLoader
|
|||||||
tbVesamPath.Text = fbd.SelectedPath;
|
tbVesamPath.Text = fbd.SelectedPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool LoadSecurity()
|
|
||||||
{
|
|
||||||
Security sec = new Security(tbVesamPath.Text);
|
|
||||||
return sec.Migrate();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void btnVesam_Click(object sender, EventArgs e)
|
private void btnVesam_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
// if purge data, purge it all & reload folders.
|
// if purge data, purge it all & reload folders.
|
||||||
if (cbPurgeData.Checked)
|
if (cbPurgeData.Checked)
|
||||||
{
|
{
|
||||||
ClearData();
|
ldr.ClearData();
|
||||||
LoadFolders();
|
ldr.LoadFolders();
|
||||||
}
|
}
|
||||||
bool sec = LoadSecurity();
|
bool sec = ldr.LoadSecurity(tbVesamPath.Text);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnVETree_CSLA_Click(object sender, EventArgs e)
|
private void btnVETree_CSLA_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
tv.Nodes.Add(VEFolder.LoadTree());
|
tv.Nodes.Add(VETreeNode.GetFolder(1));
|
||||||
UseVeTree = true;
|
UseVeTree = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -412,5 +284,69 @@ namespace DataLoader
|
|||||||
GroupProp f = new GroupProp();
|
GroupProp f = new GroupProp();
|
||||||
f.ShowDialog();
|
f.ShowDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void tbSource_TextChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnCtTok_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
frmCntTkn frm = new frmCntTkn();
|
||||||
|
frm.ShowDialog();
|
||||||
|
}
|
||||||
|
public void UpdateLabelsSetProc(int prc)
|
||||||
|
{
|
||||||
|
pbProc.Maximum = prc;
|
||||||
|
}
|
||||||
|
public void UpdateLabelsSetSect(int sec)
|
||||||
|
{
|
||||||
|
pbSect.Maximum = sec;
|
||||||
|
}
|
||||||
|
public void UpdateLabelsLibDocs(int incLib, int incUsages)
|
||||||
|
{
|
||||||
|
if (incLib == 0 && incUsages == 0)//Reset
|
||||||
|
{
|
||||||
|
lblTime.Tag = DateTime.Now;
|
||||||
|
pbProc.Value = 0;
|
||||||
|
pbSect.Value = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pbProc.Value += incLib;
|
||||||
|
pbSect.Value += incUsages;
|
||||||
|
}
|
||||||
|
lblProc.Text = string.Format("{0} Lib Docs", pbProc.Value);
|
||||||
|
lblSection.Text = string.Format("{0} Usages", pbSect.Value);
|
||||||
|
lblStep.Text = "";
|
||||||
|
TimeSpan ts = new TimeSpan(DateTime.Now.Ticks - ((DateTime)lblTime.Tag).Ticks);
|
||||||
|
lblTime.Text = string.Format("{0:D2}:{1:D2}:{2:D2} Elapsed", ts.Hours, ts.Minutes, ts.Seconds);
|
||||||
|
Application.DoEvents();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void frmLoader_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (Properties.Settings.Default["VeSamFilename"] != null)
|
||||||
|
this.tbVesamPath.Text = Properties.Settings.Default.VeSamFilename;
|
||||||
|
if (Properties.Settings.Default["DbfPathname"] != null)
|
||||||
|
this.tbSource.Text = Properties.Settings.Default.DbfPathname;
|
||||||
|
if (Properties.Settings.Default["LoadWordDoc"] != null)
|
||||||
|
this.cbSaveDoc.CheckState = Properties.Settings.Default.LoadWordDoc;
|
||||||
|
if (Properties.Settings.Default["PurgeData"] != null)
|
||||||
|
this.cbPurgeData.CheckState = Properties.Settings.Default.PurgeData;
|
||||||
|
if (Properties.Settings.Default["LoadRTFDoc"] != null)
|
||||||
|
this.cbSaveRTF.CheckState = Properties.Settings.Default.LoadRTFDoc;
|
||||||
|
_Loading = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void frmLoader_FormClosing(object sender, FormClosingEventArgs e)
|
||||||
|
{
|
||||||
|
Properties.Settings.Default.VeSamFilename = tbVesamPath.Text;
|
||||||
|
Properties.Settings.Default.DbfPathname = tbSource.Text;
|
||||||
|
Properties.Settings.Default.LoadWordDoc = cbSaveDoc.CheckState;
|
||||||
|
Properties.Settings.Default.LoadRTFDoc = cbSaveRTF.CheckState;
|
||||||
|
Properties.Settings.Default.PurgeData = cbPurgeData.CheckState;
|
||||||
|
Properties.Settings.Default.Save();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -120,4 +120,7 @@
|
|||||||
<metadata name="fbd.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
<metadata name="fbd.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
<value>17, 17</value>
|
<value>17, 17</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
|
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
|
<value>84, 17</value>
|
||||||
|
</metadata>
|
||||||
</root>
|
</root>
|
Loading…
x
Reference in New Issue
Block a user