diff --git a/PROMS/DataLoader/App.config b/PROMS/DataLoader/App.config
deleted file mode 100644
index 55bfd659..00000000
--- a/PROMS/DataLoader/App.config
+++ /dev/null
@@ -1,178 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Checked
-
-
- Unchecked
-
-
- Checked
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Data Source=.\SQLEXPRESS;Initial Catalog={DBName};Integrated Security=True
-
-
- VEPROMS
-
-
-
-
-
-
-
-
- Unchecked
-
-
- 0
-
-
- 1
-
-
- Checked
-
-
- Checked
-
-
- 0
-
-
- Phase1
-
-
- Phase2
-
-
- Phase3
-
-
- c:\development\fmtall
-
-
- c:\development\genmacall
-
-
- False
-
-
- Phase4
-
-
-
-
-
- 0
-
-
- -1
-
-
- False
-
-
- False
-
-
- False
-
-
- 0
-
-
-
-
diff --git a/PROMS/DataLoader/App.config.org b/PROMS/DataLoader/App.config.org
deleted file mode 100644
index 2f3501bd..00000000
--- a/PROMS/DataLoader/App.config.org
+++ /dev/null
@@ -1,177 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Checked
-
-
- Unchecked
-
-
- Checked
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Data Source=.\SQLEXPRESS;Initial Catalog={DBName};Integrated Security=True
-
-
- VEPROMS
-
-
-
-
-
-
-
-
- Unchecked
-
-
- 0
-
-
- 1
-
-
- Checked
-
-
- Checked
-
-
- 0
-
-
- Phase1
-
-
- Phase2
-
-
- Phase3
-
-
- c:\development\fmtall
-
-
- c:\development\genmacall
-
-
- False
-
-
- Phase4
-
-
-
-
-
- 0
-
-
- -1
-
-
- False
-
-
- False
-
-
- False
-
-
-
-
diff --git a/PROMS/DataLoader/Applicability.cs b/PROMS/DataLoader/Applicability.cs
deleted file mode 100644
index a035ca6e..00000000
--- a/PROMS/DataLoader/Applicability.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.IO;
-
-namespace DataLoader
-{
- public partial class Loader
- {
- public Dictionary MyProcAPL;
- private static Dictionary GetApple(string proc)
- {
- Dictionary procAPL = new Dictionary();
- FileInfo myFile = new FileInfo(proc);
- FileStream fs = myFile.OpenRead();
- BinaryReader br = new BinaryReader(fs);
- byte[] myBuff = new byte[myFile.Length];
- br.Read(myBuff, 0, (int)myFile.Length);
- br.Close();
- fs.Close();
- int offset = 0;
- while (offset < myBuff.Length)
- {
- string recnum = Encoding.Default.GetString(myBuff, offset, 8);
- int applicability = BitConverter.ToInt32(myBuff, offset + 8);
- string applicabilityToStr = string.Format("{0:X8}", applicability);
- //4294967296
- if (!procAPL.ContainsKey(recnum))
- procAPL.Add(recnum, applicabilityToStr);
- else
- if (procAPL[recnum] != applicabilityToStr)
- procAPL[recnum] = applicabilityToStr;
- offset += 12;
- }
- return procAPL;
- }
- }
-}
diff --git a/PROMS/DataLoader/Applicability.cs.bak b/PROMS/DataLoader/Applicability.cs.bak
deleted file mode 100644
index f64e87fe..00000000
--- a/PROMS/DataLoader/Applicability.cs.bak
+++ /dev/null
@@ -1,40 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.IO;
-
-namespace DataLoader
-{
- public partial class Loader
- {
- public Dictionary MyProcAPL;
- private static Dictionary GetApple(string proc)
- {
- Dictionary procAPL = new Dictionary();
- FileInfo myFile = new FileInfo(proc);
- FileStream fs = myFile.OpenRead();
- BinaryReader br = new BinaryReader(fs);
- byte[] myBuff = new byte[myFile.Length];
- br.Read(myBuff, 0, (int)myFile.Length);
- br.Close();
- fs.Close();
- int offset = 0;
- while (offset < myBuff.Length)
- {
- string recnum = Encoding.Default.GetString(myBuff, offset, 8);
- //if ((myFile.Name.ToUpper() == "PROC000.APL" && (recnum == "00002491")))
- // System.Threading.Thread.Sleep(1000);
- int applicability = BitConverter.ToInt32(myBuff, offset + 8);
- string applicabilityToStr = string.Format("{0:X8}", applicability);
- //4294967296
- if (!procAPL.ContainsKey(recnum))
- procAPL.Add(recnum, applicabilityToStr);
- else
- if (procAPL[recnum] != applicabilityToStr)
- procAPL[recnum] = applicabilityToStr;
- offset += 12;
- }
- return procAPL;
- }
- }
-}
diff --git a/PROMS/DataLoader/Approve.cs b/PROMS/DataLoader/Approve.cs
deleted file mode 100644
index e96f9943..00000000
--- a/PROMS/DataLoader/Approve.cs
+++ /dev/null
@@ -1,516 +0,0 @@
-//using System;
-using System.Collections.Generic;
-using System.Text;
-using VEPROMS.CSLA.Library;
-using System.IO;
-using System.Data.OleDb;
-using System.Data;
-
-namespace DataLoader
-{
- public partial class Loader
- {
- public bool BuildApprovedRevision()
- {
- if(!frmMain.RunScript("PROMSApproveApprove.sql", frmMain.DBName)) return false;
- bool rv = false;
- using (Stage myStage = GetApprovedStage())
- {
- if (myStage == null)
- return rv;
- DocVersionInfoList dvil = DocVersionInfoList.Get();
- foreach (DocVersionInfo dvi in dvil)
- {
- if (dvi.Procedures.Count > 0)
- {
- if (!frmMain.MySettings.OnlyThisSet || frmMain.ProcedureSetPath.ToUpper() == dvi.MyFolder.Title.ToUpper())
- {
- string approvedFolder = dvi.MyFolder.Title + @"\APPROVED";
- //B2012-094 fix
- if (!Directory.Exists(approvedFolder)) frmMain.MyWarning = "**** " + dvi.MyFolder.Title + " Approved folder does not exist";
- else if (!File.Exists(approvedFolder + @"\SET.DBF")) frmMain.MyWarning = "**** " + dvi.MyFolder.Title + " Approved Set.dbf does not exist";
- else if (!File.Exists(approvedFolder + @"\USAGERO.DBF")) frmMain.MyWarning = "**** " + dvi.MyFolder.Title + " Approved UsageRO.dbf does not exist";
- else if (!Directory.Exists(approvedFolder + @"\PDFS")) frmMain.MyWarning = "**** " + dvi.MyFolder.Title + " Approved Pdfs folder does not exist";
- else if (Directory.GetFiles(approvedFolder + @"\PDFS","*.PDF").Length == 0) frmMain.MyWarning = "**** " + dvi.MyFolder.Title + " Approved Pdfs folder does not contain any pdf files";
- else rv |= BuildApprovedRevision(myStage, approvedFolder, dvi);
- }
- }
- }
- }
- return rv;
- }
-
- private static Stage GetApprovedStage()
- {
- StageInfoList sil = StageInfoList.Get();
- foreach (StageInfo si in sil)
- {
- if (si.Name.ToUpper() == "APPROVED")
- return si.Get();
- }
- return null;
- }
- private bool BuildApprovedRevision(Stage myStage, string approvedFolder, DocVersionInfo dvi)
- {
- bool rv = false;
- if (dvi.MultiUnitCount <= 1)
- {
- ApprovedFolder af = new ApprovedFolder(approvedFolder);
- foreach (ProcedureInfo pi in dvi.Procedures)
- {
- rv |= BuildApprovedRevision(myStage, af, pi, 0);
- }
- }
- else
- {
- ApprovedFolder af = new ApprovedFolder(approvedFolder, dvi);
- foreach (ProcedureInfo pi in dvi.Procedures)
- {
- for (int i = 1; i <= dvi.MultiUnitCount; i++)
- rv |= BuildApprovedRevision(myStage, af, pi, i);
- }
- }
- return rv;
- }
- private bool BuildApprovedRevision(Stage myStage, ApprovedFolder af, ProcedureInfo pi, int selectedSlave)
- {
- bool rv = false;
- if (selectedSlave > 0)
- pi.MyDocVersion.DocVersionConfig.SelectedSlave = selectedSlave;
- frmMain.MyInfo = string.Format("Loading approved data for Procedure: {0}", pi.DisplayNumber);
- // if working draft procedure does not exist in approved folder, don't bother processing
- if (!af.EntryFromProc.ContainsKey(pi.DisplayNumber)) return rv;
- using (Revision revision = CreateRevision(af, pi))
- {
- System.DateTime dts = pi.DTS;
- string userID = af.EntryFromProc[pi.DisplayNumber].UserID;
- using (Version version = Version.MakeVersion(revision, myStage, GetPDF(af,pi), GetSummaryPDF(), dts, userID))
- {
- using (Check check = Check.MakeCheck(revision, myStage, af.BuildConsistencyChecks(pi)))
- {
- rv |= true;
- }
- }
- }
- if(!rv)
- frmMain.MyInfo = string.Format("Loading Procedure: {0} FAILED MISERABLY", pi.DisplayNumber);
- return rv;
- }
- private byte[] GetSummaryPDF()
- {
- return null;
- }
- private byte[] GetPDF(ApprovedFolder af, ProcedureInfo pi)
- {
- string pdf = string.Format(@"{0}\PDFS\{1}.pdf", af.Path, pi.DisplayNumber);
- FileInfo pdfFile = new FileInfo(pdf);
- if (pdfFile.Exists)
- {
- FileStream fs = pdfFile.Open(FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
- byte[] pdfBuf = new byte[pdfFile.Length];
- fs.Read(pdfBuf, 0, pdfBuf.Length);
- fs.Close();
- return pdfBuf;
- }
- return null;
- }
- private Revision CreateRevision(ApprovedFolder af, ProcedureInfo pi)
- {
- int typeID = 1; //revision not tempmod
- ProcInfo pinf = af.EntryFromProc[pi.DisplayNumber];
- string revisionNumber = pinf.Rev;
- System.DateTime revisionDate = System.DateTime.Parse(pinf.RevDate ?? "1/1/1980");
- string notes = "Migration Of Current Approved Revision";
- RevisionConfig cfg = new RevisionConfig();
- cfg.History_StartDate = pinf.StartDateTime;
- if (pi.MyDocVersion.DocVersionConfig.SelectedSlave > 0)
- cfg.Applicability_Index = pi.MyDocVersion.DocVersionConfig.SelectedSlave;
- string config = cfg.ToString();
- System.DateTime dts = pi.DTS;
- string userID = pinf.UserID;
- return Revision.MakeRevision(pi.ItemID, typeID, revisionNumber, revisionDate, notes, config, dts, userID);
- }
- }
- public partial class ApprovedFolder
- {
- private OleDbConnection _Connection;
- public OleDbConnection Connection
- {
- get
- {
- if(_Connection == null)
- _Connection = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + _Path + ";Extended Properties=dBase III;Persist Security Info=False");
- return _Connection;
- }
- }
- private string _Path;
- public string Path
- {
- get { return _Path; }
- set { _Path = value; }
- }
- private System.DateTime _ROFstDate = System.DateTime.MinValue;
- public System.DateTime ROFstDate
- {
- get
- {
- if (_ROFstDate == System.DateTime.MinValue)
- {
- FileInfo fi = new FileInfo(string.Format(@"{0}\ro.fst",Path));
- if(fi.Exists)
- _ROFstDate = fi.LastWriteTimeUtc;
- }
- return _ROFstDate;
- }
- }
-
- private Dictionary _ROValues = new Dictionary();
- private Dictionary _LibDocDates = new Dictionary();
- private Dictionary> _ProcROs = new Dictionary>();
- private Dictionary> _LibROs = new Dictionary>();
- private Dictionary> _LibDocs = new Dictionary>();
-
- public string BuildConsistencyChecks(ProcedureInfo proc)
- {
- /*
-
-
-
-
-
-
-
-
- */
- ConsistencyChecks cc = new ConsistencyChecks();
- cc.ItemID = proc.ItemID;
- BuildROChecks(cc, proc);
- BuildLibDocChecks(cc, proc);
- return cc.ToString().Replace("OldDocDate=\"0001-01-01T00:00:00\"", "");
- }
-
- private void BuildLibDocChecks(ConsistencyChecks cc, ProcedureInfo proc)
- {
- if (_LibDocs.ContainsKey(proc.DisplayNumber))
- {
- foreach (string libdoc in _LibDocs[proc.DisplayNumber])
- {
- FileInfo fi = new FileInfo(string.Format(@"{0}\RTFFILES\{1}.LIB",Path,libdoc));
- if (fi.Exists)
- {
- //if (proc.MyDocVersion.VersionID > 1)
- // System.Threading.Thread.Sleep(5000);
- int docid = GetDocID(libdoc, proc.MyDocVersion.VersionID);
- if (docid > 0)
- cc.LibDocConsistency.AddLibDocCheck(docid, fi.LastWriteTimeUtc);
- }
- }
- }
- }
-
- private int GetDocID(string libdoc, int versionid)
- {
- DocumentInfo di = DocumentInfo.GetByLibDocName(libdoc, versionid);
- return di.DocID;
- }
-
- private void BuildROChecks(ConsistencyChecks cc, ProcedureInfo proc)
- {
- cc.ROConsistency.ROFstDate = ROFstDate;
- if (_ProcROs.ContainsKey(proc.DisplayNumber))
- {
- foreach (string roid in _ProcROs[proc.DisplayNumber])
- cc.ROConsistency.AddROCheck(FormatROID(roid), GetROValue(FormatROID(roid)));
- }
- //int cnt = cc.ROConsistency.MyROChecks.Length;
- if (_LibDocs.ContainsKey(proc.DisplayNumber))
- {
- foreach (string libdoc in _LibDocs[proc.DisplayNumber])
- {
- if (_LibROs.ContainsKey(libdoc))
- {
- foreach (string roid in _LibROs[libdoc])
- cc.ROConsistency.AddROCheck(FormatROID(roid), GetROValue(FormatROID(roid)));
- }
- }
- }
- }
-
- private string GetROValue(string roid)
- {
- if (!_ROValues.ContainsKey(roid))
- {
- //if (roid.Contains("000128"))
- // System.Console.WriteLine();
- //string ss = _Lookup.GetRoValue(roid);
- //ss = ItemInfo.ConvertToDisplayText(ss);
- //ss = ss.Replace('\n', ';');
-
- _ROValues.Add(roid, PrepareForXML(ItemInfo.ConvertToDisplayText(_Lookup.GetRoValue(roid))));
- }
- return _ROValues[roid];
- }
-
- private string PrepareForXML(string rovalue)
- {
- StringBuilder sb = new StringBuilder();
- foreach (char c in rovalue)
- {
- if (c < ' ')
- sb.Append(string.Format(@"\x{0:X4}", (int)c));
- else
- sb.Append(c);
- }
- return sb.ToString();
- }
- private string FormatROID(string roid)
- {
- if (roid.Length == 16 && roid.EndsWith("0000"))
- return roid.Substring(0, 12).ToUpper();
- return roid.ToUpper();
- }
-
- private Dictionary _EntryFromProc;
- public Dictionary EntryFromProc
- {
- get
- {
- if (_EntryFromProc == null)
- _EntryFromProc = FillEntryFromProc();
- return _EntryFromProc;
- }
- }
- private Dictionary FillEntryFromProc()
- {
- Dictionary rv = new Dictionary();
- using (OleDbDataAdapter da = new OleDbDataAdapter("Select * from [set] where entry is not null", Connection))
- {
- using (DataSet ds = new DataSet())
- {
- da.Fill(ds);
- foreach (DataRow dr in ds.Tables[0].Rows)
- if (!rv.ContainsKey(dr["NUMBER"].ToString()))
- rv.Add(dr["NUMBER"].ToString(), new ProcInfo(dr, Path));
- }
- }
- return rv;
- }
- private ROFSTLookup _Lookup;
- public ApprovedFolder(string path)
- {
- _Path = path;
- FillROs();
- FillLibDocs();
- _Lookup = new ROFSTLookup(string.Format(@"{0}\RO.FST", Path));
- }
- public ApprovedFolder(string path, DocVersionInfo dvi)
- {
- _Path = path;
- FillROs();
- FillLibDocs();
- _Lookup = new ROFSTLookup(string.Format(@"{0}\RO.FST", Path));
- _EntryFromProc = FillEntryFromProcMulti(dvi);
- }
-
- private Dictionary FillEntryFromProcMulti(DocVersionInfo dvi)
- {
- Dictionary rv = new Dictionary();
- for (int i = 1; i <= dvi.MultiUnitCount; i++)
- {
- foreach (ProcedureInfo pi in dvi.Procedures)
- {
- pi.MyDocVersion.DocVersionConfig.SelectedSlave = i;
- rv.Add(pi.DisplayNumber, new ProcInfo(pi, Path));
- }
- }
- return rv;
- }
-
- private void FillLibDocs()
- {
- using (OleDbDataAdapter da = new OleDbDataAdapter("Select distinct FROMNUMBER, TONUMBER from [tran] where tonumber like 'DOC%'", Connection))
- {
- using (DataSet ds = new DataSet())
- {
- da.Fill(ds);
- foreach (DataRow dr in ds.Tables[0].Rows)
- {
- string number = dr["FROMNUMBER"].ToString();
- string libdoc = dr["TONUMBER"].ToString();
- if (!_LibDocs.ContainsKey(number))
- _LibDocs.Add(number, new List());
- if (!_LibDocs[number].Contains(libdoc))
- _LibDocs[number].Add(libdoc);
- }
- }
- }
- }
-
- private void FillROs()
- {
- using (OleDbDataAdapter da = new OleDbDataAdapter("Select distinct NUMBER, ROID from [usagero]", Connection))
- {
- using (DataSet ds = new DataSet())
- {
- da.Fill(ds);
- foreach (DataRow dr in ds.Tables[0].Rows)
- {
- string number = dr["NUMBER"].ToString();
- string roid = dr["ROID"].ToString();
- if (number.StartsWith("DOC"))
- {
- if (!_LibROs.ContainsKey(number))
- _LibROs.Add(number, new List());
- if (!_LibROs[number].Contains(roid))
- _LibROs[number].Add(roid);
- }
- else
- {
- if (!_ProcROs.ContainsKey(number))
- _ProcROs.Add(number, new List());
- if (!_ProcROs[number].Contains(roid))
- _ProcROs[number].Add(roid);
- }
- }
- }
- }
- }
- }
- public partial class ProcInfo
- {
- private log4net.ILog log;
- private string _Number;
- public string Number
- {
- get { return _Number; }
- set { _Number = value; }
- }
- private string _Entry;
- public string Entry
- {
- get { return _Entry; }
- set { _Entry = value; }
- }
- private string _UserID;
- public string UserID
- {
- get { return _UserID; }
- set { _UserID = value; }
- }
- private System.DateTime _StartDateTime;
- public System.DateTime StartDateTime
- {
- get { return _StartDateTime; }
- set { _StartDateTime = value; }
- }
- private string _Rev;
- public string Rev
- {
- get { return _Rev; }
- set { _Rev = value; }
- }
- private string _RevDate;
- public string RevDate
- {
- get { return _RevDate; }
- set { _RevDate = value; }
- }
- private string _ReviewDate;
- public string ReviewDate
- {
- get { return _ReviewDate; }
- set { _ReviewDate = value; }
- }
- public ProcInfo(ProcedureInfo pi, string afpath)
- {
- Number = pi.DisplayNumber;
- Entry = pi.DisplayText;
- UserID = pi.UserID;
- StartDateTime = pi.DTS;
- RevDate = pi.ProcedureConfig.Print_RevDate;
- Rev = pi.ProcedureConfig.Print_Rev;
- }
- public ProcInfo(DataRow dr, string afpath)
- {
- Number = dr["NUMBER"].ToString();
- Entry = dr["ENTRY"].ToString();
- UserID = dr["INITIALS"].ToString();
- if (UserID == string.Empty) UserID = "UNKNOWN";
- //string date = GetDTS(dr["DATE"].ToString(), dr["TIME"].ToString()).ToString("MM/dd/yyyy HH:MM");//System.DateTime.Parse(dr["DATE"].ToString()).ToString("MM/dd/yyyy");
- //string time = dr["TIME"].ToString();
- //if (time.EndsWith(":"))
- // date += " " + time.Substring(0, 2) + ":" + time.Substring(2, 2);
- //else
- // date += " " + time.Substring(0, 2) + ":" + time.Substring(3, 2);
- //StartDateTime = System.DateTime.Parse(date);
- StartDateTime = GetDTS(dr["DATE"].ToString(), dr["TIME"].ToString());
- RevDate = StartDateTime.ToString("MM/dd/yyyy");
- FixItems fis = new FixItems(new FileInfo(string.Format(@"{0}\{1}.fix", afpath, Entry)));
- if (fis.Count > 0)
- {
- Rev = fis[0].Rev;
- RevDate = fis[0].RevDate ?? GetDBFRevDate(afpath);
- ReviewDate = fis[0].ReviewDate;
- }
- }
- public System.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).
-
- System.DateTime dts = System.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 System.DateTime(System.Convert.ToInt32(year), System.Convert.ToInt32(month), System.Convert.ToInt32(day),
- System.Convert.ToInt32(hour), System.Convert.ToInt32(minute), 0);
- }
- catch (System.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);
- //frmMain.AddError(ex, "Bad Date/Time {0} {1}", date, time);
- log.ErrorFormat(ex.StackTrace);
- return dts;
- }
- return dts;
- }
-
- private string GetDBFRevDate(string afpath)
- {
- FileInfo fi = new FileInfo(afpath + @"\" + Entry + ".dbf");
- if (fi.Exists)
- return fi.LastWriteTime.ToShortDateString();
- return null;
- }
- }
-
-}
diff --git a/PROMS/DataLoader/Approve.cs.bak b/PROMS/DataLoader/Approve.cs.bak
deleted file mode 100644
index c12dee64..00000000
--- a/PROMS/DataLoader/Approve.cs.bak
+++ /dev/null
@@ -1,521 +0,0 @@
-//using System;
-using System.Collections.Generic;
-using System.Text;
-using VEPROMS.CSLA.Library;
-using System.IO;
-using System.Data.OleDb;
-using System.Data;
-
-namespace DataLoader
-{
- public partial class Loader
- {
- public bool BuildApprovedRevision()
- {
- if(!frmMain.RunScript("PROMSApproveApprove.sql", frmMain.MySettings.DBName)) return false;
- bool rv = false;
- using (Stage myStage = GetApprovedStage())
- {
- if (myStage == null)
- return rv;
- DocVersionInfoList dvil = DocVersionInfoList.Get();
- foreach (DocVersionInfo dvi in dvil)
- {
- if (dvi.Procedures.Count > 0)
- {
- if (!frmMain.MySettings.OnlyThisSet || frmMain.MySettings.ProcedureSetPath.ToUpper() == dvi.MyFolder.Title.ToUpper())
- {
- string approvedFolder = dvi.MyFolder.Title + @"\APPROVED";
- //B2012-094 fix
- if (!Directory.Exists(approvedFolder))
- frmMain.MyWarning = "**** " + dvi.MyFolder.Title + " Approved folder does not exist";
- else if (!File.Exists(approvedFolder + @"\SET.DBF"))
- frmMain.MyWarning = "**** " + dvi.MyFolder.Title + " Approved Set.dbf does not exist";
- else if (!File.Exists(approvedFolder + @"\USAGERO.DBF"))
- frmMain.MyWarning = "**** " + dvi.MyFolder.Title + " Approved UsageRO.dbf does not exist";
- else if (!Directory.Exists(approvedFolder + @"\PDFS"))
- frmMain.MyWarning = "**** " + dvi.MyFolder.Title + " Approved Pdfs folder does not exist";
- else if (Directory.GetFiles(approvedFolder + @"\PDFS", "*.PDF").Length == 0)
- frmMain.MyWarning = "**** " + dvi.MyFolder.Title + " Approved Pdfs folder does not contain any pdf files";
- else rv |= BuildApprovedRevision(myStage, approvedFolder, dvi);
- }
- }
- }
- }
- return rv;
- }
-
- private static Stage GetApprovedStage()
- {
- StageInfoList sil = StageInfoList.Get();
- foreach (StageInfo si in sil)
- {
- if (si.Name.ToUpper() == "APPROVED")
- return si.Get();
- }
- return null;
- }
- private bool BuildApprovedRevision(Stage myStage, string approvedFolder, DocVersionInfo dvi)
- {
- bool rv = false;
- if (dvi.MultiUnitCount <= 1)
- {
- ApprovedFolder af = new ApprovedFolder(approvedFolder);
- foreach (ProcedureInfo pi in dvi.Procedures)
- {
- rv |= BuildApprovedRevision(myStage, af, pi, 0);
- }
- }
- else
- {
- ApprovedFolder af = new ApprovedFolder(approvedFolder, dvi);
- foreach (ProcedureInfo pi in dvi.Procedures)
- {
- for (int i = 1; i <= dvi.MultiUnitCount; i++)
- rv |= BuildApprovedRevision(myStage, af, pi, i);
- }
- }
- return rv;
- }
- private bool BuildApprovedRevision(Stage myStage, ApprovedFolder af, ProcedureInfo pi, int selectedSlave)
- {
- bool rv = false;
- if (selectedSlave > 0)
- pi.MyDocVersion.DocVersionConfig.SelectedSlave = selectedSlave;
- frmMain.MyInfo = string.Format("Loading approved data for Procedure: {0}", pi.DisplayNumber);
- // if working draft procedure does not exist in approved folder, don't bother processing
- if (!af.EntryFromProc.ContainsKey(pi.DisplayNumber)) return rv;
- using (Revision revision = CreateRevision(af, pi))
- {
- System.DateTime dts = pi.DTS;
- string userID = af.EntryFromProc[pi.DisplayNumber].UserID;
- using (Version version = Version.MakeVersion(revision, myStage, GetPDF(af,pi), GetSummaryPDF(), dts, userID))
- {
- using (Check check = Check.MakeCheck(revision, myStage, af.BuildConsistencyChecks(pi)))
- {
- rv |= true;
- }
- }
- }
- if(!rv)
- frmMain.MyInfo = string.Format("Loading Procedure: {0} FAILED MISERABLY", pi.DisplayNumber);
- return rv;
- }
- private byte[] GetSummaryPDF()
- {
- return null;
- }
- private byte[] GetPDF(ApprovedFolder af, ProcedureInfo pi)
- {
- string pdf = string.Format(@"{0}\PDFS\{1}.pdf", af.Path, pi.DisplayNumber);
- FileInfo pdfFile = new FileInfo(pdf);
- if (pdfFile.Exists)
- {
- FileStream fs = pdfFile.Open(FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
- byte[] pdfBuf = new byte[pdfFile.Length];
- fs.Read(pdfBuf, 0, pdfBuf.Length);
- fs.Close();
- return pdfBuf;
- }
- return null;
- }
- private Revision CreateRevision(ApprovedFolder af, ProcedureInfo pi)
- {
- int typeID = 1; //revision not tempmod
- ProcInfo pinf = af.EntryFromProc[pi.DisplayNumber];
- string revisionNumber = pinf.Rev;
- System.DateTime revisionDate = System.DateTime.Parse(pinf.RevDate ?? "1/1/1980");
- string notes = "Migration Of Current Approved Revision";
- RevisionConfig cfg = new RevisionConfig();
- cfg.History_StartDate = pinf.StartDateTime;
- if (pi.MyDocVersion.DocVersionConfig.SelectedSlave > 0)
- cfg.Applicability_Index = pi.MyDocVersion.DocVersionConfig.SelectedSlave;
- string config = cfg.ToString();
- System.DateTime dts = pi.DTS;
- string userID = pinf.UserID;
- return Revision.MakeRevision(pi.ItemID, typeID, revisionNumber, revisionDate, notes, config, dts, userID);
- }
- }
- public partial class ApprovedFolder
- {
- private OleDbConnection _Connection;
- public OleDbConnection Connection
- {
- get
- {
- if(_Connection == null)
- _Connection = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + _Path + ";Extended Properties=dBase III;Persist Security Info=False");
- return _Connection;
- }
- }
- private string _Path;
- public string Path
- {
- get { return _Path; }
- set { _Path = value; }
- }
- private System.DateTime _ROFstDate = System.DateTime.MinValue;
- public System.DateTime ROFstDate
- {
- get
- {
- if (_ROFstDate == System.DateTime.MinValue)
- {
- FileInfo fi = new FileInfo(string.Format(@"{0}\ro.fst",Path));
- if(fi.Exists)
- _ROFstDate = fi.LastWriteTimeUtc;
- }
- return _ROFstDate;
- }
- }
-
- private Dictionary _ROValues = new Dictionary();
- private Dictionary _LibDocDates = new Dictionary();
- private Dictionary> _ProcROs = new Dictionary>();
- private Dictionary> _LibROs = new Dictionary>();
- private Dictionary> _LibDocs = new Dictionary>();
-
- public string BuildConsistencyChecks(ProcedureInfo proc)
- {
- /*
-
-
-
-
-
-
-
-
- */
- ConsistencyChecks cc = new ConsistencyChecks();
- cc.ItemID = proc.ItemID;
- BuildROChecks(cc, proc);
- BuildLibDocChecks(cc, proc);
- return cc.ToString().Replace("OldDocDate=\"0001-01-01T00:00:00\"", "");
- }
-
- private void BuildLibDocChecks(ConsistencyChecks cc, ProcedureInfo proc)
- {
- if (_LibDocs.ContainsKey(proc.DisplayNumber))
- {
- foreach (string libdoc in _LibDocs[proc.DisplayNumber])
- {
- FileInfo fi = new FileInfo(string.Format(@"{0}\RTFFILES\{1}.LIB",Path,libdoc));
- if (fi.Exists)
- {
- //if (proc.MyDocVersion.VersionID > 1)
- // System.Threading.Thread.Sleep(5000);
- int docid = GetDocID(libdoc, proc.MyDocVersion.VersionID);
- if (docid > 0)
- cc.LibDocConsistency.AddLibDocCheck(docid, fi.LastWriteTimeUtc);
- }
- }
- }
- }
-
- private int GetDocID(string libdoc, int versionid)
- {
- DocumentInfo di = DocumentInfo.GetByLibDocName(libdoc, versionid);
- return di.DocID;
- }
-
- private void BuildROChecks(ConsistencyChecks cc, ProcedureInfo proc)
- {
- cc.ROConsistency.ROFstDate = ROFstDate;
- if (_ProcROs.ContainsKey(proc.DisplayNumber))
- {
- foreach (string roid in _ProcROs[proc.DisplayNumber])
- cc.ROConsistency.AddROCheck(FormatROID(roid), GetROValue(FormatROID(roid)));
- }
- //int cnt = cc.ROConsistency.MyROChecks.Length;
- if (_LibDocs.ContainsKey(proc.DisplayNumber))
- {
- foreach (string libdoc in _LibDocs[proc.DisplayNumber])
- {
- if (_LibROs.ContainsKey(libdoc))
- {
- foreach (string roid in _LibROs[libdoc])
- cc.ROConsistency.AddROCheck(FormatROID(roid), GetROValue(FormatROID(roid)));
- }
- }
- }
- }
-
- private string GetROValue(string roid)
- {
- if (!_ROValues.ContainsKey(roid))
- {
- //if (roid.Contains("000128"))
- // System.Console.WriteLine();
- //string ss = _Lookup.GetRoValue(roid);
- //ss = ItemInfo.ConvertToDisplayText(ss);
- //ss = ss.Replace('\n', ';');
-
- _ROValues.Add(roid, PrepareForXML(ItemInfo.ConvertToDisplayText(_Lookup.GetRoValue(roid))));
- }
- return _ROValues[roid];
- }
-
- private string PrepareForXML(string rovalue)
- {
- StringBuilder sb = new StringBuilder();
- foreach (char c in rovalue)
- {
- if (c < ' ')
- sb.Append(string.Format(@"\x{0:X4}", (int)c));
- else
- sb.Append(c);
- }
- return sb.ToString();
- }
- private string FormatROID(string roid)
- {
- if (roid.Length == 16 && roid.EndsWith("0000"))
- return roid.Substring(0, 12).ToUpper();
- return roid.ToUpper();
- }
-
- private Dictionary _EntryFromProc;
- public Dictionary EntryFromProc
- {
- get
- {
- if (_EntryFromProc == null)
- _EntryFromProc = FillEntryFromProc();
- return _EntryFromProc;
- }
- }
- private Dictionary FillEntryFromProc()
- {
- Dictionary rv = new Dictionary();
- using (OleDbDataAdapter da = new OleDbDataAdapter("Select * from [set] where entry is not null", Connection))
- {
- using (DataSet ds = new DataSet())
- {
- da.Fill(ds);
- foreach (DataRow dr in ds.Tables[0].Rows)
- if (!rv.ContainsKey(dr["NUMBER"].ToString()))
- rv.Add(dr["NUMBER"].ToString(), new ProcInfo(dr, Path));
- }
- }
- return rv;
- }
- private ROFSTLookup _Lookup;
- public ApprovedFolder(string path)
- {
- _Path = path;
- FillROs();
- FillLibDocs();
- _Lookup = new ROFSTLookup(string.Format(@"{0}\RO.FST", Path));
- }
- public ApprovedFolder(string path, DocVersionInfo dvi)
- {
- _Path = path;
- FillROs();
- FillLibDocs();
- _Lookup = new ROFSTLookup(string.Format(@"{0}\RO.FST", Path));
- _EntryFromProc = FillEntryFromProcMulti(dvi);
- }
-
- private Dictionary FillEntryFromProcMulti(DocVersionInfo dvi)
- {
- Dictionary rv = new Dictionary();
- for (int i = 1; i <= dvi.MultiUnitCount; i++)
- {
- foreach (ProcedureInfo pi in dvi.Procedures)
- {
- pi.MyDocVersion.DocVersionConfig.SelectedSlave = i;
- rv.Add(pi.DisplayNumber, new ProcInfo(pi, Path));
- }
- }
- return rv;
- }
-
- private void FillLibDocs()
- {
- using (OleDbDataAdapter da = new OleDbDataAdapter("Select distinct FROMNUMBER, TONUMBER from [tran] where tonumber like 'DOC%'", Connection))
- {
- using (DataSet ds = new DataSet())
- {
- da.Fill(ds);
- foreach (DataRow dr in ds.Tables[0].Rows)
- {
- string number = dr["FROMNUMBER"].ToString();
- string libdoc = dr["TONUMBER"].ToString();
- if (!_LibDocs.ContainsKey(number))
- _LibDocs.Add(number, new List());
- if (!_LibDocs[number].Contains(libdoc))
- _LibDocs[number].Add(libdoc);
- }
- }
- }
- }
-
- private void FillROs()
- {
- using (OleDbDataAdapter da = new OleDbDataAdapter("Select distinct NUMBER, ROID from [usagero]", Connection))
- {
- using (DataSet ds = new DataSet())
- {
- da.Fill(ds);
- foreach (DataRow dr in ds.Tables[0].Rows)
- {
- string number = dr["NUMBER"].ToString();
- string roid = dr["ROID"].ToString();
- if (number.StartsWith("DOC"))
- {
- if (!_LibROs.ContainsKey(number))
- _LibROs.Add(number, new List());
- if (!_LibROs[number].Contains(roid))
- _LibROs[number].Add(roid);
- }
- else
- {
- if (!_ProcROs.ContainsKey(number))
- _ProcROs.Add(number, new List());
- if (!_ProcROs[number].Contains(roid))
- _ProcROs[number].Add(roid);
- }
- }
- }
- }
- }
- }
- public partial class ProcInfo
- {
- private log4net.ILog log;
- private string _Number;
- public string Number
- {
- get { return _Number; }
- set { _Number = value; }
- }
- private string _Entry;
- public string Entry
- {
- get { return _Entry; }
- set { _Entry = value; }
- }
- private string _UserID;
- public string UserID
- {
- get { return _UserID; }
- set { _UserID = value; }
- }
- private System.DateTime _StartDateTime;
- public System.DateTime StartDateTime
- {
- get { return _StartDateTime; }
- set { _StartDateTime = value; }
- }
- private string _Rev;
- public string Rev
- {
- get { return _Rev; }
- set { _Rev = value; }
- }
- private string _RevDate;
- public string RevDate
- {
- get { return _RevDate; }
- set { _RevDate = value; }
- }
- private string _ReviewDate;
- public string ReviewDate
- {
- get { return _ReviewDate; }
- set { _ReviewDate = value; }
- }
- public ProcInfo(ProcedureInfo pi, string afpath)
- {
- Number = pi.DisplayNumber;
- Entry = pi.DisplayText;
- UserID = pi.UserID;
- StartDateTime = pi.DTS;
- RevDate = pi.ProcedureConfig.Print_RevDate;
- Rev = pi.ProcedureConfig.Print_Rev;
- }
- public ProcInfo(DataRow dr, string afpath)
- {
- Number = dr["NUMBER"].ToString();
- Entry = dr["ENTRY"].ToString();
- UserID = dr["INITIALS"].ToString();
- if (UserID == string.Empty) UserID = "UNKNOWN";
- //string date = GetDTS(dr["DATE"].ToString(), dr["TIME"].ToString()).ToString("MM/dd/yyyy HH:MM");//System.DateTime.Parse(dr["DATE"].ToString()).ToString("MM/dd/yyyy");
- //string time = dr["TIME"].ToString();
- //if (time.EndsWith(":"))
- // date += " " + time.Substring(0, 2) + ":" + time.Substring(2, 2);
- //else
- // date += " " + time.Substring(0, 2) + ":" + time.Substring(3, 2);
- //StartDateTime = System.DateTime.Parse(date);
- StartDateTime = GetDTS(dr["DATE"].ToString(), dr["TIME"].ToString());
- RevDate = StartDateTime.ToString("MM/dd/yyyy");
- FixItems fis = new FixItems(new FileInfo(string.Format(@"{0}\{1}.fix", afpath, Entry)));
- if (fis.Count > 0)
- {
- Rev = fis[0].Rev;
- RevDate = fis[0].RevDate ?? GetDBFRevDate(afpath);
- ReviewDate = fis[0].ReviewDate;
- }
- }
- public System.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).
-
- System.DateTime dts = System.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 System.DateTime(System.Convert.ToInt32(year), System.Convert.ToInt32(month), System.Convert.ToInt32(day),
- System.Convert.ToInt32(hour), System.Convert.ToInt32(minute), 0);
- }
- catch (System.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);
- //frmMain.AddError(ex, "Bad Date/Time {0} {1}", date, time);
- log.ErrorFormat(ex.StackTrace);
- return dts;
- }
- return dts;
- }
-
- private string GetDBFRevDate(string afpath)
- {
- FileInfo fi = new FileInfo(afpath + @"\" + Entry + ".dbf");
- if (fi.Exists)
- return fi.LastWriteTime.ToShortDateString();
- return null;
- }
- }
-
-}
diff --git a/PROMS/DataLoader/BuildVEPROMS.Sql b/PROMS/DataLoader/BuildVEPROMS.Sql
deleted file mode 100644
index f687d469..00000000
--- a/PROMS/DataLoader/BuildVEPROMS.Sql
+++ /dev/null
@@ -1,1508 +0,0 @@
-USE [master]
-GO
-/****** Object: Database [{DBName}] Script Date: 01/06/2012 15:49:32 ******/
-IF EXISTS (SELECT name FROM sys.databases WHERE name = N'{DBName}')
-BEGIN
- PRINT 'Dropping existing database {DBName}'
- ALTER DATABASE [{DBName}] SET SINGLE_USER WITH ROLLBACK IMMEDIATE
- DROP DATABASE [{DBName}]
-END
-GO
-/****** Object: Database [{DBName}] Script Date: 01/06/2012 15:02:52 ******/
-PRINT 'Creating Database {DBName} - {DBPath}\{DBName}.mdf'
-GO
-CREATE DATABASE [{DBName}] ON PRIMARY
-( NAME = N'VEPROMS_Users', FILENAME = N'{DBPath}\{DBName}.mdf')
- LOG ON
-( NAME = N'VEPROMS_Users_log', FILENAME = N'{DBPath}\{DBName}_1.ldf')
- COLLATE SQL_Latin1_General_CP1_CI_AS
-GO
-PRINT '{DBName} Created'
-GO
-EXEC dbo.sp_dbcmptlevel @dbname=N'{DBName}', @new_cmptlevel=90
-GO
-PRINT '{sp_dbcmptlevel} Completed'
-GO
-IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
-begin
-EXEC [{DBName}].[dbo].[sp_fulltext_database] @action = 'disable'
-end
-GO
-ALTER DATABASE [{DBName}] SET ANSI_NULL_DEFAULT OFF
-GO
-ALTER DATABASE [{DBName}] SET ANSI_NULLS OFF
-GO
-ALTER DATABASE [{DBName}] SET ANSI_PADDING OFF
-GO
-ALTER DATABASE [{DBName}] SET ANSI_WARNINGS OFF
-GO
-ALTER DATABASE [{DBName}] SET ARITHABORT OFF
-GO
-ALTER DATABASE [{DBName}] SET AUTO_CLOSE OFF
-GO
-ALTER DATABASE [{DBName}] SET AUTO_CREATE_STATISTICS ON
-GO
-ALTER DATABASE [{DBName}] SET AUTO_SHRINK OFF
-GO
-ALTER DATABASE [{DBName}] SET AUTO_UPDATE_STATISTICS ON
-GO
-ALTER DATABASE [{DBName}] SET CURSOR_CLOSE_ON_COMMIT OFF
-GO
-ALTER DATABASE [{DBName}] SET CURSOR_DEFAULT GLOBAL
-GO
-ALTER DATABASE [{DBName}] SET CONCAT_NULL_YIELDS_NULL OFF
-GO
-ALTER DATABASE [{DBName}] SET NUMERIC_ROUNDABORT OFF
-GO
-ALTER DATABASE [{DBName}] SET QUOTED_IDENTIFIER OFF
-GO
-ALTER DATABASE [{DBName}] SET RECURSIVE_TRIGGERS OFF
-GO
-ALTER DATABASE [{DBName}] SET DISABLE_BROKER
-GO
-ALTER DATABASE [{DBName}] SET AUTO_UPDATE_STATISTICS_ASYNC OFF
-GO
-ALTER DATABASE [{DBName}] SET DATE_CORRELATION_OPTIMIZATION OFF
-GO
-ALTER DATABASE [{DBName}] SET TRUSTWORTHY OFF
-GO
-ALTER DATABASE [{DBName}] SET ALLOW_SNAPSHOT_ISOLATION OFF
-GO
-ALTER DATABASE [{DBName}] SET PARAMETERIZATION SIMPLE
-GO
-ALTER DATABASE [{DBName}] SET READ_WRITE
-GO
-ALTER DATABASE [{DBName}] SET RECOVERY SIMPLE
-GO
-ALTER DATABASE [{DBName}] SET MULTI_USER
-GO
-ALTER DATABASE [{DBName}] SET PAGE_VERIFY CHECKSUM
-GO
-ALTER DATABASE [{DBName}] SET DB_CHAINING OFF
-GO
-USE [{DBName}]
-GO
-
-
-/****** Object: Table [dbo].[Connections] Script Date: 01/06/2012 15:02:52 ******/
-SET ANSI_NULLS ON
-GO
-SET QUOTED_IDENTIFIER ON
-GO
-CREATE TABLE [Connections](
- [DBID] [int] IDENTITY(1,1) NOT NULL,
- [Name] [nvarchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
- [Title] [nvarchar](510) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
- [ConnectionString] [nvarchar](510) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
- [ServerType] [int] NOT NULL CONSTRAINT [DF_Connections_ServerType] DEFAULT ((1)),
- [Config] [nvarchar](max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
- [DTS] [datetime] NOT NULL CONSTRAINT [DF_Connections_DTS] DEFAULT (getdate()),
- [UsrID] [nvarchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_Connections_UserID] DEFAULT (upper(suser_sname())),
- [LastChanged] [timestamp] NOT NULL,
- CONSTRAINT [PK_Connections] PRIMARY KEY CLUSTERED
-(
- [DBID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-) ON [PRIMARY]
-GO
-CREATE UNIQUE NONCLUSTERED INDEX [IX_Connections] ON [Connections]
-(
- [Name] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-GO
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'0 SQL Server' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Connections', @level2type=N'COLUMN',@level2name=N'ServerType'
-GO
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'{datetime}' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Connections', @level2type=N'COLUMN',@level2name=N'DTS'
-GO
-/****** Object: Table [dbo].[RODbs] Script Date: 01/06/2012 15:02:52 ******/
-SET ANSI_NULLS ON
-GO
-SET QUOTED_IDENTIFIER ON
-GO
-CREATE TABLE [RODbs](
- [RODbID] [int] IDENTITY(1,1) NOT NULL,
- [ROName] [nvarchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
- [FolderPath] [nvarchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
- [DBConnectionString] [nvarchar](max) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
- [Config] [nvarchar](max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
- [DTS] [datetime] NOT NULL CONSTRAINT [DF_RODbs_DTS] DEFAULT (getdate()),
- [UserID] [nvarchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_RODbs_UserID] DEFAULT (upper(suser_sname())),
- [LastChanged] [timestamp] NOT NULL,
- CONSTRAINT [PK_RODbs] PRIMARY KEY CLUSTERED
-(
- [RODbID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-) ON [PRIMARY]
-GO
-CREATE UNIQUE NONCLUSTERED INDEX [IX_RODbs_FolderPath] ON [RODbs]
-(
- [FolderPath] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-GO
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Hook for future - to allow the user to select multiple RO Databases assocaiated with on DocVersion' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'RODbs', @level2type=N'COLUMN',@level2name=N'ROName'
-GO
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Path to the RO database' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'RODbs', @level2type=N'COLUMN',@level2name=N'FolderPath'
-GO
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Connection String - Default could just be the full path and name of the database' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'RODbs', @level2type=N'COLUMN',@level2name=N'DBConnectionString'
-GO
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'{datetime}' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'RODbs', @level2type=N'COLUMN',@level2name=N'DTS'
-GO
-/****** Object: Table [dbo].[Locks] Script Date: 01/06/2012 15:02:52 ******/
-SET ANSI_NULLS ON
-GO
-SET QUOTED_IDENTIFIER ON
-GO
-CREATE TABLE [Locks](
- [LockID] [int] IDENTITY(1,1) NOT NULL,
- [UserID] [nvarchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_Locks_UserID] DEFAULT (upper(suser_sname())),
- [LockType] [tinyint] NOT NULL CONSTRAINT [DF_Locks_LockType] DEFAULT ((0)),
- [LockItemID] [int] NOT NULL CONSTRAINT [DF_Locks_LockItemID] DEFAULT ((0)),
- [Description] [nvarchar](max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
- [DTS] [datetime] NOT NULL CONSTRAINT [DF_Locks_DTS] DEFAULT (getdate()),
- [LastChanged] [timestamp] NOT NULL,
- CONSTRAINT [PK_Locks] PRIMARY KEY CLUSTERED
-(
- [LockID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-) ON [PRIMARY]
-GO
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'{datetime}' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Locks', @level2type=N'COLUMN',@level2name=N'DTS'
-GO
-/****** Object: Table [dbo].[Documents] Script Date: 01/06/2012 15:02:52 ******/
-SET ANSI_NULLS ON
-GO
-SET QUOTED_IDENTIFIER ON
-GO
-SET ANSI_PADDING ON
-GO
-CREATE TABLE [Documents](
- [DocID] [int] IDENTITY(1,1) NOT NULL,
- [LibTitle] [nvarchar](1024) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
- [DocContent] [varbinary](max) NULL,
- [DocAscii] [nvarchar](max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
- [Config] [nvarchar](max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
- [DTS] [datetime] NOT NULL CONSTRAINT [DF_Documents_DTS] DEFAULT (getdate()),
- [UserID] [nvarchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_Documents_UserID] DEFAULT (upper(suser_sname())),
- [LastChanged] [timestamp] NOT NULL,
- [FileExtension] [nvarchar](10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_Documents_FileExtension] DEFAULT (N'.Doc'),
- CONSTRAINT [PK_Documents] PRIMARY KEY CLUSTERED
-(
- [DocID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-) ON [PRIMARY]
-GO
-SET ANSI_PADDING OFF
-GO
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Actual content of a Word Document (RTF, DOC or XML Format)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Documents', @level2type=N'COLUMN',@level2name=N'DocContent'
-GO
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Used for searching' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Documents', @level2type=N'COLUMN',@level2name=N'DocAscii'
-GO
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'{datetime}' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Documents', @level2type=N'COLUMN',@level2name=N'DTS'
-GO
-/****** Object: Table [dbo].[Groups] Script Date: 01/06/2012 15:02:52 ******/
-SET ANSI_NULLS ON
-GO
-SET QUOTED_IDENTIFIER ON
-GO
-CREATE TABLE [Groups](
- [GID] [int] IDENTITY(1,1) NOT NULL,
- [GroupName] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
- [GroupType] [int] NULL,
- [Config] [nvarchar](max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
- [DTS] [datetime] NOT NULL CONSTRAINT [DF_Groups_DTS] DEFAULT (getdate()),
- [UsrID] [nvarchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_Groups_UserID] DEFAULT (upper(suser_sname())),
- [LastChanged] [timestamp] NOT NULL,
- CONSTRAINT [PK_Groups] PRIMARY KEY CLUSTERED
-(
- [GID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-) ON [PRIMARY]
-GO
-CREATE UNIQUE NONCLUSTERED INDEX [IX_Groups] ON [Groups]
-(
- [GroupName] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-GO
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'{datetime}' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Groups', @level2type=N'COLUMN',@level2name=N'GID'
-GO
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'{datetime}' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Groups', @level2type=N'COLUMN',@level2name=N'DTS'
-GO
-/****** Object: Table [dbo].[Users] Script Date: 01/06/2012 15:02:52 ******/
-SET ANSI_NULLS ON
-GO
-SET QUOTED_IDENTIFIER ON
-GO
-CREATE TABLE [Users](
- [UID] [int] IDENTITY(1,1) NOT NULL,
- [UserID] [nvarchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_Users_UserID] DEFAULT (upper(suser_sname())),
- [FirstName] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
- [MiddleName] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
- [LastName] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
- [Suffix] [nvarchar](10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
- [CourtesyTitle] [nvarchar](10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
- [PhoneNumber] [nvarchar](30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
- [CFGName] [nvarchar](8) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
- [UserLogin] [nvarchar](10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
- [UserName] [nvarchar](32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
- [Config] [nvarchar](max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
- [DTS] [datetime] NOT NULL CONSTRAINT [DF_Users_DTS] DEFAULT (getdate()),
- [UsrID] [nvarchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_Users_UserID1] DEFAULT (upper(suser_sname())),
- [LastChanged] [timestamp] NOT NULL,
- CONSTRAINT [PK_Users] PRIMARY KEY CLUSTERED
-(
- [UID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-) ON [PRIMARY]
-GO
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'{datetime}' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Users', @level2type=N'COLUMN',@level2name=N'DTS'
-GO
-/****** Object: Table [dbo].[Formats] Script Date: 01/06/2012 15:02:52 ******/
-SET ANSI_NULLS ON
-GO
-SET QUOTED_IDENTIFIER ON
-GO
-CREATE TABLE [Formats](
- [FormatID] [int] IDENTITY(1,1) NOT NULL,
- [ParentID] [int] NOT NULL CONSTRAINT [DF_Formats_ParentID] DEFAULT ((1)),
- [Name] [nvarchar](20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
- [Description] [nvarchar](250) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
- [Data] [xml] NOT NULL,
- [GenMac] [xml] NULL,
- [DTS] [datetime] NOT NULL CONSTRAINT [DF_Formats_DTS] DEFAULT (getdate()),
- [UserID] [nvarchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_Formats_UserID] DEFAULT (upper(suser_sname())),
- [LastChanged] [timestamp] NOT NULL,
- CONSTRAINT [PK_Formats] PRIMARY KEY CLUSTERED
-(
- [FormatID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-) ON [PRIMARY]
-GO
-CREATE UNIQUE NONCLUSTERED INDEX [IX_Formats] ON [Formats]
-(
- [ParentID] ASC,
- [Name] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-GO
-CREATE NONCLUSTERED INDEX [IX_FormatsParentID] ON [Formats]
-(
- [ParentID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-GO
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'{datetime}' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Formats', @level2type=N'COLUMN',@level2name=N'DTS'
-GO
-/****** Object: Table [dbo].[Sessions] Script Date: 01/06/2012 15:02:52 ******/
-SET ANSI_NULLS ON
-GO
-SET QUOTED_IDENTIFIER ON
-GO
-CREATE TABLE [Sessions](
- [SessionID] [int] IDENTITY(1,1) NOT NULL,
- [UserID] [nvarchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_Sessions_UserID] DEFAULT (upper(suser_sname())),
- [DTSDtart] [datetime] NOT NULL CONSTRAINT [DF_Sessions_DTSDtart] DEFAULT (getdate()),
- [DTSEnd] [datetime] NULL,
- [DTSActivity] [datetime] NULL,
- [LastChanged] [timestamp] NOT NULL,
- CONSTRAINT [PK_Sessions] PRIMARY KEY CLUSTERED
-(
- [SessionID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-) ON [PRIMARY]
-GO
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'{datetime}' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Sessions', @level2type=N'COLUMN',@level2name=N'DTSDtart'
-GO
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'{datetime}' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Sessions', @level2type=N'COLUMN',@level2name=N'DTSEnd'
-GO
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'{datetime}' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Sessions', @level2type=N'COLUMN',@level2name=N'DTSActivity'
-GO
-/****** Object: Table [dbo].[Branches] Script Date: 01/06/2012 15:02:52 ******/
-SET ANSI_NULLS ON
-GO
-SET QUOTED_IDENTIFIER ON
-GO
-CREATE TABLE [Branches](
- [BranchID] [int] IDENTITY(1,1) NOT NULL,
- [VersionID] [int] NOT NULL CONSTRAINT [DF_Branches_VersionID] DEFAULT ((0)),
- [DateLimit] [datetime] NOT NULL CONSTRAINT [DF_Branches_DateLimit] DEFAULT (getdate()),
- [BeforeType] [tinyint] NOT NULL CONSTRAINT [DF_Branches_BeforeType] DEFAULT ((0)),
- [BeforeID] [int] NOT NULL CONSTRAINT [DF_Branches_BeforeID] DEFAULT ((0)),
- [AfterType] [tinyint] NOT NULL CONSTRAINT [DF_Branches_AfterType] DEFAULT ((0)),
- [AfterID] [int] NOT NULL CONSTRAINT [DF_Branches_AfterID] DEFAULT ((0)),
- [LastChanged] [timestamp] NOT NULL,
- CONSTRAINT [PK_Branches] PRIMARY KEY CLUSTERED
-(
- [BranchID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-) ON [PRIMARY]
-GO
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'{datetime}' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Branches', @level2type=N'COLUMN',@level2name=N'DateLimit'
-GO
-/****** Object: Table [dbo].[AnnotationTypes] Script Date: 01/06/2012 15:02:52 ******/
-SET ANSI_NULLS ON
-GO
-SET QUOTED_IDENTIFIER ON
-GO
-CREATE TABLE [AnnotationTypes](
- [TypeID] [int] IDENTITY(1,1) NOT NULL,
- [Name] [nvarchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
- [Config] [nvarchar](max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
- [DTS] [datetime] NOT NULL CONSTRAINT [DF_AnnotationTypes_DTS] DEFAULT (getdate()),
- [UserID] [nvarchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_AnnotationTypes_UserID] DEFAULT (upper(suser_sname())),
- [LastChanged] [timestamp] NOT NULL,
- CONSTRAINT [PK_AnnotationTypes] PRIMARY KEY CLUSTERED
-(
- [TypeID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-) ON [PRIMARY]
-GO
-CREATE UNIQUE NONCLUSTERED INDEX [IX_AnnotationTypes_Name] ON [AnnotationTypes]
-(
- [Name] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-GO
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'{datetime}' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AnnotationTypes', @level2type=N'COLUMN',@level2name=N'DTS'
-GO
-/****** Object: Table [dbo].[Owners] Script Date: 01/06/2012 15:02:52 ******/
-SET ANSI_NULLS ON
-GO
-SET QUOTED_IDENTIFIER ON
-GO
-CREATE TABLE [Owners](
- [OwnerID] [int] IDENTITY(1,1) NOT NULL,
- [SessionID] [int] NOT NULL CONSTRAINT [DF_Owners_SessionID] DEFAULT ((0)),
- [OwnerType] [tinyint] NOT NULL CONSTRAINT [DF_Owners_OwnerType] DEFAULT ((0)),
- [OwnerItemID] [int] NOT NULL CONSTRAINT [DF_Owners_OwnerItemID] DEFAULT ((0)),
- [DTSStart] [datetime] NOT NULL CONSTRAINT [DF_Owners_DTSStart] DEFAULT (getdate()),
- [LastChanged] [timestamp] NOT NULL,
- CONSTRAINT [PK_Owners] PRIMARY KEY CLUSTERED
-(
- [OwnerID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-) ON [PRIMARY]
-GO
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'{datetime}' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Owners', @level2type=N'COLUMN',@level2name=N'DTSStart'
-GO
-/****** Object: Table [dbo].[ApplicableStructures] Script Date: 01/06/2012 15:02:52 ******/
-SET ANSI_NULLS ON
-GO
-SET QUOTED_IDENTIFIER ON
-GO
-CREATE TABLE [ApplicableStructures](
- [StructureID] [int] NOT NULL,
- [AppItems] [nvarchar](max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
- [DTS] [datetime] NOT NULL CONSTRAINT [DF_ApplicableStructures_DTS] DEFAULT (getdate()),
- [UserID] [nvarchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_ApplicableStructures_UserID] DEFAULT (upper(suser_sname())),
- [LastChanged] [timestamp] NOT NULL,
- CONSTRAINT [PK_ApplicableStructures] PRIMARY KEY CLUSTERED
-(
- [StructureID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-) ON [PRIMARY]
-GO
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'A series of characters - Y means Applicable, N means Not Applicable, Space means undecided' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ApplicableStructures', @level2type=N'COLUMN',@level2name=N'AppItems'
-GO
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'{datetime}' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ApplicableStructures', @level2type=N'COLUMN',@level2name=N'DTS'
-GO
-/****** Object: Table [dbo].[Roles] Script Date: 01/06/2012 15:02:52 ******/
-SET ANSI_NULLS ON
-GO
-SET QUOTED_IDENTIFIER ON
-GO
-CREATE TABLE [Roles](
- [RID] [int] IDENTITY(1,1) NOT NULL,
- [Name] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
- [Title] [nvarchar](250) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
- [DTS] [datetime] NOT NULL CONSTRAINT [DF_Roles_DTS] DEFAULT (getdate()),
- [UsrID] [nvarchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_Roles_UsrID] DEFAULT (upper(suser_sname())),
- [LastChanged] [timestamp] NOT NULL,
- CONSTRAINT [PK_Roles] PRIMARY KEY CLUSTERED
-(
- [RID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-) ON [PRIMARY]
-GO
-CREATE UNIQUE NONCLUSTERED INDEX [IX_Roles] ON [Roles]
-(
- [Name] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-GO
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'{datetime}' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Roles', @level2type=N'COLUMN',@level2name=N'DTS'
-GO
-/****** Object: Table [dbo].[Associations] Script Date: 01/06/2012 15:02:52 ******/
-SET ANSI_NULLS ON
-GO
-SET QUOTED_IDENTIFIER ON
-GO
-CREATE TABLE [Associations](
- [AssociationID] [int] IDENTITY(1,1) NOT NULL,
- [VersionID] [int] NOT NULL,
- [ROFstID] [int] NOT NULL,
- [Config] [nvarchar](max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
- [DTS] [datetime] NOT NULL CONSTRAINT [DF_Associations_DTS] DEFAULT (getdate()),
- [UserID] [nvarchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_Associations_UserID] DEFAULT (upper(suser_sname())),
- [LastChanged] [timestamp] NOT NULL,
- CONSTRAINT [PK_Associations_1] PRIMARY KEY CLUSTERED
-(
- [AssociationID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-) ON [PRIMARY]
-GO
-CREATE UNIQUE NONCLUSTERED INDEX [IX_Associations_VersionID_ROFstID] ON [Associations]
-(
- [VersionID] ASC,
- [ROFstID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-GO
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'{datetime}' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Associations', @level2type=N'COLUMN',@level2name=N'DTS'
-GO
-/****** Object: Table [dbo].[Folders] Script Date: 01/06/2012 15:02:52 ******/
-SET ANSI_NULLS ON
-GO
-SET QUOTED_IDENTIFIER ON
-GO
-CREATE TABLE [Folders](
- [FolderID] [int] IDENTITY(1,1) NOT NULL,
- [ParentID] [int] NOT NULL CONSTRAINT [DF_Folders_ParentID] DEFAULT ((1)),
- [DBID] [int] NOT NULL CONSTRAINT [DF_DataSets_DBID] DEFAULT ((1)),
- [Name] [nvarchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
- [Title] [nvarchar](510) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
- [ShortName] [nvarchar](20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
- [FormatID] [int] NULL,
- [ManualOrder] [float] NULL,
- [Config] [nvarchar](max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
- [DTS] [datetime] NOT NULL CONSTRAINT [DF_DataSets_DTS] DEFAULT (getdate()),
- [UsrID] [nvarchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_DataSets_UserID] DEFAULT (upper(suser_sname())),
- [LastChanged] [timestamp] NOT NULL,
- CONSTRAINT [PK_DataSets] PRIMARY KEY CLUSTERED
-(
- [FolderID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-) ON [PRIMARY]
-GO
-CREATE NONCLUSTERED INDEX [IX_FoldersDBID] ON [Folders]
-(
- [DBID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-GO
-CREATE NONCLUSTERED INDEX [IX_FoldersFormatID] ON [Folders]
-(
- [FormatID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-GO
-CREATE NONCLUSTERED INDEX [IX_FoldersParentID] ON [Folders]
-(
- [ParentID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-GO
-CREATE UNIQUE NONCLUSTERED INDEX [IX_UniqueChildFolders] ON [Folders]
-(
- [ParentID] ASC,
- [Name] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-GO
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'{datetime}' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Folders', @level2type=N'COLUMN',@level2name=N'DTS'
-GO
-/****** Object: Table [dbo].[DROUsages] Script Date: 01/06/2012 15:02:53 ******/
-SET ANSI_NULLS ON
-GO
-SET QUOTED_IDENTIFIER ON
-GO
-CREATE TABLE [DROUsages](
- [DROUsageID] [int] IDENTITY(1,1) NOT NULL,
- [DocID] [int] NOT NULL CONSTRAINT [DF_Table_1_ContentID] DEFAULT ((0)),
- [ROID] [nvarchar](16) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
- [Config] [nvarchar](max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
- [DTS] [datetime] NOT NULL CONSTRAINT [DF_DROUsages_DTS] DEFAULT (getdate()),
- [UserID] [nvarchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_DROUsages_UserID] DEFAULT (upper(suser_sname())),
- [LastChanged] [timestamp] NOT NULL,
- [RODbID] [int] NOT NULL,
- CONSTRAINT [PK_DROUsages] PRIMARY KEY CLUSTERED
-(
- [DROUsageID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-) ON [PRIMARY]
-GO
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'{datetime}' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DROUsages', @level2type=N'COLUMN',@level2name=N'DTS'
-GO
-/****** Object: Table [dbo].[ROImages] Script Date: 01/06/2012 15:02:53 ******/
-SET ANSI_NULLS ON
-GO
-SET QUOTED_IDENTIFIER ON
-GO
-SET ANSI_PADDING ON
-GO
-CREATE TABLE [ROImages](
- [ImageID] [int] IDENTITY(1,1) NOT NULL,
- [RODbID] [int] NOT NULL,
- [FileName] [nvarchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
- [Content] [varbinary](max) NOT NULL,
- [Config] [nvarchar](max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
- [DTS] [datetime] NOT NULL CONSTRAINT [DF_ROImages_DTS] DEFAULT (getdate()),
- [UserID] [nvarchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_ROImages_UserID] DEFAULT (upper(suser_sname())),
- [LastChanged] [timestamp] NOT NULL,
- CONSTRAINT [PK_ROImages] PRIMARY KEY CLUSTERED
-(
- [ImageID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-) ON [PRIMARY]
-GO
-SET ANSI_PADDING OFF
-GO
-CREATE UNIQUE NONCLUSTERED INDEX [IX_ROImages_RODbID_FileName_DTS] ON [ROImages]
-(
- [RODbID] ASC,
- [FileName] ASC,
- [DTS] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-GO
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'{datetime}' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ROImages', @level2type=N'COLUMN',@level2name=N'DTS'
-GO
-/****** Object: Table [dbo].[ROFsts] Script Date: 01/06/2012 15:02:53 ******/
-SET ANSI_NULLS ON
-GO
-SET QUOTED_IDENTIFIER ON
-GO
-SET ANSI_PADDING ON
-GO
-CREATE TABLE [ROFsts](
- [ROFstID] [int] IDENTITY(1,1) NOT NULL,
- [RODbID] [int] NOT NULL,
- [ROLookup] [varbinary](max) NOT NULL,
- [Config] [nvarchar](max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
- [DTS] [datetime] NOT NULL CONSTRAINT [DF_Table_1_DTS1] DEFAULT (getdate()),
- [UserID] [nvarchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_ROFsts_UserID] DEFAULT (upper(suser_sname())),
- [LastChanged] [timestamp] NOT NULL,
- CONSTRAINT [PK_ROFsts] PRIMARY KEY CLUSTERED
-(
- [ROFstID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-) ON [PRIMARY]
-GO
-SET ANSI_PADDING OFF
-GO
-CREATE UNIQUE NONCLUSTERED INDEX [IX_ROFsts] ON [ROFsts]
-(
- [RODbID] ASC,
- [DTS] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-GO
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'{datetime}' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ROFsts', @level2type=N'COLUMN',@level2name=N'DTS'
-GO
-/****** Object: Table [dbo].[RoUsages] Script Date: 01/06/2012 15:02:53 ******/
-SET ANSI_NULLS ON
-GO
-SET QUOTED_IDENTIFIER ON
-GO
-CREATE TABLE [RoUsages](
- [ROUsageID] [int] IDENTITY(1,1) NOT NULL,
- [ContentID] [int] NOT NULL CONSTRAINT [DF_RoUsages_StructureID] DEFAULT ((0)),
- [ROID] [nvarchar](16) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
- [Config] [nvarchar](max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
- [DTS] [datetime] NOT NULL CONSTRAINT [DF_RoUsages_DTS] DEFAULT (getdate()),
- [UserID] [nvarchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_RoUsages_UserID] DEFAULT (upper(suser_sname())),
- [LastChanged] [timestamp] NOT NULL,
- [RODbID] [int] NOT NULL,
- CONSTRAINT [PK_RoUsages] PRIMARY KEY CLUSTERED
-(
- [ROUsageID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-) ON [PRIMARY]
-GO
-CREATE NONCLUSTERED INDEX [IX_RoUsagesContentID] ON [RoUsages]
-(
- [ContentID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-GO
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'{datetime}' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'RoUsages', @level2type=N'COLUMN',@level2name=N'DTS'
-GO
-/****** Object: Table [dbo].[Figures] Script Date: 01/06/2012 15:02:53 ******/
-SET ANSI_NULLS ON
-GO
-SET QUOTED_IDENTIFIER ON
-GO
-CREATE TABLE [Figures](
- [FigureID] [int] IDENTITY(1,1) NOT NULL,
- [ROFstID] [int] NOT NULL,
- [ImageID] [int] NOT NULL,
- [Config] [nvarchar](max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
- [DTS] [datetime] NOT NULL CONSTRAINT [DF_Figures_DTS] DEFAULT (getdate()),
- [UserID] [nvarchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_Figures_UserID] DEFAULT (upper(suser_sname())),
- [LastChanged] [timestamp] NOT NULL,
- CONSTRAINT [PK_Figures_1] PRIMARY KEY CLUSTERED
-(
- [FigureID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-) ON [PRIMARY]
-GO
-CREATE UNIQUE NONCLUSTERED INDEX [IX_Figures_ROFstID_ImageID] ON [Figures]
-(
- [ROFstID] ASC,
- [ImageID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-GO
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'{datetime}' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Figures', @level2type=N'COLUMN',@level2name=N'DTS'
-GO
-/****** Object: Table [dbo].[Entries] Script Date: 01/06/2012 15:02:53 ******/
-SET ANSI_NULLS ON
-GO
-SET QUOTED_IDENTIFIER ON
-GO
-CREATE TABLE [Entries](
- [ContentID] [int] NOT NULL,
- [DocID] [int] NOT NULL,
- [DTS] [datetime] NOT NULL CONSTRAINT [DF_Entries_DTS] DEFAULT (getdate()),
- [UserID] [nvarchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_Entries_UserID] DEFAULT (upper(suser_sname())),
- [LastChanged] [timestamp] NOT NULL,
- CONSTRAINT [PK_Entries] PRIMARY KEY CLUSTERED
-(
- [ContentID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-) ON [PRIMARY]
-GO
-CREATE NONCLUSTERED INDEX [IX_EntriesDocID] ON [Entries]
-(
- [DocID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-GO
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'{datetime}' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Entries', @level2type=N'COLUMN',@level2name=N'DTS'
-GO
-/****** Object: Table [dbo].[Pdfs] Script Date: 01/06/2012 15:02:53 ******/
-SET ANSI_NULLS ON
-GO
-SET QUOTED_IDENTIFIER ON
-GO
-SET ANSI_PADDING ON
-GO
-CREATE TABLE [Pdfs](
- [DocID] [int] NOT NULL,
- [DebugStatus] [int] NOT NULL,
- [TopRow] [int] NOT NULL,
- [PageLength] [int] NOT NULL,
- [LeftMargin] [int] NOT NULL,
- [PageWidth] [int] NOT NULL,
- [PageCount] [float] NOT NULL,
- [DocPdf] [varbinary](max) NULL,
- [DTS] [datetime] NOT NULL CONSTRAINT [DF_Pdfs_DTS] DEFAULT (getdate()),
- [UserID] [nvarchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_Pdfs_UserID] DEFAULT (upper(suser_sname())),
- [LastChanged] [timestamp] NOT NULL,
- CONSTRAINT [PK_Pdfs] PRIMARY KEY CLUSTERED
-(
- [DocID] ASC,
- [DebugStatus] ASC,
- [TopRow] ASC,
- [PageLength] ASC,
- [LeftMargin] ASC,
- [PageWidth] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-) ON [PRIMARY]
-GO
-SET ANSI_PADDING OFF
-GO
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'> 0 for Debug' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Pdfs', @level2type=N'COLUMN',@level2name=N'DebugStatus'
-GO
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Count of whole and partial pages' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Pdfs', @level2type=N'COLUMN',@level2name=N'PageCount'
-GO
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'{datetime}' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Pdfs', @level2type=N'COLUMN',@level2name=N'DTS'
-GO
-/****** Object: Table [dbo].[Memberships] Script Date: 01/06/2012 15:02:53 ******/
-SET ANSI_NULLS ON
-GO
-SET QUOTED_IDENTIFIER ON
-GO
-CREATE TABLE [Memberships](
- [UGID] [int] IDENTITY(1,1) NOT NULL,
- [UID] [int] NOT NULL,
- [GID] [int] NOT NULL,
- [StartDate] [datetime] NOT NULL CONSTRAINT [DF_UserGroups_StartDate] DEFAULT (getdate()),
- [EndDate] [datetime] NULL,
- [Config] [nvarchar](max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
- [DTS] [datetime] NOT NULL CONSTRAINT [DF_Memberships_DTS] DEFAULT (getdate()),
- [UsrID] [nvarchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_Memberships_UserID] DEFAULT (upper(suser_sname())),
- [LastChanged] [timestamp] NOT NULL,
- CONSTRAINT [PK_UserGroups] PRIMARY KEY CLUSTERED
-(
- [UGID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-) ON [PRIMARY]
-GO
-CREATE NONCLUSTERED INDEX [IX_MembershipsGID] ON [Memberships]
-(
- [GID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-GO
-CREATE NONCLUSTERED INDEX [IX_MembershipsUID] ON [Memberships]
-(
- [UID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-GO
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'{datetime}' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Memberships', @level2type=N'COLUMN',@level2name=N'DTS'
-GO
-/****** Object: Table [dbo].[Assignments] Script Date: 01/06/2012 15:02:53 ******/
-SET ANSI_NULLS ON
-GO
-SET QUOTED_IDENTIFIER ON
-GO
-CREATE TABLE [Assignments](
- [AID] [int] IDENTITY(1,1) NOT NULL,
- [GID] [int] NOT NULL,
- [RID] [int] NOT NULL,
- [FolderID] [int] NOT NULL,
- [StartDate] [datetime] NOT NULL CONSTRAINT [DF_Assignments_StartDate] DEFAULT (getdate()),
- [EndDate] [datetime] NULL,
- [DTS] [datetime] NOT NULL CONSTRAINT [DF_Assignments_DTS] DEFAULT (getdate()),
- [UsrID] [nvarchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_Assignments_UsrID] DEFAULT (upper(suser_sname())),
- [LastChanged] [timestamp] NOT NULL,
- CONSTRAINT [PK_Assignments] PRIMARY KEY CLUSTERED
-(
- [AID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-) ON [PRIMARY]
-GO
-CREATE NONCLUSTERED INDEX [IX_AssignmentsFolderID] ON [Assignments]
-(
- [FolderID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-GO
-CREATE NONCLUSTERED INDEX [IX_AssignmentsGID] ON [Assignments]
-(
- [GID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-GO
-CREATE NONCLUSTERED INDEX [IX_AssignmentsRID] ON [Assignments]
-(
- [RID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-GO
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'{datetime}' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Assignments', @level2type=N'COLUMN',@level2name=N'DTS'
-GO
-/****** Object: Table [dbo].[Parts] Script Date: 01/06/2012 15:02:53 ******/
-SET ANSI_NULLS ON
-GO
-SET QUOTED_IDENTIFIER ON
-GO
-CREATE TABLE [Parts](
- [ContentID] [int] NOT NULL,
- [FromType] [int] NOT NULL,
- [ItemID] [int] NOT NULL,
- [DTS] [datetime] NOT NULL CONSTRAINT [DF_Parts_DTS] DEFAULT (getdate()),
- [UserID] [nvarchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_Parts_UserID] DEFAULT (upper(suser_sname())),
- [LastChanged] [timestamp] NOT NULL,
- CONSTRAINT [PK_Parts] PRIMARY KEY CLUSTERED
-(
- [ContentID] ASC,
- [FromType] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-) ON [PRIMARY]
-GO
-CREATE NONCLUSTERED INDEX [IX_PartsItemID] ON [Parts]
-(
- [ItemID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-GO
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'{datetime}' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Parts', @level2type=N'COLUMN',@level2name=N'DTS'
-GO
-/****** Object: Table [dbo].[DocVersions] Script Date: 01/06/2012 15:02:53 ******/
-SET ANSI_NULLS ON
-GO
-SET QUOTED_IDENTIFIER ON
-GO
-CREATE TABLE [DocVersions](
- [VersionID] [int] IDENTITY(1,1) NOT NULL,
- [FolderID] [int] NOT NULL,
- [VersionType] [int] NOT NULL CONSTRAINT [DF_Versions_VersionType] DEFAULT ((0)),
- [Name] [nvarchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
- [Title] [nvarchar](510) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
- [ItemID] [int] NULL,
- [FormatID] [int] NULL,
- [Config] [nvarchar](max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
- [DTS] [datetime] NOT NULL CONSTRAINT [DF_Versions_DTS] DEFAULT (getdate()),
- [UserID] [nvarchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_Versions_UserID] DEFAULT (upper(suser_sname())),
- [LastChanged] [timestamp] NOT NULL,
- CONSTRAINT [PK_Versions] PRIMARY KEY CLUSTERED
-(
- [VersionID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-) ON [PRIMARY]
-GO
-CREATE NONCLUSTERED INDEX [IX_DocVersionsFolderID] ON [DocVersions]
-(
- [FolderID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-GO
-CREATE NONCLUSTERED INDEX [IX_DocVersionsFormatID] ON [DocVersions]
-(
- [FormatID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-GO
-CREATE NONCLUSTERED INDEX [IX_DocVersionsItemID] ON [DocVersions]
-(
- [ItemID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-GO
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'0 Working Draft, 1 Temporary, 128 Revision, 129 Approved (Greater than 127 - non editable)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DocVersions', @level2type=N'COLUMN',@level2name=N'VersionType'
-GO
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'{datetime}' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DocVersions', @level2type=N'COLUMN',@level2name=N'DTS'
-GO
-/****** Object: Table [dbo].[Transitions] Script Date: 01/06/2012 15:02:53 ******/
-SET ANSI_NULLS ON
-GO
-SET QUOTED_IDENTIFIER ON
-GO
-CREATE TABLE [Transitions](
- [TransitionID] [int] IDENTITY(1,1) NOT NULL,
- [FromID] [int] NOT NULL,
- [ToID] [int] NOT NULL,
- [RangeID] [int] NOT NULL,
- [IsRange] [int] NOT NULL CONSTRAINT [DF_Transitions_IsRange] DEFAULT ((0)),
- [TranType] [int] NOT NULL CONSTRAINT [DF_Transitions_TranType] DEFAULT ((0)),
- [Config] [nvarchar](max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
- [DTS] [datetime] NOT NULL CONSTRAINT [DF_Transitions_DTS] DEFAULT (getdate()),
- [UserID] [nvarchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_Transitions_UserID] DEFAULT (upper(suser_sname())),
- [LastChanged] [timestamp] NOT NULL,
- CONSTRAINT [PK_TranUsages] PRIMARY KEY CLUSTERED
-(
- [TransitionID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-) ON [PRIMARY]
-GO
-CREATE NONCLUSTERED INDEX [IX_TransitionsFromID] ON [Transitions]
-(
- [FromID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-GO
-CREATE NONCLUSTERED INDEX [IX_TransitionsRangeID] ON [Transitions]
-(
- [RangeID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-GO
-CREATE NONCLUSTERED INDEX [IX_TransitionsToID] ON [Transitions]
-(
- [ToID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-GO
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'StructureID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Transitions', @level2type=N'COLUMN',@level2name=N'ToID'
-GO
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'0 - Not a Range Transition, 1 - Range Transition, 2 - Range Transition - Extends to last Sibling' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Transitions', @level2type=N'COLUMN',@level2name=N'IsRange'
-GO
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'{datetime}' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Transitions', @level2type=N'COLUMN',@level2name=N'DTS'
-GO
-/****** Object: Table [dbo].[Annotations] Script Date: 01/06/2012 15:02:53 ******/
-SET ANSI_NULLS ON
-GO
-SET QUOTED_IDENTIFIER ON
-GO
-CREATE TABLE [Annotations](
- [AnnotationID] [int] IDENTITY(1,1) NOT NULL,
- [ItemID] [int] NOT NULL,
- [TypeID] [int] NOT NULL,
- [RtfText] [nvarchar](max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
- [SearchText] [nvarchar](max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
- [Config] [nvarchar](max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
- [DTS] [datetime] NOT NULL CONSTRAINT [DF_Annotations_DTS] DEFAULT (getdate()),
- [UserID] [nvarchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_Annotations_UserID] DEFAULT (upper(suser_sname())),
- [LastChanged] [timestamp] NOT NULL,
- CONSTRAINT [PK_Annotations] PRIMARY KEY CLUSTERED
-(
- [AnnotationID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-) ON [PRIMARY]
-GO
-CREATE NONCLUSTERED INDEX [IX_AnnotationsItemID] ON [Annotations]
-(
- [ItemID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-GO
-CREATE NONCLUSTERED INDEX [IX_AnnotationsTypeID] ON [Annotations]
-(
- [TypeID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-GO
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'{datetime}' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Annotations', @level2type=N'COLUMN',@level2name=N'DTS'
-GO
-/****** Object: Table [dbo].[Contents] Script Date: 01/06/2012 15:02:53 ******/
-SET ANSI_NULLS ON
-GO
-SET QUOTED_IDENTIFIER ON
-GO
-CREATE TABLE [Contents](
- [ContentID] [int] IDENTITY(1,1) NOT NULL,
- [Number] [nvarchar](256) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
- [Text] [nvarchar](max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
- [Type] [int] NULL,
- [FormatID] [int] NULL,
- [Config] [nvarchar](max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
- [DTS] [datetime] NOT NULL CONSTRAINT [DF_Contents_DTS] DEFAULT (getdate()),
- [UserID] [nvarchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_Contents_UserID] DEFAULT (upper(suser_sname())),
- [LastChanged] [timestamp] NOT NULL,
- CONSTRAINT [PK_Contents] PRIMARY KEY CLUSTERED
-(
- [ContentID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-) ON [PRIMARY]
-GO
-CREATE NONCLUSTERED INDEX [IX_ContentsFormatID] ON [Contents]
-(
- [FormatID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-GO
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Increased from 30 to 256 to support RTF symbols' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Contents', @level2type=N'COLUMN',@level2name=N'Number'
-GO
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'0 - Procedure, 10000 - Section, 20000 Step' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Contents', @level2type=N'COLUMN',@level2name=N'Type'
-GO
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'{datetime}' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Contents', @level2type=N'COLUMN',@level2name=N'DTS'
-GO
-/****** Object: Table [dbo].[Items] Script Date: 01/06/2012 15:02:53 ******/
-SET ANSI_NULLS ON
-GO
-SET QUOTED_IDENTIFIER ON
-GO
-CREATE TABLE [Items](
- [ItemID] [int] IDENTITY(1,1) NOT NULL,
- [PreviousID] [int] NULL,
- [ContentID] [int] NOT NULL,
- [DTS] [datetime] NOT NULL CONSTRAINT [DF_Items_DTS] DEFAULT (getdate()),
- [UserID] [nvarchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_Items_UsrID] DEFAULT (upper(suser_sname())),
- [LastChanged] [timestamp] NOT NULL,
- CONSTRAINT [PK_Items] PRIMARY KEY CLUSTERED
-(
- [ItemID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-) ON [PRIMARY]
-GO
-CREATE NONCLUSTERED INDEX [IX_ItemsContentID] ON [Items]
-(
- [ContentID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-GO
-CREATE NONCLUSTERED INDEX [IX_ItemsPreviousID] ON [Items]
-(
- [PreviousID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-GO
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'{datetime}' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Items', @level2type=N'COLUMN',@level2name=N'DTS'
-GO
-
-/****** Object: Table [dbo].[Scopes] Script Date: 01/06/2012 15:02:52 ******/
-SET ANSI_NULLS ON
-GO
-SET QUOTED_IDENTIFIER ON
-GO
-CREATE TABLE [Scopes](
- [ScopeID] [int] IDENTITY(1,1) NOT NULL,
- [Name] [nvarchar](100) NOT NULL,
- [Title] [nvarchar](510) NULL,
- [DTS] [datetime] NOT NULL CONSTRAINT [DF_Scopes_DTS] DEFAULT (getdate()),
- [UserID] [nvarchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_Scopes_UserID] DEFAULT (upper(suser_sname())),
- [LastChanged] [timestamp] NOT NULL,
- CONSTRAINT [PK_Scopes] PRIMARY KEY CLUSTERED
-(
- [ScopeID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-) ON [PRIMARY]
-GO
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'{datetime}' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Scopes', @level2type=N'COLUMN',@level2name=N'DTS'
-GO
-
-/****** Object: Table [dbo].[Applicabilities] Script Date: 01/06/2012 15:02:52 ******/
---SET ANSI_NULLS ON
---GO
---SET QUOTED_IDENTIFIER ON
---GO
---CREATE TABLE [Applicabilities](
--- [ItemID] [int] NOT NULL,
--- [ScopeID] [int] NOT NULL,
--- [DTS] [datetime] NOT NULL CONSTRAINT [DF_Applicabilities_DTS] DEFAULT (getdate()),
--- [UserID] [nvarchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_Applicabilities_UserID] DEFAULT (upper(suser_sname())),
--- [LastChanged] [timestamp] NOT NULL,
--- CONSTRAINT [PK_Applicabilities] PRIMARY KEY CLUSTERED
---(
--- [ItemID] ASC,
--- [ScopeID] ASC
---)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
---) ON [PRIMARY]
---GO
---EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'{datetime}' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Applicabilities', @level2type=N'COLUMN',@level2name=N'DTS'
---GO
-
-/****** Object: Table [dbo].[Details] Script Date: 01/06/2012 15:02:53 ******/
-SET ANSI_NULLS ON
-GO
-SET QUOTED_IDENTIFIER ON
-GO
-CREATE TABLE [Details](
- [DetailID] [int] IDENTITY(1,1) NOT NULL,
- [ContentID] [int] NOT NULL,
- [ItemType] [int] NOT NULL,
- [Text] [nvarchar](max) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
- [Config] [nvarchar](max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
- [DTS] [datetime] NOT NULL CONSTRAINT [DF_StepTexts_DTS] DEFAULT (getdate()),
- [UserID] [nvarchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_StepTexts_UserID] DEFAULT (upper(suser_sname())),
- [LastChanged] [timestamp] NOT NULL,
- CONSTRAINT [PK_StepTexts] PRIMARY KEY CLUSTERED
-(
- [DetailID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-) ON [PRIMARY]
-GO
-CREATE NONCLUSTERED INDEX [IX_DetailsContentID] ON [Details]
-(
- [ContentID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-GO
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'{datetime}' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Details', @level2type=N'COLUMN',@level2name=N'DTS'
-GO
-/****** Object: Table [dbo].[ZContents] Script Date: 01/06/2012 15:02:53 ******/
-SET ANSI_NULLS ON
-GO
-SET QUOTED_IDENTIFIER ON
-GO
-CREATE TABLE [ZContents](
- [ContentID] [int] NOT NULL,
- [OldStepSequence] [nvarchar](32) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
- [LastChanged] [timestamp] NOT NULL,
- CONSTRAINT [PK_ZContents] PRIMARY KEY CLUSTERED
-(
- [ContentID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-) ON [PRIMARY]
-GO
-/****** Object: Table [dbo].[Grids] Script Date: 01/06/2012 15:02:53 ******/
-SET ANSI_NULLS ON
-GO
-SET QUOTED_IDENTIFIER ON
-GO
-CREATE TABLE [Grids](
- [ContentID] [int] NOT NULL,
- [Data] [xml] NOT NULL,
- [Config] [xml] NULL,
- [DTS] [datetime] NOT NULL CONSTRAINT [DF_Grids_DTS] DEFAULT (getdate()),
- [UserID] [nvarchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_Grids_UserID] DEFAULT (upper(suser_sname())),
- [LastChanged] [timestamp] NOT NULL,
- CONSTRAINT [PK_Grids] PRIMARY KEY CLUSTERED
-(
- [ContentID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-) ON [PRIMARY]
-GO
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'{datetime}' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Grids', @level2type=N'COLUMN',@level2name=N'DTS'
-GO
-/****** Object: Table [dbo].[Images] Script Date: 01/06/2012 15:02:53 ******/
-SET ANSI_NULLS ON
-GO
-SET QUOTED_IDENTIFIER ON
-GO
-SET ANSI_PADDING ON
-GO
-CREATE TABLE [Images](
- [ContentID] [int] NOT NULL,
- [ImageType] [int] NOT NULL CONSTRAINT [DF_Images_ImageType] DEFAULT ((1)),
- [FileName] [nvarchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
- [Data] [varbinary](max) NOT NULL,
- [Config] [xml] NULL,
- [DTS] [datetime] NOT NULL CONSTRAINT [DF_Images_DTS] DEFAULT (getdate()),
- [UserID] [nvarchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_Images_UserID] DEFAULT (upper(suser_sname())),
- [LastChanged] [timestamp] NOT NULL,
- CONSTRAINT [PK_Images] PRIMARY KEY CLUSTERED
-(
- [ContentID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-) ON [PRIMARY]
-GO
-SET ANSI_PADDING OFF
-GO
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'1 - Figure, 2 - Video, 3 - Audio' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Images', @level2type=N'COLUMN',@level2name=N'ImageType'
-GO
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'{datetime}' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Images', @level2type=N'COLUMN',@level2name=N'DTS'
-GO
-/****** Object: Table [dbo].[ZTransitions] Script Date: 01/06/2012 15:02:53 ******/
-SET ANSI_NULLS ON
-GO
-SET QUOTED_IDENTIFIER ON
-GO
-CREATE TABLE [ZTransitions](
- [TransitionID] [int] NOT NULL,
- [oldto] [nvarchar](32) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
- [LastChanged] [timestamp] NOT NULL,
- CONSTRAINT [PK_ZTransitions] PRIMARY KEY CLUSTERED
-(
- [TransitionID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-) ON [PRIMARY]
-GO
-/****** Object: Table [dbo].[Permissions] Script Date: 01/06/2012 15:02:53 ******/
-SET ANSI_NULLS ON
-GO
-SET QUOTED_IDENTIFIER ON
-GO
-CREATE TABLE [Permissions](
- [PID] [int] IDENTITY(1,1) NOT NULL,
- [RID] [int] NOT NULL,
- [PermLevel] [int] NOT NULL,
- [VersionType] [int] NOT NULL,
- [PermValue] [int] NOT NULL,
- [PermAD] [int] NOT NULL CONSTRAINT [DF_Permissions_PermAD] DEFAULT ((0)),
- [StartDate] [datetime] NOT NULL CONSTRAINT [DF_Permissions_StartDate] DEFAULT (getdate()),
- [EndDate] [datetime] NULL,
- [Config] [nvarchar](max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
- [DTS] [datetime] NOT NULL CONSTRAINT [DF_Permissions_DTS] DEFAULT (getdate()),
- [UsrID] [nvarchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_Permissions_UserID] DEFAULT (upper(suser_sname())),
- [LastChanged] [timestamp] NOT NULL,
- CONSTRAINT [PK_Permissions] PRIMARY KEY CLUSTERED
-(
- [PID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-) ON [PRIMARY]
-GO
-CREATE NONCLUSTERED INDEX [IX_PermissionsRID] ON [Permissions]
-(
- [RID] ASC
-)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
-GO
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'0 - None, 1 - Security, 2 - System, 3 - RO, 4 - Procdures, 5 - Sections, 6 - Steps, 7 - Comments' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Permissions', @level2type=N'COLUMN',@level2name=N'PermLevel'
-GO
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'0 - None, 1 - Working Draft, 2 - Approved, (3 - All)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Permissions', @level2type=N'COLUMN',@level2name=N'VersionType'
-GO
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'1 - Read, 2 - Write, 4 - Create, 8 - Delete (15 - All)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Permissions', @level2type=N'COLUMN',@level2name=N'PermValue'
-GO
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'0 - Allow, 1 - Deny' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Permissions', @level2type=N'COLUMN',@level2name=N'PermAD'
-GO
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'{datetime}' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Permissions', @level2type=N'COLUMN',@level2name=N'DTS'
-GO
-/****** Object: ForeignKey [FK_Formats_ParentID] Script Date: 01/06/2012 15:02:52 ******/
-ALTER TABLE [Formats] WITH CHECK ADD CONSTRAINT [FK_Formats_ParentID] FOREIGN KEY([ParentID])
-REFERENCES [Formats] ([FormatID])
-GO
-ALTER TABLE [Formats] CHECK CONSTRAINT [FK_Formats_ParentID]
-GO
-/****** Object: ForeignKey [FK_Associations_DocVersions] Script Date: 01/06/2012 15:02:52 ******/
-ALTER TABLE [Associations] WITH CHECK ADD CONSTRAINT [FK_Associations_DocVersions] FOREIGN KEY([VersionID])
-REFERENCES [DocVersions] ([VersionID])
-GO
-ALTER TABLE [Associations] CHECK CONSTRAINT [FK_Associations_DocVersions]
-GO
-/****** Object: ForeignKey [FK_Associations_ROFsts] Script Date: 01/06/2012 15:02:52 ******/
-ALTER TABLE [Associations] WITH CHECK ADD CONSTRAINT [FK_Associations_ROFsts] FOREIGN KEY([ROFstID])
-REFERENCES [ROFsts] ([ROFstID])
-GO
-ALTER TABLE [Associations] CHECK CONSTRAINT [FK_Associations_ROFsts]
-GO
-/****** Object: ForeignKey [FK__Folders__ParentID] Script Date: 01/06/2012 15:02:52 ******/
-ALTER TABLE [Folders] WITH CHECK ADD CONSTRAINT [FK__Folders__ParentID] FOREIGN KEY([ParentID])
-REFERENCES [Folders] ([FolderID])
-GO
-ALTER TABLE [Folders] CHECK CONSTRAINT [FK__Folders__ParentID]
-GO
-/****** Object: ForeignKey [FK_Folders_Connections] Script Date: 01/06/2012 15:02:52 ******/
-ALTER TABLE [Folders] WITH CHECK ADD CONSTRAINT [FK_Folders_Connections] FOREIGN KEY([DBID])
-REFERENCES [Connections] ([DBID])
-GO
-ALTER TABLE [Folders] CHECK CONSTRAINT [FK_Folders_Connections]
-GO
-/****** Object: ForeignKey [FK_Folders_Formats] Script Date: 01/06/2012 15:02:52 ******/
-ALTER TABLE [Folders] WITH CHECK ADD CONSTRAINT [FK_Folders_Formats] FOREIGN KEY([FormatID])
-REFERENCES [Formats] ([FormatID])
-GO
-ALTER TABLE [Folders] CHECK CONSTRAINT [FK_Folders_Formats]
-GO
-/****** Object: ForeignKey [FK_DROUsages_Documents] Script Date: 01/06/2012 15:02:53 ******/
-ALTER TABLE [DROUsages] WITH CHECK ADD CONSTRAINT [FK_DROUsages_Documents] FOREIGN KEY([DocID])
-REFERENCES [Documents] ([DocID])
-GO
-ALTER TABLE [DROUsages] CHECK CONSTRAINT [FK_DROUsages_Documents]
-GO
-/****** Object: ForeignKey [FK_DROUsages_RODbs] Script Date: 01/06/2012 15:02:53 ******/
-ALTER TABLE [DROUsages] WITH CHECK ADD CONSTRAINT [FK_DROUsages_RODbs] FOREIGN KEY([RODbID])
-REFERENCES [RODbs] ([RODbID])
-GO
-ALTER TABLE [DROUsages] CHECK CONSTRAINT [FK_DROUsages_RODbs]
-GO
-/****** Object: ForeignKey [FK_Figures_RODbs] Script Date: 01/06/2012 15:02:53 ******/
-ALTER TABLE [ROImages] WITH CHECK ADD CONSTRAINT [FK_Figures_RODbs] FOREIGN KEY([RODbID])
-REFERENCES [RODbs] ([RODbID])
-GO
-ALTER TABLE [ROImages] CHECK CONSTRAINT [FK_Figures_RODbs]
-GO
-/****** Object: ForeignKey [FK_ROFsts_RODbs] Script Date: 01/06/2012 15:02:53 ******/
-ALTER TABLE [ROFsts] WITH CHECK ADD CONSTRAINT [FK_ROFsts_RODbs] FOREIGN KEY([RODbID])
-REFERENCES [RODbs] ([RODbID])
-GO
-ALTER TABLE [ROFsts] CHECK CONSTRAINT [FK_ROFsts_RODbs]
-GO
-/****** Object: ForeignKey [FK_RoUsages_Contents] Script Date: 01/06/2012 15:02:53 ******/
-ALTER TABLE [RoUsages] WITH CHECK ADD CONSTRAINT [FK_RoUsages_Contents] FOREIGN KEY([ContentID])
-REFERENCES [Contents] ([ContentID])
-GO
-ALTER TABLE [RoUsages] CHECK CONSTRAINT [FK_RoUsages_Contents]
-GO
-/****** Object: ForeignKey [FK_ROUsages_RODbs] Script Date: 01/06/2012 15:02:53 ******/
-ALTER TABLE [RoUsages] WITH CHECK ADD CONSTRAINT [FK_ROUsages_RODbs] FOREIGN KEY([RODbID])
-REFERENCES [RODbs] ([RODbID])
-GO
-ALTER TABLE [RoUsages] CHECK CONSTRAINT [FK_ROUsages_RODbs]
-GO
-/****** Object: ForeignKey [FK_Figures_ROFsts] Script Date: 01/06/2012 15:02:53 ******/
-ALTER TABLE [Figures] WITH CHECK ADD CONSTRAINT [FK_Figures_ROFsts] FOREIGN KEY([ROFstID])
-REFERENCES [ROFsts] ([ROFstID])
-GO
-ALTER TABLE [Figures] CHECK CONSTRAINT [FK_Figures_ROFsts]
-GO
-/****** Object: ForeignKey [FK_Figures_ROImages] Script Date: 01/06/2012 15:02:53 ******/
-ALTER TABLE [Figures] WITH CHECK ADD CONSTRAINT [FK_Figures_ROImages] FOREIGN KEY([ImageID])
-REFERENCES [ROImages] ([ImageID])
-GO
-ALTER TABLE [Figures] CHECK CONSTRAINT [FK_Figures_ROImages]
-GO
-/****** Object: ForeignKey [FK_Entries_Contents] Script Date: 01/06/2012 15:02:53 ******/
-ALTER TABLE [Entries] WITH CHECK ADD CONSTRAINT [FK_Entries_Contents] FOREIGN KEY([ContentID])
-REFERENCES [Contents] ([ContentID])
-GO
-ALTER TABLE [Entries] CHECK CONSTRAINT [FK_Entries_Contents]
-GO
-/****** Object: ForeignKey [FK_Entries_Documents] Script Date: 01/06/2012 15:02:53 ******/
-ALTER TABLE [Entries] WITH CHECK ADD CONSTRAINT [FK_Entries_Documents] FOREIGN KEY([DocID])
-REFERENCES [Documents] ([DocID])
-GO
-ALTER TABLE [Entries] CHECK CONSTRAINT [FK_Entries_Documents]
-GO
-/****** Object: ForeignKey [FK_Pdfs_Documents] Script Date: 01/06/2012 15:02:53 ******/
-ALTER TABLE [Pdfs] WITH CHECK ADD CONSTRAINT [FK_Pdfs_Documents] FOREIGN KEY([DocID])
-REFERENCES [Documents] ([DocID])
-GO
-ALTER TABLE [Pdfs] CHECK CONSTRAINT [FK_Pdfs_Documents]
-GO
-/****** Object: ForeignKey [FK_Memberships_Groups] Script Date: 01/06/2012 15:02:53 ******/
-ALTER TABLE [Memberships] WITH CHECK ADD CONSTRAINT [FK_Memberships_Groups] FOREIGN KEY([GID])
-REFERENCES [Groups] ([GID])
-GO
-ALTER TABLE [Memberships] CHECK CONSTRAINT [FK_Memberships_Groups]
-GO
-/****** Object: ForeignKey [FK_Memberships_Users] Script Date: 01/06/2012 15:02:53 ******/
-ALTER TABLE [Memberships] WITH CHECK ADD CONSTRAINT [FK_Memberships_Users] FOREIGN KEY([UID])
-REFERENCES [Users] ([UID])
-GO
-ALTER TABLE [Memberships] CHECK CONSTRAINT [FK_Memberships_Users]
-GO
-/****** Object: ForeignKey [FK_Assignments_Folders] Script Date: 01/06/2012 15:02:53 ******/
-ALTER TABLE [Assignments] WITH CHECK ADD CONSTRAINT [FK_Assignments_Folders] FOREIGN KEY([FolderID])
-REFERENCES [Folders] ([FolderID])
-GO
-ALTER TABLE [Assignments] CHECK CONSTRAINT [FK_Assignments_Folders]
-GO
-/****** Object: ForeignKey [FK_Assignments_Groups] Script Date: 01/06/2012 15:02:53 ******/
-ALTER TABLE [Assignments] WITH CHECK ADD CONSTRAINT [FK_Assignments_Groups] FOREIGN KEY([GID])
-REFERENCES [Groups] ([GID])
-GO
-ALTER TABLE [Assignments] CHECK CONSTRAINT [FK_Assignments_Groups]
-GO
-/****** Object: ForeignKey [FK_Assignments_Roles] Script Date: 01/06/2012 15:02:53 ******/
-ALTER TABLE [Assignments] WITH CHECK ADD CONSTRAINT [FK_Assignments_Roles] FOREIGN KEY([RID])
-REFERENCES [Roles] ([RID])
-GO
-ALTER TABLE [Assignments] CHECK CONSTRAINT [FK_Assignments_Roles]
-GO
-/****** Object: ForeignKey [FK_Parts_Contents] Script Date: 01/06/2012 15:02:53 ******/
-ALTER TABLE [Parts] WITH CHECK ADD CONSTRAINT [FK_Parts_Contents] FOREIGN KEY([ContentID])
-REFERENCES [Contents] ([ContentID])
-GO
-ALTER TABLE [Parts] CHECK CONSTRAINT [FK_Parts_Contents]
-GO
-/****** Object: ForeignKey [FK_Parts_Items] Script Date: 01/06/2012 15:02:53 ******/
-ALTER TABLE [Parts] WITH CHECK ADD CONSTRAINT [FK_Parts_Items] FOREIGN KEY([ItemID])
-REFERENCES [Items] ([ItemID])
-GO
-ALTER TABLE [Parts] CHECK CONSTRAINT [FK_Parts_Items]
-GO
-/****** Object: ForeignKey [FK_DocVersions_Formats] Script Date: 01/06/2012 15:02:53 ******/
-ALTER TABLE [DocVersions] WITH CHECK ADD CONSTRAINT [FK_DocVersions_Formats] FOREIGN KEY([FormatID])
-REFERENCES [Formats] ([FormatID])
-GO
-ALTER TABLE [DocVersions] CHECK CONSTRAINT [FK_DocVersions_Formats]
-GO
-/****** Object: ForeignKey [FK_DocVersions_Items] Script Date: 01/06/2012 15:02:53 ******/
-ALTER TABLE [DocVersions] WITH CHECK ADD CONSTRAINT [FK_DocVersions_Items] FOREIGN KEY([ItemID])
-REFERENCES [Items] ([ItemID])
-GO
-ALTER TABLE [DocVersions] CHECK CONSTRAINT [FK_DocVersions_Items]
-GO
-/****** Object: ForeignKey [FK_Versions_Folders] Script Date: 01/06/2012 15:02:53 ******/
-ALTER TABLE [DocVersions] WITH CHECK ADD CONSTRAINT [FK_Versions_Folders] FOREIGN KEY([FolderID])
-REFERENCES [Folders] ([FolderID])
-GO
-ALTER TABLE [DocVersions] CHECK CONSTRAINT [FK_Versions_Folders]
-GO
-/****** Object: ForeignKey [FK_TransitionsFromID_Contents] Script Date: 01/06/2012 15:02:53 ******/
-ALTER TABLE [Transitions] WITH CHECK ADD CONSTRAINT [FK_TransitionsFromID_Contents] FOREIGN KEY([FromID])
-REFERENCES [Contents] ([ContentID])
-GO
-ALTER TABLE [Transitions] CHECK CONSTRAINT [FK_TransitionsFromID_Contents]
-GO
-/****** Object: ForeignKey [FK_TransitionsRangeId_Items] Script Date: 01/06/2012 15:02:53 ******/
-ALTER TABLE [Transitions] WITH CHECK ADD CONSTRAINT [FK_TransitionsRangeId_Items] FOREIGN KEY([RangeID])
-REFERENCES [Items] ([ItemID])
-GO
-ALTER TABLE [Transitions] CHECK CONSTRAINT [FK_TransitionsRangeId_Items]
-GO
-/****** Object: ForeignKey [FK_TransitionsToId_Items] Script Date: 01/06/2012 15:02:53 ******/
-ALTER TABLE [Transitions] WITH CHECK ADD CONSTRAINT [FK_TransitionsToId_Items] FOREIGN KEY([ToID])
-REFERENCES [Items] ([ItemID])
-GO
-ALTER TABLE [Transitions] CHECK CONSTRAINT [FK_TransitionsToId_Items]
-GO
-/****** Object: ForeignKey [FK_Annotations_AnnotationTypes] Script Date: 01/06/2012 15:02:53 ******/
-ALTER TABLE [Annotations] WITH CHECK ADD CONSTRAINT [FK_Annotations_AnnotationTypes] FOREIGN KEY([TypeID])
-REFERENCES [AnnotationTypes] ([TypeID])
-GO
-ALTER TABLE [Annotations] CHECK CONSTRAINT [FK_Annotations_AnnotationTypes]
-GO
-/****** Object: ForeignKey [FK_Annotations_Items] Script Date: 01/06/2012 15:02:53 ******/
-ALTER TABLE [Annotations] WITH CHECK ADD CONSTRAINT [FK_Annotations_Items] FOREIGN KEY([ItemID])
-REFERENCES [Items] ([ItemID])
-GO
-ALTER TABLE [Annotations] CHECK CONSTRAINT [FK_Annotations_Items]
-GO
-/****** Object: ForeignKey [FK_Contents_Formats] Script Date: 01/06/2012 15:02:53 ******/
-ALTER TABLE [Contents] WITH CHECK ADD CONSTRAINT [FK_Contents_Formats] FOREIGN KEY([FormatID])
-REFERENCES [Formats] ([FormatID])
-GO
-ALTER TABLE [Contents] CHECK CONSTRAINT [FK_Contents_Formats]
-GO
-/****** Object: ForeignKey [FK_Items_Contents] Script Date: 01/06/2012 15:02:53 ******/
-ALTER TABLE [Items] WITH CHECK ADD CONSTRAINT [FK_Items_Contents] FOREIGN KEY([ContentID])
-REFERENCES [Contents] ([ContentID])
-GO
-ALTER TABLE [Items] CHECK CONSTRAINT [FK_Items_Contents]
-GO
-/****** Object: ForeignKey [FK_Items_Items] Script Date: 01/06/2012 15:02:53 ******/
-ALTER TABLE [Items] WITH CHECK ADD CONSTRAINT [FK_Items_Items] FOREIGN KEY([PreviousID])
-REFERENCES [Items] ([ItemID])
-GO
-ALTER TABLE [Items] CHECK CONSTRAINT [FK_Items_Items]
-GO
-/****** Object: ForeignKey [FK_Details_Contents] Script Date: 01/06/2012 15:02:53 ******/
-ALTER TABLE [Details] WITH CHECK ADD CONSTRAINT [FK_Details_Contents] FOREIGN KEY([ContentID])
-REFERENCES [Contents] ([ContentID])
-GO
-ALTER TABLE [Details] CHECK CONSTRAINT [FK_Details_Contents]
-GO
-/****** Object: ForeignKey [FK_ZContents_Contents] Script Date: 01/06/2012 15:02:53 ******/
-ALTER TABLE [ZContents] WITH CHECK ADD CONSTRAINT [FK_ZContents_Contents] FOREIGN KEY([ContentID])
-REFERENCES [Contents] ([ContentID])
-GO
-ALTER TABLE [ZContents] CHECK CONSTRAINT [FK_ZContents_Contents]
-GO
-/****** Object: ForeignKey [FK_Grids_Contents] Script Date: 01/06/2012 15:02:53 ******/
-ALTER TABLE [Grids] WITH CHECK ADD CONSTRAINT [FK_Grids_Contents] FOREIGN KEY([ContentID])
-REFERENCES [Contents] ([ContentID])
-GO
-ALTER TABLE [Grids] CHECK CONSTRAINT [FK_Grids_Contents]
-GO
-/****** Object: ForeignKey [FK_Images_Contents] Script Date: 01/06/2012 15:02:53 ******/
-ALTER TABLE [Images] WITH CHECK ADD CONSTRAINT [FK_Images_Contents] FOREIGN KEY([ContentID])
-REFERENCES [Contents] ([ContentID])
-GO
-ALTER TABLE [Images] CHECK CONSTRAINT [FK_Images_Contents]
-GO
-/****** Object: ForeignKey [FK_ZTransitions_Transitions] Script Date: 01/06/2012 15:02:53 ******/
-ALTER TABLE [ZTransitions] WITH CHECK ADD CONSTRAINT [FK_ZTransitions_Transitions] FOREIGN KEY([TransitionID])
-REFERENCES [Transitions] ([TransitionID])
-GO
-ALTER TABLE [ZTransitions] CHECK CONSTRAINT [FK_ZTransitions_Transitions]
-GO
-/****** Object: ForeignKey [FK_Permissions_Roles] Script Date: 01/06/2012 15:02:53 ******/
-ALTER TABLE [Permissions] WITH CHECK ADD CONSTRAINT [FK_Permissions_Roles] FOREIGN KEY([RID])
-REFERENCES [Roles] ([RID])
-GO
-ALTER TABLE [Permissions] CHECK CONSTRAINT [FK_Permissions_Roles]
-GO
---ALTER TABLE [dbo].[Applicabilities] WITH CHECK ADD CONSTRAINT [FK_Applicabilities_Items] FOREIGN KEY([ItemID])
---REFERENCES [dbo].[Items] ([ItemID])
---GO
---ALTER TABLE [dbo].[Applicabilities] CHECK CONSTRAINT [FK_Applicabilities_Items]
---GO
---ALTER TABLE [dbo].[Applicabilities] WITH CHECK ADD CONSTRAINT [FK_Applicabilities_Scopes] FOREIGN KEY([ScopeID])
---REFERENCES [dbo].[Scopes] ([ScopeID])
---GO
---ALTER TABLE [dbo].[Applicabilities] CHECK CONSTRAINT [FK_Applicabilities_Scopes]
---GO
-/****** Object: View [dbo].[vDuplicates1] Script Date: 01/06/2012 15:02:55 ******/
-SET ANSI_NULLS ON
-GO
-SET QUOTED_IDENTIFIER ON
-GO
-CREATE view [vDuplicates1] as
-SELECT Min(ContentID) MinID,Max(ContentID) MaxID,[Number],[Text],[Type],[FormatID],[Config],count(*) HowMany
- FROM [Contents]
-where contentid not in (select contentid from parts)
-group by [Number],[Text],[Type],[FormatID],[Config]
-having count(*) > 1 and type >= 20000
-GO
-/****** Object: View [dbo].[vDuplicates2] Script Date: 01/06/2012 15:02:55 ******/
-SET ANSI_NULLS ON
-GO
-SET QUOTED_IDENTIFIER ON
-GO
-create view [vDuplicates2] as
-SELECT Min(ContentID) MinID,Max(ContentID) MaxID,[Number],[Text],[Type],[FormatID],[Config],count(*) HowMany
- FROM [Contents]
-where contentid in (select contentid from parts)
-group by [Number],[Text],[Type],[FormatID],[Config]
-having count(*) > 1 and type >= 20000
-GO
-/****** Object: Trigger [trigAddFolder] Script Date: 01/06/2012 15:02:56 ******/
-SET ANSI_NULLS ON
-GO
-SET QUOTED_IDENTIFIER ON
-GO
--- =============================================
--- Author:
--- Create date:
--- Description:
--- =============================================
-CREATE TRIGGER [trigAddFolder]
- ON [Folders]
- AFTER INSERT
-AS
-BEGIN
-
- SET NOCOUNT ON;
- --select max(fld.ManualOrder) from folders fld join inserted ins on fld.ParentID = Ins.ParentID
- --Select ROW_NUMBER() OVER(Partition by [ParentID] Order BY FolderID) + (select max(ManualOrder) from folders where ParentID = Inserted.ParentID) as RowNumber,* from Inserted
- Update Fld set Fld.ManualOrder = Ins.RowNumber
- From Folders Fld join
- (Select ROW_NUMBER() OVER(Partition by [ParentID] Order BY FolderID)
-+ (select isnull(max(ManualOrder),0) from folders where ParentID =
-Inserted.ParentID) as RowNumber,* from Inserted)
- Ins on Ins.FolderID = Fld.FolderID
- Print 'Trigger Fired'
-END
-GO
-INSERT INTO [Connections] ([Name]) VALUES ('Bozo')
-INSERT INTO [Formats] ([Name],[Data]) VALUES ('Bozo',cast('' as xml))
-INSERT INTO [Folders] ([Name],[ShortName],[ManualOrder]) VALUES ('Bozo','Bozo',1)
-INSERT INTO [DocVersions] ([FolderID],[Name]) VALUES (1,'Bozo')
-INSERT INTO [Contents]([Number]) VALUES('Bozo')
-INSERT INTO [Items] ([ContentID]) VALUES (1)
-INSERT INTO [RODbs] ([ROName],[FolderPath],[DBConnectionString]) VALUES ('Bozo','Bozo','Bozo')
-INSERT INTO [ROFsts] ([RODbID],[ROLookup]) VALUES(1,Cast('Bozo' as varbinary))
-Insert Into [Transitions] ([FromID],[ToID],[RangeID]) VALUES (1,1,1)
-Insert Into [AnnotationTypes] ([Name]) VALUES ('Bozo')
-Insert Into [Annotations] ([ItemID],[TypeID]) VALUES (1,1)
-Insert Into [Groups] ([GroupName]) VALUES ('Bozo')
-Insert Into [Details] ([ContentID],[ItemType],[Text]) VALUES (1,1,'Bozo')
-Insert Into [Roles] ([Name],[Title]) VALUES ('Bozo','Bozo')
-Insert Into [Permissions] ([RID],[PermLevel],[VersionType],[PermValue]) VALUES (1,1,1,1)
-Insert Into [Scopes] ([Name]) VALUES ('Bozo')
---Insert Into [Applicabilities] ([ItemID],[ScopeID]) VALUES (1,1)
-Insert Into [Associations] ([VersionID],[ROFstID]) VALUES (1,1)
-INSERT INTO [Documents] ([LibTitle]) VALUES ('Bozo')
-Insert Into [DROUsages] ([DocID],[ROID],[RODbID]) VALUES (1,'Bozo',1)
-Insert Into [ROImages] ([RODbID],[FileName],[Content]) VALUES (1,'Bozo',cast ('Bozo' as varbinary))
-Insert Into [RoUsages] ([ContentID],[ROID],[RODbID]) VALUES (1,1,1)
-Insert Into [Figures] ([ROFstID],[ImageID]) VALUES (1,1)
-INSERT INTO [Users] ([UserID]) VALUES ('Bozo')
-Insert Into [Memberships] ([UID],[GID]) VALUES (1,1)
-Insert Into [Assignments] ([GID],[RID],[FolderID]) VALUES (1,1,1)
-GO
-sp_changedbowner sa
-GO
-USE MASTER
-GO
diff --git a/PROMS/DataLoader/ClassDiagram1.cd b/PROMS/DataLoader/ClassDiagram1.cd
deleted file mode 100644
index 0519ecba..00000000
--- a/PROMS/DataLoader/ClassDiagram1.cd
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/PROMS/DataLoader/ConfigInfo.cs b/PROMS/DataLoader/ConfigInfo.cs
deleted file mode 100644
index 51fb8122..00000000
--- a/PROMS/DataLoader/ConfigInfo.cs
+++ /dev/null
@@ -1,145 +0,0 @@
-// ========================================================================
-// 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.Collections.Generic;
-using System.Text;
-using System.Xml;
-
-namespace DataLoader
-{
- class ConfigInfo
- {
- private XmlDocument xmldoc;
- public ConfigInfo(string xml)
- {
- xmldoc = new XmlDocument();
- if (xml == null)
- xmldoc.LoadXml("");
- else
- xmldoc.LoadXml(xml);
- }
-
- public ConfigInfo(string xml, string ename, string aname, string avalue)
- {
- xmldoc = new XmlDocument();
- if (xml == null)
- xmldoc.LoadXml("");
- else
- xmldoc.LoadXml(xml);
- AddItem(ename, aname.Replace(' ','_'), avalue);
- }
- public bool AddItem(string ename, string aname, string avalue)
- {
- if (aname != null && aname != "")
- {
- //if (xmldoc == null)
- //{
- // xmldoc = new XmlDocument();
- // xmldoc.AppendChild(xmldoc.CreateElement("ConfigInfo"));
- //}
- // see if ename element exists, use it to add attributes,
- // otherwise, create the element.
-
- XmlNode nxml = null;
- XmlNodeList xl = xmldoc.DocumentElement.SelectNodes(string.Format("//{0}", ename));
- switch (xl.Count)
- {
- case 0: // No nodes found
- nxml = xmldoc.DocumentElement.AppendChild(xmldoc.CreateElement(ename));
- break;
- default: // Found the node
- nxml = xl[0];
- if (nxml.GetType() != typeof(XmlElement))
- {
- frmLoader._MyLog.ErrorFormat("Invalid xml element type when migrating config data - element = {0}, name = {1} , value = {2}", ename, aname, avalue);
- return false;
- }
- break;
- }
- XmlAttribute xa = nxml.Attributes.Append(xmldoc.CreateAttribute(aname.Replace(' ', '_')));
- //added by jcb 20131216
- //aname = SanitizeXmlString(aname);
- //XmlAttribute xa = nxml.Attributes.Append(xmldoc.CreateAttribute(aname));
- //end added by jcb 20131216
- xa.Value = avalue;
- return true;
- }
- return false;
- }
-
- //added by jcb 20131216
- public string SanitizeXmlString(string xml)
- {
- if (xml == null)
- throw new ArgumentNullException("xml");
- xml = xml.Replace(' ', '_').Replace("/", "_fslash_").Replace("(", "_lparen_").Replace((char)0xA0, '_').Replace((char)0x20, '_').Replace(":", "_colon_");
- StringBuilder buffer = new StringBuilder(xml.Length);
- foreach (char c in xml)
- {
- if (IsLegalXmlChar(c))
- buffer.Append(c);
- }
- return buffer.ToString();
- }
-
- ///
- /// Whether a given character is allowed by XML 1.0.
- ///
- public bool IsLegalXmlChar(int character)
- {
- return
- (
- character == 0x9 /* == '\t' == 9 */ ||
- character == 0xA /* == '\n' == 10 */ ||
- character == 0xD /* == '\r' == 13 */ ||
- (character >= 0x20 && character <= 0xD7FF) ||
- (character >= 0xE000 && character <= 0xFFFD) ||
- (character >= 0x10000 && character <= 0x10FFFF)
- );
- }
- //end added by jcb 20131216
-
- public int ItemCount
- {
- get { return xmldoc.DocumentElement.ChildNodes.Count; }
- }
-
- public override string ToString()
- {
- if (xmldoc != null) return xmldoc.InnerXml;
- else return null;
- }
- public void AddSlaveNode(int index)
- {
- XmlElement slaves = xmldoc.SelectSingleNode("Config/Slaves") as XmlElement;
- if (slaves == null)
- {
- slaves = xmldoc.CreateElement("Slaves");
- xmldoc.DocumentElement.AppendChild(slaves);
- }
- XmlElement slave = xmldoc.CreateElement("Slave");
- XmlAttribute xa = xmldoc.CreateAttribute("index");
- xa.InnerText = index.ToString();
- slave.Attributes.Append(xa);
- slaves.AppendChild(slave);
- }
- public void AddSlaveItem(int index, string aname, string avalue)
- {
- string srch = "Config/Slaves/Slave[@index='" + index.ToString() + "']";
- XmlElement slave = xmldoc.SelectSingleNode(srch) as XmlElement;
- if (slave != null)
- {
- XmlAttribute xa = xmldoc.CreateAttribute(aname);
- xa.InnerText = avalue;
- slave.Attributes.Append(xa);
- }
- }
- }
-}
diff --git a/PROMS/DataLoader/ConfigInfo.cs.bak b/PROMS/DataLoader/ConfigInfo.cs.bak
deleted file mode 100644
index 3685ece5..00000000
--- a/PROMS/DataLoader/ConfigInfo.cs.bak
+++ /dev/null
@@ -1,144 +0,0 @@
-// ========================================================================
-// 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.Collections.Generic;
-using System.Text;
-using System.Xml;
-
-namespace DataLoader
-{
- class ConfigInfo
- {
- private XmlDocument xmldoc;
- public ConfigInfo(string xml)
- {
- xmldoc = new XmlDocument();
- if (xml == null)
- xmldoc.LoadXml("");
- else
- xmldoc.LoadXml(xml);
- }
-
- public ConfigInfo(string xml, string ename, string aname, string avalue)
- {
- xmldoc = new XmlDocument();
- if (xml == null)
- xmldoc.LoadXml("");
- else
- xmldoc.LoadXml(xml);
- AddItem(ename, aname.Replace(' ','_'), avalue);
- }
- public bool AddItem(string ename, string aname, string avalue)
- {
- if (aname != null && aname != "")
- {
- //if (xmldoc == null)
- //{
- // xmldoc = new XmlDocument();
- // xmldoc.AppendChild(xmldoc.CreateElement("ConfigInfo"));
- //}
- // see if ename element exists, use it to add attributes,
- // otherwise, create the element.
-
- XmlNode nxml = null;
- XmlNodeList xl = xmldoc.DocumentElement.SelectNodes(string.Format("//{0}", ename));
- switch (xl.Count)
- {
- case 0: // No nodes found
- nxml = xmldoc.DocumentElement.AppendChild(xmldoc.CreateElement(ename));
- break;
- default: // Found the node
- nxml = xl[0];
- if (nxml.GetType() != typeof(XmlElement))
- {
- frmLoader._MyLog.ErrorFormat("Invalid xml element type when migrating config data - element = {0}, name = {1} , value = {2}", ename, aname, avalue);
- return false;
- }
- break;
- }
- //added by jcb 20131216
- aname = SanitizeXmlString(aname);
- XmlAttribute xa = nxml.Attributes.Append(xmldoc.CreateAttribute(aname));
- //end added by jcb 20131216
- xa.Value = avalue;
- return true;
- }
- return false;
- }
-
- //added by jcb 20131216
- public string SanitizeXmlString(string xml)
- {
- if (xml == null)
- throw new ArgumentNullException("xml");
- xml = xml.Replace(' ', '_').Replace("/", "_fslash_").Replace("(", "_lparen_").Replace((char)0xA0, '_').Replace((char)0x20, '_').Replace(":", "_colon_");
- StringBuilder buffer = new StringBuilder(xml.Length);
- foreach (char c in xml)
- {
- if (IsLegalXmlChar(c))
- buffer.Append(c);
- }
- return buffer.ToString();
- }
-
- ///
- /// Whether a given character is allowed by XML 1.0.
- ///
- public bool IsLegalXmlChar(int character)
- {
- return
- (
- character == 0x9 /* == '\t' == 9 */ ||
- character == 0xA /* == '\n' == 10 */ ||
- character == 0xD /* == '\r' == 13 */ ||
- (character >= 0x20 && character <= 0xD7FF) ||
- (character >= 0xE000 && character <= 0xFFFD) ||
- (character >= 0x10000 && character <= 0x10FFFF)
- );
- }
- //end added by jcb 20131216
-
- public int ItemCount
- {
- get { return xmldoc.DocumentElement.ChildNodes.Count; }
- }
-
- public override string ToString()
- {
- if (xmldoc != null) return xmldoc.InnerXml;
- else return null;
- }
- public void AddSlaveNode(int index)
- {
- XmlElement slaves = xmldoc.SelectSingleNode("Config/Slaves") as XmlElement;
- if (slaves == null)
- {
- slaves = xmldoc.CreateElement("Slaves");
- xmldoc.DocumentElement.AppendChild(slaves);
- }
- XmlElement slave = xmldoc.CreateElement("Slave");
- XmlAttribute xa = xmldoc.CreateAttribute("index");
- xa.InnerText = index.ToString();
- slave.Attributes.Append(xa);
- slaves.AppendChild(slave);
- }
- public void AddSlaveItem(int index, string aname, string avalue)
- {
- string srch = "Config/Slaves/Slave[@index='" + index.ToString() + "']";
- XmlElement slave = xmldoc.SelectSingleNode(srch) as XmlElement;
- if (slave != null)
- {
- XmlAttribute xa = xmldoc.CreateAttribute(aname);
- xa.InnerText = avalue;
- slave.Attributes.Append(xa);
- }
- }
- }
-}
diff --git a/PROMS/DataLoader/ConversionRTBProblems.cs b/PROMS/DataLoader/ConversionRTBProblems.cs
deleted file mode 100644
index 7866460e..00000000
--- a/PROMS/DataLoader/ConversionRTBProblems.cs
+++ /dev/null
@@ -1,203 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Xml;
-using System.Xml.Serialization;
-using System.Xml.Schema;
-using System.IO;
-using VEPROMS.CSLA.Library;
-
-namespace DataLoader
-{
- [XmlRoot("Proms2010Print")]
- //[Serializable()]
- public class ConversionRTBProblems
- {
- private RTBProblems _RTBProblems;
-
- public RTBProblems RTBProblems
- {
- get
- {
- if (_RTBProblems == null) _RTBProblems = new RTBProblems();
- return _RTBProblems;
- }
- set { _RTBProblems = value; }
- }
- public void Save(string fileName)
- {
- XmlSerializer.WriteFile(this, fileName);
- }
- public static ConversionRTBProblems LoadProblems(string fileName)
- {
- return XmlSerializer.ReadFile(fileName);
- }
- public void Add(int itemID, int contentID, string originalRTF, string oldRTF, string stepRTF, string newRTF, string stepPath)
- {
- _RTBProblems.Add(itemID, contentID, originalRTF, oldRTF, stepRTF, newRTF, stepPath);
- }
- //public void Add(int itemID, int contentID, string originalRTF, string oldRTF, string stepRTF, string newRTF, string stepPath, ItemInfo iteminfo)
- //{
- // _RTBProblems.Add(itemID, contentID, originalRTF, oldRTF, stepRTF, newRTF, stepPath, iteminfo);
- //}
- }
- public class RTBProblems : List
- {
- //public void Add(int itemID, int contentID, string originalRTF, string oldRTF, string stepRTF, string newRTF, string stepPath, ItemInfo iteminfo)
- public void Add(int itemID, int contentID, string originalRTF, string oldRTF, string stepRTF, string newRTF, string stepPath)
- {
- base.Add(new RTBProblem(itemID, contentID, originalRTF, oldRTF, stepRTF, newRTF, stepPath));
- //base.Add(new RTBProblem(itemID, contentID, originalRTF, oldRTF, stepRTF, newRTF, stepPath, iteminfo));
- }
- }
- public class RTBProblem
- {
- public RTBProblem()
- {
- }
- //public RTBProblem(int itemID, int contentID, string originalRTF, string oldRTF, string stepRTF, string newRTF, string stepPath, ItemInfo iteminfo)
- public RTBProblem(int itemID, int contentID, string originalRTF, string oldRTF, string stepRTF, string newRTF, string stepPath)
- {
- _ItemID = itemID;
- _ContentID = contentID;
- _OldRTF = oldRTF;
- _NewRTF = newRTF;
- _StepPath = stepPath;
- _OriginalRTF = originalRTF;
- _StepRtf = stepRTF;
- //_itemInfo = iteminfo;
- }
- private int _ItemID;
- [XmlAttribute("ItemID")]
- public int ItemID
- {
- get { return _ItemID; }
- set { _ItemID = value; }
- }
- private int _ContentID;
- [XmlAttribute("ContentID")]
- public int ContentID
- {
- get { return _ContentID; }
- set { _ContentID = value; }
- }
- private string _OriginalRTF;
- [XmlAttribute("OriginalRTF")]
- public string OriginalRTF
- {
- get { return _OriginalRTF; }
- set { _OriginalRTF = value; }
- }
- private string _OldRTF;
- [XmlAttribute("OldRTF")]
- public string OldRTF
- {
- get { return _OldRTF; }
- set { _OldRTF = value; }
- }
- private string _StepRtf;
- [XmlAttribute("StepRTF")]
- public string StepRtf
- {
- get { return _StepRtf; }
- set { _StepRtf = value; }
- }
- private string _NewRTF;
- [XmlAttribute("NewRTF")]
- public string NewRTF
- {
- get { return _NewRTF; }
- set { _NewRTF = value; }
- }
- private string _StepPath;
- [XmlAttribute("StepPath")]
- public string StepPath
- {
- get { return _StepPath; }
- set { _StepPath = value; }
- }
- private string _Comparison;
- [XmlIgnore]
- public string Comparison
- {
- get
- {
- if (_Comparison == null)
- _Comparison = GetComparison(_OldRTF, _NewRTF);
- return _Comparison;
- }
- }
- private string _StripRTF;
- [XmlIgnore]
- public string StripRTF
- {
- get
- {
- if (_StripRTF == null)
- _StripRTF = GetStrip(_StepRtf);
- return _StripRTF;
- }
- set { _StripRTF = value; }
- }
-
- //private ItemInfo _itemInfo;
- //[XmlIgnore]
- //public ItemInfo ItemInfo
- //{
- // get { return _itemInfo; }
- // set { _itemInfo = value; }
- //}
-
- private string GetStrip(string _StepRtf)
- {
- string rttval = DisplayText.StaticStripRtfCommands(_StepRtf);
- //string rttval = Volian.Controls.Library.DisplayText.StaticStripRtfCommands(_StepRtf, _itemInfo);
- //return rttval.Replace(@"\u8209?", "-");
- return rttval;
- }
- private string GetComparison(string str1, string str2)
- {
- if (str1 == str2) return str1;
- int endMatch = 0;
- int l1 = str1.Length;
- int l2 = str2.Length;
- int min = l1 > l2 ? l2 : l1;
- int startMatch = min;
- for (int i = 0; i < min; i++)
- if (str1[i] != str2[i])
- {
- startMatch = i;
- break;
- }
- min = min - startMatch;
- endMatch = min;
- for (int i = 1; i < min; i++)
- if (str1[l1 - i] != str2[l2 - i])
- {
- endMatch = i - 1;
- break;
- }
- string prefix = str1.Substring(0, startMatch);
- string part1 = str1.Substring(startMatch, l1 - (startMatch + endMatch));
- string part2 = str2.Substring(startMatch, l2 - (startMatch + endMatch));
- string suffix = str1.Substring(l1 - endMatch, endMatch);
- return prefix + "\r\n<<<" + part1 + "|||" + part2 + ">>>\r\n" + suffix;
- }
- private ItemInfo _MyItem;
- [XmlIgnore]
- public ItemInfo MyItem
- {
- get
- {
- if (_MyItem == null)
- _MyItem = ItemInfo.Get(_ItemID);
- return _MyItem;
- }
- }
- public override string ToString()
- {
- return MyItem.ToString();
- }
- }
-
-}
diff --git a/PROMS/DataLoader/CurSet.cs b/PROMS/DataLoader/CurSet.cs
deleted file mode 100644
index efb380ad..00000000
--- a/PROMS/DataLoader/CurSet.cs
+++ /dev/null
@@ -1,127 +0,0 @@
-// ========================================================================
-// 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.IO;
-using System.Collections;
-using System.Text;
-using System.Windows.Forms;
-using System.Xml;
-using System.Xml.Serialization;
-using VEPROMS.CSLA.Library;
-
-namespace Utils
-{
- ///
- /// Summary description for CurSet.
- ///
- public class CurSet
- {
- private int NUMCBTEXTYPE = 5; // number of changebar text types.
- public string PathName;
- private string DefaultPlantFmt;
-
- public CurSet(string pname)
- {
- PathName = pname;
- DefaultPlantFmt = null;
- }
-
- private string ReadTheString(BinaryReader bw, int maxlen)
- {
- StringBuilder retStr = new StringBuilder(maxlen+1);
- // read a series of characters until a null is found.
- char ac;
- bool done = false;
- while(done==false)
- {
- ac = bw.ReadChar();
- if (ac=='\0')
- done=true;
- else
- retStr.Append(ac);
- }
- return retStr.ToString();
- }
-
- public FolderConfig Convert(FolderConfig cfg)
- {
- BinaryReader br;
- ArrayList DefaultUserCBMsg = new ArrayList(2);
- FileStream fs;
- FileInfo fi = new FileInfo(PathName);
- try
- {
- fs = fi.Open(FileMode.Open, FileAccess.Read, FileShare.ReadWrite );
- br = new BinaryReader(fs,System.Text.ASCIIEncoding.ASCII);
- }
- catch (Exception e)
- {
- DataLoader.frmLoader._MyLog.ErrorFormat("Error migrating {0} Curset.dat, error = {1}", PathName, e.Message);
- return cfg;
- }
-
- try
- {
- sbyte tmpsbyte;
- string tmpstring;
- tmpsbyte=br.ReadSByte(); // DefaultDestination not used
-
- // the next byte has three settings embedded in it, the type of change
- // bar (Print_ChangeBar), the change bar location and its text.
- tmpsbyte= br.ReadSByte();
- cfg.Print_ChangeBar = (PrintChangeBar)((int)tmpsbyte > 2 ? 3 : (int)tmpsbyte);
- if (tmpsbyte > 2)
- {
- cfg.Print_ChangeBarLoc = (PrintChangeBarLoc)((tmpsbyte - 3) / NUMCBTEXTYPE);
- int ts = (tmpsbyte - 3) % NUMCBTEXTYPE;
- cfg.Print_ChangeBarText = (PrintChangeBarText)((tmpsbyte - 3) % NUMCBTEXTYPE);
- }
- else
- {
- cfg.Print_ChangeBarLoc = PrintChangeBarLoc.WithText;
- cfg.Print_ChangeBarText = PrintChangeBarText.DateChgID;
- }
- cfg.Print_NumCopies=br.ReadSByte();
- cfg.Print_Pagination=(PrintPagination) br.ReadSByte();
- tmpstring = ReadTheString(br,4); // DefaultPrinter not used
- cfg.Format_Plant = ReadTheString(br,10);
- DefaultPlantFmt = cfg.Format_Plant;
- tmpstring = ReadTheString(br, 128); // DefaultDestFName not used
- tmpsbyte = br.ReadSByte(); // DefaultPlotterType not used
- tmpsbyte = br.ReadSByte(); // DefaultPlotterPort not used
- tmpsbyte = br.ReadSByte(); // DefaultCIEType not used.
- for (int i=0;i<8;i++) // DefPenColors[8] not used
- tmpsbyte = br.ReadSByte();
- cfg.Print_Watermark = (PrintWatermark)br.ReadSByte();
- cfg.Print_UserCBMess1 = ReadTheString(br, 10);
- cfg.Print_UserCBMess2 = ReadTheString(br, 10);
- tmpsbyte = br.ReadSByte(); // DontPrintStatusTree not used
- cfg.Print_UserFormat = ReadTheString(br, 10);
- //tmpsbyte = br.ReadSByte();
- //cfg.Print_Duplex = tmpsbyte == 0 ? true : false;
- if (cfg.Print_UserFormat.Trim() != string.Empty)
- DefaultPlantFmt += " " + cfg.Print_UserFormat;
- br.Close();
- }
- catch(Exception e)
- {
- if(br!=null) br.Close();
- DataLoader.frmLoader._MyLog.ErrorFormat("Error migrating {0} Curset.dat, error = {1}", PathName, e.Message);
- }
- fs.Close();
- return cfg;
- }
- public string GetDefFmt()
- {
- return DefaultPlantFmt;
- }
- }
-}
diff --git a/PROMS/DataLoader/DataLoader.csproj b/PROMS/DataLoader/DataLoader.csproj
deleted file mode 100644
index 920906d7..00000000
--- a/PROMS/DataLoader/DataLoader.csproj
+++ /dev/null
@@ -1,259 +0,0 @@
-
-
-
- Debug
- AnyCPU
- 8.0.50727
- 2.0
- {8E239A2B-B38C-4CD5-BA0D-A41A88BD2AEE}
- WinExe
- Properties
- DataLoader
- DataLoader
- SAK
- SAK
- SAK
- SAK
- v3.5
-
-
-
-
- 2.0
-
-
-
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
- x86
-
-
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
-
-
-
- False
-
-
- False
- ..\csla20cs-2.1.4-070223\csla20cs\csla20cs\Csla\bin\Debug\Csla.dll
-
-
- ..\..\Proms3rdPartyLibraries\Ionic\Ionic.Zip.dll
-
-
- False
- bin\Debug\log4net.dll
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Form
-
-
- dlgExportImport.cs
-
-
-
-
-
-
-
-
- Form
-
-
- frmCntTkn.cs
-
-
- Form
-
-
- frmErrors.cs
-
-
- Form
-
-
- frmLoader.cs
-
-
- Form
-
-
- frmPG.cs
-
-
- Form
-
-
- GroupProp.cs
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- dlgExportImport.cs
- Designer
-
-
- frmCntTkn.cs
- Designer
-
-
- frmErrors.cs
- Designer
-
-
- Designer
- frmLoader.cs
-
-
- frmPG.cs
- Designer
-
-
- Designer
- GroupProp.cs
-
-
-
- ResXFileCodeGenerator
- Resources.Designer.cs
- Designer
-
-
- True
- Resources.resx
- True
-
-
-
- PreserveNewest
-
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- SettingsSingleFileGenerator
- Settings.Designer.cs
-
-
- True
- Settings.settings
- True
-
-
-
-
- Component
-
-
- RichTextBox41.cs
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {70F23722-19A3-4AC1-A900-55831C945786}
- LBWordLibrary
-
-
- {41B2D786-1C03-4C1A-9247-DA9F0D6B06D5}
- VEPROMS.CSLA.Library
-
-
- {AEEE9FD1-6892-45E2-A67E-418C06D46FF9}
- Volian.Base.Library
-
-
- {8556527C-6615-487F-8AF7-22EBC3EF0268}
- Volian.Controls.Library
-
-
- {62314B9C-DA84-4037-8B68-AA18C1F641F5}
- Volian.Utils.Library
-
-
-
-
- PreserveNewest
-
-
-
-
-
\ No newline at end of file
diff --git a/PROMS/DataLoader/DataLoader.sln b/PROMS/DataLoader/DataLoader.sln
deleted file mode 100644
index 496950ba..00000000
--- a/PROMS/DataLoader/DataLoader.sln
+++ /dev/null
@@ -1,153 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2013
-VisualStudioVersion = 12.0.30723.0
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataLoader", "DataLoader.csproj", "{8E239A2B-B38C-4CD5-BA0D-A41A88BD2AEE}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volian.Utils.Library", "..\Volian.Utils.Library\Volian.Utils.Library.csproj", "{62314B9C-DA84-4037-8B68-AA18C1F641F5}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VEPROMS.CSLA.Library", "..\VEPROMS.CSLA.Library\VEPROMS.CSLA.Library.csproj", "{41B2D786-1C03-4C1A-9247-DA9F0D6B06D5}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EPocalipse.IFilter", "..\EPocalipse.IFilter\EPocalipse.IFilter.csproj", "{400462CE-40B3-498F-B95A-B1D2AE679359}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LBWordLibrary", "..\LBWordLibrary\LBWordLibrary.csproj", "{70F23722-19A3-4AC1-A900-55831C945786}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volian.Controls.Library", "..\Volian.Controls.Library\Volian.Controls.Library.csproj", "{8556527C-6615-487F-8AF7-22EBC3EF0268}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volian.Base.Library", "..\Volian.Base.Library\Volian.Base.Library.csproj", "{AEEE9FD1-6892-45E2-A67E-418C06D46FF9}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XYPlots", "..\XYPlots\XYPlots.csproj", "{04E168D0-9CC7-43D9-A9F1-93E481EA86A3}"
-EndProject
-Global
- GlobalSection(SourceCodeControl) = preSolution
- SccNumberOfProjects = 7
- SccProjectUniqueName0 = ..\\Volian.Utils.Library\\Volian.Utils.Library.csproj
- SccProjectName0 = \u0022$/PROMS/Volian.Utils.Library\u0022,\u0020DICAAAAA
- SccLocalPath0 = ..\\Volian.Utils.Library
- SccProvider0 = MSSCCI:Microsoft\u0020Visual\u0020SourceSafe
- SccProjectUniqueName1 = ..\\VEPROMS.CSLA.Library\\VEPROMS.CSLA.Library.csproj
- SccProjectName1 = \u0022$/PROMS/VEPROMS.CSLA.Library\u0022,\u0020TPBAAAAA
- SccLocalPath1 = ..\\VEPROMS.CSLA.Library
- SccProvider1 = MSSCCI:Microsoft\u0020Visual\u0020SourceSafe
- SccProjectUniqueName2 = DataLoader.csproj
- SccProjectName2 = \u0022$/PROMS/DataLoader\u0022,\u0020IIAAAAAA
- SccLocalPath2 = .
- SccProvider2 = MSSCCI:Microsoft\u0020Visual\u0020SourceSafe
- SccProjectUniqueName3 = ..\\Volian.Controls.Library\\Volian.Controls.Library.csproj
- SccProjectName3 = \u0022$/PROMS/Volian.Controls.Library\u0022,\u0020TVBAAAAA
- SccLocalPath3 = ..\\Volian.Controls.Library
- SccProvider3 = MSSCCI:Microsoft\u0020Visual\u0020SourceSafe
- SccProjectUniqueName4 = ..\\LBWordLibrary\\LBWordLibrary.csproj
- SccProjectName4 = \u0022$/PROMS/LBWordLibrary\u0022,\u0020QUDAAAAA
- SccLocalPath4 = ..\\LBWordLibrary
- SccProvider4 = MSSCCI:Microsoft\u0020Visual\u0020SourceSafe
- SccProjectUniqueName5 = ..\\Volian.Base.Library\\Volian.Base.Library.csproj
- SccProjectName5 = \u0022$/PROMS/Volian.Base.Library\u0022,\u0020QJEAAAAA
- SccLocalPath5 = ..\\Volian.Base.Library
- SccProvider5 = MSSCCI:Microsoft\u0020Visual\u0020SourceSafe
- SccProjectUniqueName6 = ..\\XYPlots\\XYPlots.csproj
- SccProjectName6 = \u0022$/PROMS/XYPlots\u0022,\u0020BRDAAAAA
- SccLocalPath6 = ..\\XYPlots
- SccProvider6 = MSSCCI:Microsoft\u0020Visual\u0020SourceSafe
- EndGlobalSection
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Debug|x86 = Debug|x86
- Demo|Any CPU = Demo|Any CPU
- Demo|x86 = Demo|x86
- Release|Any CPU = Release|Any CPU
- Release|x86 = Release|x86
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {8E239A2B-B38C-4CD5-BA0D-A41A88BD2AEE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {8E239A2B-B38C-4CD5-BA0D-A41A88BD2AEE}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {8E239A2B-B38C-4CD5-BA0D-A41A88BD2AEE}.Debug|x86.ActiveCfg = Debug|Any CPU
- {8E239A2B-B38C-4CD5-BA0D-A41A88BD2AEE}.Demo|Any CPU.ActiveCfg = Debug|Any CPU
- {8E239A2B-B38C-4CD5-BA0D-A41A88BD2AEE}.Demo|Any CPU.Build.0 = Debug|Any CPU
- {8E239A2B-B38C-4CD5-BA0D-A41A88BD2AEE}.Demo|x86.ActiveCfg = Debug|Any CPU
- {8E239A2B-B38C-4CD5-BA0D-A41A88BD2AEE}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {8E239A2B-B38C-4CD5-BA0D-A41A88BD2AEE}.Release|Any CPU.Build.0 = Release|Any CPU
- {8E239A2B-B38C-4CD5-BA0D-A41A88BD2AEE}.Release|x86.ActiveCfg = Release|Any CPU
- {62314B9C-DA84-4037-8B68-AA18C1F641F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {62314B9C-DA84-4037-8B68-AA18C1F641F5}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {62314B9C-DA84-4037-8B68-AA18C1F641F5}.Debug|x86.ActiveCfg = Debug|Any CPU
- {62314B9C-DA84-4037-8B68-AA18C1F641F5}.Demo|Any CPU.ActiveCfg = Debug|Any CPU
- {62314B9C-DA84-4037-8B68-AA18C1F641F5}.Demo|Any CPU.Build.0 = Debug|Any CPU
- {62314B9C-DA84-4037-8B68-AA18C1F641F5}.Demo|x86.ActiveCfg = Debug|Any CPU
- {62314B9C-DA84-4037-8B68-AA18C1F641F5}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {62314B9C-DA84-4037-8B68-AA18C1F641F5}.Release|Any CPU.Build.0 = Release|Any CPU
- {62314B9C-DA84-4037-8B68-AA18C1F641F5}.Release|x86.ActiveCfg = Release|Any CPU
- {41B2D786-1C03-4C1A-9247-DA9F0D6B06D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {41B2D786-1C03-4C1A-9247-DA9F0D6B06D5}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {41B2D786-1C03-4C1A-9247-DA9F0D6B06D5}.Debug|x86.ActiveCfg = Debug|x86
- {41B2D786-1C03-4C1A-9247-DA9F0D6B06D5}.Debug|x86.Build.0 = Debug|x86
- {41B2D786-1C03-4C1A-9247-DA9F0D6B06D5}.Demo|Any CPU.ActiveCfg = Demo|Any CPU
- {41B2D786-1C03-4C1A-9247-DA9F0D6B06D5}.Demo|Any CPU.Build.0 = Demo|Any CPU
- {41B2D786-1C03-4C1A-9247-DA9F0D6B06D5}.Demo|x86.ActiveCfg = Demo|x86
- {41B2D786-1C03-4C1A-9247-DA9F0D6B06D5}.Demo|x86.Build.0 = Demo|x86
- {41B2D786-1C03-4C1A-9247-DA9F0D6B06D5}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {41B2D786-1C03-4C1A-9247-DA9F0D6B06D5}.Release|Any CPU.Build.0 = Release|Any CPU
- {41B2D786-1C03-4C1A-9247-DA9F0D6B06D5}.Release|x86.ActiveCfg = Release|x86
- {41B2D786-1C03-4C1A-9247-DA9F0D6B06D5}.Release|x86.Build.0 = Release|x86
- {400462CE-40B3-498F-B95A-B1D2AE679359}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {400462CE-40B3-498F-B95A-B1D2AE679359}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {400462CE-40B3-498F-B95A-B1D2AE679359}.Debug|x86.ActiveCfg = Debug|x86
- {400462CE-40B3-498F-B95A-B1D2AE679359}.Debug|x86.Build.0 = Debug|x86
- {400462CE-40B3-498F-B95A-B1D2AE679359}.Demo|Any CPU.ActiveCfg = Demo|Any CPU
- {400462CE-40B3-498F-B95A-B1D2AE679359}.Demo|Any CPU.Build.0 = Demo|Any CPU
- {400462CE-40B3-498F-B95A-B1D2AE679359}.Demo|x86.ActiveCfg = Demo|x86
- {400462CE-40B3-498F-B95A-B1D2AE679359}.Demo|x86.Build.0 = Demo|x86
- {400462CE-40B3-498F-B95A-B1D2AE679359}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {400462CE-40B3-498F-B95A-B1D2AE679359}.Release|Any CPU.Build.0 = Release|Any CPU
- {400462CE-40B3-498F-B95A-B1D2AE679359}.Release|x86.ActiveCfg = Release|x86
- {400462CE-40B3-498F-B95A-B1D2AE679359}.Release|x86.Build.0 = Release|x86
- {70F23722-19A3-4AC1-A900-55831C945786}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {70F23722-19A3-4AC1-A900-55831C945786}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {70F23722-19A3-4AC1-A900-55831C945786}.Debug|x86.ActiveCfg = Debug|Any CPU
- {70F23722-19A3-4AC1-A900-55831C945786}.Demo|Any CPU.ActiveCfg = Debug|Any CPU
- {70F23722-19A3-4AC1-A900-55831C945786}.Demo|Any CPU.Build.0 = Debug|Any CPU
- {70F23722-19A3-4AC1-A900-55831C945786}.Demo|x86.ActiveCfg = Debug|Any CPU
- {70F23722-19A3-4AC1-A900-55831C945786}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {70F23722-19A3-4AC1-A900-55831C945786}.Release|Any CPU.Build.0 = Release|Any CPU
- {70F23722-19A3-4AC1-A900-55831C945786}.Release|x86.ActiveCfg = Release|Any CPU
- {8556527C-6615-487F-8AF7-22EBC3EF0268}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {8556527C-6615-487F-8AF7-22EBC3EF0268}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {8556527C-6615-487F-8AF7-22EBC3EF0268}.Debug|x86.ActiveCfg = Debug|x86
- {8556527C-6615-487F-8AF7-22EBC3EF0268}.Debug|x86.Build.0 = Debug|x86
- {8556527C-6615-487F-8AF7-22EBC3EF0268}.Demo|Any CPU.ActiveCfg = Demo|Any CPU
- {8556527C-6615-487F-8AF7-22EBC3EF0268}.Demo|Any CPU.Build.0 = Demo|Any CPU
- {8556527C-6615-487F-8AF7-22EBC3EF0268}.Demo|x86.ActiveCfg = Demo|x86
- {8556527C-6615-487F-8AF7-22EBC3EF0268}.Demo|x86.Build.0 = Demo|x86
- {8556527C-6615-487F-8AF7-22EBC3EF0268}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {8556527C-6615-487F-8AF7-22EBC3EF0268}.Release|Any CPU.Build.0 = Release|Any CPU
- {8556527C-6615-487F-8AF7-22EBC3EF0268}.Release|x86.ActiveCfg = Release|x86
- {8556527C-6615-487F-8AF7-22EBC3EF0268}.Release|x86.Build.0 = Release|x86
- {AEEE9FD1-6892-45E2-A67E-418C06D46FF9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {AEEE9FD1-6892-45E2-A67E-418C06D46FF9}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {AEEE9FD1-6892-45E2-A67E-418C06D46FF9}.Debug|x86.ActiveCfg = Debug|x86
- {AEEE9FD1-6892-45E2-A67E-418C06D46FF9}.Debug|x86.Build.0 = Debug|x86
- {AEEE9FD1-6892-45E2-A67E-418C06D46FF9}.Demo|Any CPU.ActiveCfg = Debug|x86
- {AEEE9FD1-6892-45E2-A67E-418C06D46FF9}.Demo|x86.ActiveCfg = Debug|x86
- {AEEE9FD1-6892-45E2-A67E-418C06D46FF9}.Demo|x86.Build.0 = Debug|x86
- {AEEE9FD1-6892-45E2-A67E-418C06D46FF9}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {AEEE9FD1-6892-45E2-A67E-418C06D46FF9}.Release|Any CPU.Build.0 = Release|Any CPU
- {AEEE9FD1-6892-45E2-A67E-418C06D46FF9}.Release|x86.ActiveCfg = Release|x86
- {AEEE9FD1-6892-45E2-A67E-418C06D46FF9}.Release|x86.Build.0 = Release|x86
- {04E168D0-9CC7-43D9-A9F1-93E481EA86A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {04E168D0-9CC7-43D9-A9F1-93E481EA86A3}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {04E168D0-9CC7-43D9-A9F1-93E481EA86A3}.Debug|x86.ActiveCfg = Debug|x86
- {04E168D0-9CC7-43D9-A9F1-93E481EA86A3}.Debug|x86.Build.0 = Debug|x86
- {04E168D0-9CC7-43D9-A9F1-93E481EA86A3}.Demo|Any CPU.ActiveCfg = Demo|Any CPU
- {04E168D0-9CC7-43D9-A9F1-93E481EA86A3}.Demo|Any CPU.Build.0 = Demo|Any CPU
- {04E168D0-9CC7-43D9-A9F1-93E481EA86A3}.Demo|x86.ActiveCfg = Demo|x86
- {04E168D0-9CC7-43D9-A9F1-93E481EA86A3}.Demo|x86.Build.0 = Demo|x86
- {04E168D0-9CC7-43D9-A9F1-93E481EA86A3}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {04E168D0-9CC7-43D9-A9F1-93E481EA86A3}.Release|Any CPU.Build.0 = Release|Any CPU
- {04E168D0-9CC7-43D9-A9F1-93E481EA86A3}.Release|x86.ActiveCfg = Release|x86
- {04E168D0-9CC7-43D9-A9F1-93E481EA86A3}.Release|x86.Build.0 = Release|x86
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/PROMS/DataLoader/DataLoaderGlitches.cs b/PROMS/DataLoader/DataLoaderGlitches.cs
deleted file mode 100644
index a16b9705..00000000
--- a/PROMS/DataLoader/DataLoaderGlitches.cs
+++ /dev/null
@@ -1,213 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Xml;
-using System.Xml.Serialization;
-using System.Xml.Schema;
-using System.IO;
-using VEPROMS.CSLA.Library;
-
-namespace DataLoader
-{
- [XmlRoot("DataLoaderGlitches")]
- //[Serializable()]
- public class DataLoaderGlitches
- {
- private Glitches _Glitches;
-
- public Glitches Glitches
- {
- get
- {
- if (_Glitches == null) _Glitches = new Glitches();
- return _Glitches;
- }
- set { _Glitches = value; }
- }
- public void Add(string cause, string originalText, string newText)
- {
- Glitches.Add(cause, originalText, newText);
- }
- public void Save(string fileName)
- {
- XmlSerializer.WriteFile(this, fileName);
- }
- public static DataLoaderGlitches LoadProblems(string fileName)
- {
- return XmlSerializer.ReadFile(fileName);
- }
- }
- public class Glitches : List
- {
- public void Add(string cause, string originalText, string newText)
- {
- base.Add(new Glitch(cause, originalText, newText));
- }
- }
- public class Glitch
- {
- public Glitch()
- {
- }
- public Glitch(string cause, string originalText, string newText)
- {
- _Cause = cause;
- _OriginalText = originalText;
- _NewText = newText;
- }
- private string _Cause;
- [XmlAttribute("Cause")]
- public string Cause
- {
- get { return _Cause; }
- set { _Cause = value; }
- }
- private string _OriginalText;
- [XmlAttribute("OriginalText")]
- public string OriginalText
- {
- get { return _OriginalText; }
- set { _OriginalText = value; }
- }
- private string _NewText;
- [XmlAttribute("NewText")]
- public string NewText
- {
- get { return _NewText; }
- set { _NewText = value; }
- }
- private string _Comparison;
- [XmlIgnore]
- public string Comparison
- {
- get
- {
- if (_Comparison == null)
- _Comparison = GetComparison(_OriginalText, _NewText);
- return _Comparison;
- }
- }
- private string GetComparison(string str1, string str2)
- {
- if(str1 == str2)return str1;
- int endMatch = 0;
- int l1 = str1.Length;
- int l2 = str2.Length;
- int min = l1 > l2 ? l2 : l1;
- int startMatch = min;
- for(int i = 0; i< min; i++)
- if (str1[i] != str2[i])
- {
- startMatch = i;
- break;
- }
- for (int i = 1; i < min; i++)
- if (str1[l1-i] != str2[l2-i])
- {
- endMatch = i-1;
- break;
- }
- string prefix = str1.Substring(0, startMatch);
- string part1 = str1.Substring(startMatch, l1 - (startMatch + endMatch));
- string part2 = str2.Substring(startMatch, l2 - (startMatch + endMatch));
- string suffix = str1.Substring(l1 - endMatch, endMatch);
- _Delta = "<<<" + part1 + "|||" + part2 + ">>>";
- return prefix + "\r\n<<<" + part1 + "|||" + part2 + ">>>\r\n" + suffix;
- }
- private string _Delta = null;
- public override string ToString()
- {
- if (Comparison == null) { ;} // This gets the Comparsion and sets _Delta
- return _Delta;
- }
- }
- public static class XmlSerializer where T : class
- {
- public static string StringSerialize(T t)
- {
- string strOutput = string.Empty;
- XmlSerializer xs = new XmlSerializer(typeof(T), "http://www.volian.com");
- using (MemoryStream ms = new MemoryStream())
- {
- xs.Serialize(new NonXsiTextWriter(ms, Encoding.UTF8), t);
- //xs.Serialize(ms, t);
- ms.Position = 0;
- StreamReader sr = new StreamReader(ms);
- strOutput = sr.ReadToEnd();
- ms.Close();
- }
- return strOutput;
- }
- public static T StringDeserialize(string s)
- {
- T t;
- XmlSerializer xs = new XmlSerializer(typeof(T), "http://www.volian.com");
- UTF8Encoding enc = new UTF8Encoding();
- Byte[] arrBytData = enc.GetBytes(s);
- using (MemoryStream ms = new MemoryStream(arrBytData))
- {
- t = (T)xs.Deserialize(ms);
- }
- return t;
- }
- public static void WriteFile(T t, string fileName)
- {
- string strOutput = string.Empty;
- XmlSerializer xs = new XmlSerializer(typeof(T), "http://www.volian.com");
- using (FileStream fs = new FileStream(fileName, FileMode.Create))
- {
- xs.Serialize(new NonXsiTextWriter(fs, Encoding.UTF8), t);
- fs.Close();
- }
- }
- public static T ReadFile(string fileName)
- {
- T t;
- XmlSerializer xs = new XmlSerializer(typeof(T), "http://www.volian.com");
- using (FileStream fs = new FileStream(fileName, FileMode.Open))
- {
- t = (T)xs.Deserialize(fs);
- }
- return t;
- }
- }
- public class NonXsiTextWriter : XmlTextWriter
- {
- public NonXsiTextWriter(TextWriter w) : base(w) { }
- public NonXsiTextWriter(Stream w, Encoding encoding)
- : base(w, encoding)
- {
- this.Formatting = Formatting.Indented;
- }
- public NonXsiTextWriter(string filename, Encoding encoding) : base(filename, encoding) { }
- bool _skip = false;
- public override void WriteStartAttribute(string prefix, string localName, string ns)
- {
- if ((prefix == "xmlns" && (localName == "xsd" || localName == "xsi")) || // Omits XSD and XSI declarations.
- ns == XmlSchema.InstanceNamespace) // Omits all XSI attributes.
- {
- _skip = true;
- return;
- }
- if (localName == "xlink_href")
- base.WriteStartAttribute(prefix, "xlink:href", ns);
- else
- base.WriteStartAttribute(prefix, localName, ns);
- }
- public override void WriteString(string text)
- {
- if (_skip) return;
- base.WriteString(text);
- }
- public override void WriteEndAttribute()
- {
- if (_skip)
- { // Reset the flag, so we keep writing.
- _skip = false;
- return;
- }
- base.WriteEndAttribute();
- }
- }
-
-}
diff --git a/PROMS/DataLoader/DataLoaderSettings.cs b/PROMS/DataLoader/DataLoaderSettings.cs
deleted file mode 100644
index 1a0bd2f1..00000000
--- a/PROMS/DataLoader/DataLoaderSettings.cs
+++ /dev/null
@@ -1,710 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Windows.Forms;
-using System.ComponentModel;
-using System.Drawing.Design;
-using System.Reflection;
-using System.Data;
-using System.Collections;
-using System.IO;
-using System.Runtime.Serialization.Formatters.Binary;
-using System.Data.SqlClient;
-
-namespace DataLoader
-{
- [Serializable]
- class DataLoaderSettings:ICloneable
- {
- private static List _MyDataPaths = Loader.DataPaths;
- #region Clone
- public object Clone()
- {
- MemoryStream memoryStream = new MemoryStream();
- BinaryFormatter binaryFormatter = new BinaryFormatter();
-
- binaryFormatter.Serialize(memoryStream, this);
- memoryStream.Seek(0, SeekOrigin.Begin);
-
- return binaryFormatter.Deserialize(memoryStream);
- }
- #endregion
- #region 16-Bit Executable
- private string _VEPromsPath; // Folder
- [Category("16-Bit Executable")]
- [DisplayName("VEProms Exe Folder")]
- [Description("Path to the VE-PROMS Executable Folder")]
- [EditorAttribute(typeof(UIFolderEditor), typeof(System.Drawing.Design.UITypeEditor))]
- public string VEPromsPath
- {
- get { return _VEPromsPath; }
- set { _VEPromsPath = value; }
- }
- private string _VESamFile; // File
- [Category("16-Bit Executable")]
- [DisplayName("VEProms Security File")]
- [Description("VE-PROMS Securty File (VESam)")]
- [UIFilenameEditor.FileDialogFilterAttribute("VEProms Security File|vesam.opt")]
- [EditorAttribute(typeof(UIFilenameEditor), typeof(System.Drawing.Design.UITypeEditor))]
- public string VESamFile
- {
- get { return _VESamFile; }
- set { _VESamFile = value; }
- }
- #endregion
- #region 16-Bit Data
- private string _ProcedureSetPath; // Folder
- [Category("16-Bit Data")]
- [DisplayName("Procedure Folder")]
- [Description("Path to the Data Set being converted")]
- [EditorAttribute(typeof(UIFolderEditor), typeof(System.Drawing.Design.UITypeEditor))]
- public string ProcedureSetPath
- {
- get { return _ProcedureSetPath; }
- set { _ProcedureSetPath = value; }
- }
- private bool _OnlyThisSet; // Boolean
- [Category("16-Bit Data")]
- [DisplayName("Only Process this Procedure Set")]
- [Description("Only Convert the Selected Procedure Set")]
- public bool OnlyThisSet
- {
- get { return _OnlyThisSet; }
- set { _OnlyThisSet = value; }
- }
- private bool _LoadApproved; // Boolean
- [Category("16-Bit Data")]
- [DisplayName("Load approved data for this Procedure Set")]
- [Description("Load approved PDFs (if they exist) and consistency checks for the Selected Procedure Set")]
- public bool LoadApproved
- {
- get { return _LoadApproved; }
- set { _LoadApproved = value; }
- }
- private string _ProcessOnlyInLocation; // Folder
- [Category("16-Bit Data")]
- [DisplayName("Process Only In Location")]
- [Description("Limit to folder or group of folders (otherwise all plants will be processed)")]
- [EditorAttribute(typeof(UIFolderEditor), typeof(System.Drawing.Design.UITypeEditor))]
- public string ProcessOnlyInLocation
- {
- get { return _ProcessOnlyInLocation; }
- set { _ProcessOnlyInLocation = value; }
- }
- #endregion
- #region Format Data
- private string _FormatFolder; // Folder
- [Category("Format Data")]
- [DisplayName("Format Folder")]
- [Description("Location of XML Format Files.")]
- [EditorAttribute(typeof(UIFolderEditor), typeof(System.Drawing.Design.UITypeEditor))]
- public string FormatFolder
- {
- get { return _FormatFolder; }
- set { _FormatFolder = value; }
- }
- private string _GenMacFolder; // Folder
- [Category("Format Data")]
- [DisplayName("GenMac Folder")]
- [Description("Location of XML (SVG) GenMac Macro Files.")]
- [EditorAttribute(typeof(UIFolderEditor), typeof(System.Drawing.Design.UITypeEditor))]
- public string GenMacFolder
- {
- get { return _GenMacFolder; }
- set { _GenMacFolder = value; }
- }
- #endregion
- #region Backup Data
- private string _BackupFileName; // String
- [Category("Backup Data")]
- [DisplayName("Backup File Name")]
- [Description("Name of Backup File in the batch files created in the Log Folder")]
- public string BackupFileName
- {
- get { return _BackupFileName; }
- set { _BackupFileName = value; }
- }
- private string _BackupFolder; // Folder
- [Category("Backup Data")]
- [DisplayName("Backup Folder")]
- [Description("Location of Backup Files created during each phase of the conversion process.")]
- [EditorAttribute(typeof(UIFolderEditor), typeof(System.Drawing.Design.UITypeEditor))]
- public string BackupFolder
- {
- get { return _BackupFolder; }
- set { _BackupFolder = value; }
- }
- private string _Phase1Suffix; // String
- [Category("Backup Data")]
- [DisplayName("Phase 1 Suffix")]
- [Description("Suffix to use for backup before Transitions are Fixed")]
- public string Phase1Suffix
- {
- get { return _Phase1Suffix; }
- set { _Phase1Suffix = value; }
- }
- private string _Phase2Suffix; // String
- [Category("Backup Data")]
- [DisplayName("Phase 2 Suffix")]
- [Description("Suffix to use for backup before Change Manager Script")]
- public string Phase2Suffix
- {
- get { return _Phase2Suffix; }
- set { _Phase2Suffix = value; }
- }
- private string _Phase3Suffix; // String
- [Category("Backup Data")]
- [DisplayName("Phase 3 Suffix")]
- [Description("Suffix to use for backup before Approval Script")]
- public string Phase3Suffix
- {
- get { return _Phase3Suffix; }
- set { _Phase3Suffix = value; }
- }
- private string _Phase4Suffix; // String
- [Category("Backup Data")]
- [DisplayName("Phase 4 Suffix")]
- [Description("Suffix to use for backup before Loading Approved Data")]
- public string Phase4Suffix
- {
- get { return _Phase4Suffix; }
- set { _Phase4Suffix = value; }
- }
- #endregion
- #region Process Log
- private string _LogFilePath; // Folder
- [Category("Process Log")]
- [DisplayName("Log File Folder")]
- [Description("Location of the Log Files")]
- [EditorAttribute(typeof(UIFolderEditor), typeof(System.Drawing.Design.UITypeEditor))]
- public string LogFilePath
- {
- get { return _LogFilePath; }
- set { _LogFilePath = value; }
- }
- #endregion
- #region Sql Database
- private string _ConnectionString; // String
- [Category("Sql Database")]
- [DisplayName("SQL Connection String")]
- [Description("Connection string for SQL")]
- public string ConnectionString
- {
- get { return _ConnectionString; }
- set { _ConnectionString = value; }
- }
- private string _DBName; // String
- [Category("Sql Database")]
- [DisplayName("Database Name")]
- [Description("Name of the Database that will be created to contain the converted data.")]
- public string DBName
- {
- get { return _DBName; }
- set { _DBName = value; }
- }
- private string _DBPath; // Folder
- [Category("Sql Database")]
- [DisplayName("Database File Folder")]
- [Description("Location of the Database files.")]
- [EditorAttribute(typeof(UIFolderEditor), typeof(System.Drawing.Design.UITypeEditor))]
- public string DBPath
- {
- get { return _DBPath; }
- set { _DBPath = value; }
- }
- private bool _PurgeExistingData;
- [Category("Sql Database")]
- [DisplayName("Purge Existing Data")]
- [Description("Should the data in the SQL database be purged (emptied) before adding this data.")]
- public bool PurgeExistingData
- {
- get { return _PurgeExistingData; }
- set { _PurgeExistingData = value; }
- }
- #endregion
- //#region PDFs
- //private string _PDFFolder; // Folder
- //[Category("PDFs")]
- //[DisplayName("PDF Folder")]
- //[Description("Location for PDFs when printing.")]
- //[EditorAttribute(typeof(UIFolderEditor), typeof(System.Drawing.Design.UITypeEditor))]
- //public string PDFFolder
- //{
- // get { return _PDFFolder; }
- // set { _PDFFolder = value; }
- //}
- //#endregion
- #region Debugging
- private ExecutionMode _ExecutionMode;
- [TypeConverter(typeof(EnumDescConverter))]
- [DisplayName("Execution Mode")]
- [Category("Debugging")]
- [Description("Mode for Conversion")]
- public ExecutionMode ExecutionMode
- {
- get { return _ExecutionMode; }
- set { _ExecutionMode = value; }
- }
- private bool _CheckRTF;
- [DisplayName("Check RTF")]
- [Category("Debugging")]
- [Description("This makes the Fix Transtion Code work Differently. Not sure what it does.")]
- public bool CheckRTF
- {
- get { return _CheckRTF; }
- set { _CheckRTF = value; }
- }
- private int _Skip; // Skip specified procedures during load.
- [DisplayName("Skip First n Procedures")]
- [Category("Debugging")]
- [Description("Skip the specified number of procedures during conversion to get to a problem quicker.")]
- public int Skip
- {
- get { return _Skip; }
- set { _Skip = value; }
- }
- private int _HowMany=0; // Skip specified procedures during load.
- [DisplayName("How Many Procedures should be converted")]
- [Category("Debugging")]
- [Description("Only process part of the set.")]
- public int HowMany
- {
- get { return _HowMany; }
- set { _HowMany = value; }
- }
- #endregion
- #region Accessory Pages
- private AccPageConversion _ConvertTo;
- [TypeConverter(typeof(EnumDescConverter))]
- [DisplayName("Convert To")]
- [Category("Accessory Pages")]
- [Description("Format to which the Accessory Page converted")]
- public AccPageConversion ConvertTo
- {
- get { return _ConvertTo; }
- set { _ConvertTo = value; }
- }
- private bool _RedPDFs; // Boolean
- [Category("Accessory Pages")]
- [DisplayName("Print MSWord PDFs in Red")]
- [Description("Creates Word PDFs in Debug Mode so that Debug printing will not require Word to print again.")]
- public bool RedPDFs
- {
- get { return _RedPDFs; }
- set { _RedPDFs = value; }
- }
- #endregion
- #region RO Update
- private ROUpdateMode _WhatROsToConvert = 0;
- [Category("RO Update")]
- [DisplayName("What ROs To Convert")]
- [Description("Select which ROs should be converted.")]
- public ROUpdateMode WhatROsToConvert
- {
- get { return _WhatROsToConvert; }
- set { _WhatROsToConvert = value; }
- }
- private int _SelectedROFst = -1;
- [Category("RO Update")]
- [DisplayName("Selected ROFst")]
- [Description("Enter which ROFstID is the basis for the original text (-1 = None).")]
- public int SelectedROFst
- {
- get { return _SelectedROFst; }
- set { _SelectedROFst = value; }
- }
- private bool _AnnotateWhenConvertingToText;
- [Category("RO Update")]
- [DisplayName("Annotate When Converting To Text")]
- [Description("Should the step have annotation when the ro data has been converted to text.")]
- public bool AnnotateWhenConvertingToText
- {
- get { return _AnnotateWhenConvertingToText; }
- set { _AnnotateWhenConvertingToText = value; }
- }
- private bool _AnnotateWhenShowingMissingRO;
- [Category("RO Update")]
- [DisplayName("Annotate When Showing Missing RO")]
- [Description("Should the step have annotation when the ro data is missing and is being displayed as a question mark.")]
- public bool AnnotateWhenShowingMissingRO
- {
- get { return _AnnotateWhenShowingMissingRO; }
- set { _AnnotateWhenShowingMissingRO = value; }
- }
- private bool _AnnotateWhenShowingDifferentRO;
- [Category("RO Update")]
- [DisplayName("Annotate When Showing Different RO")]
- [Description("Should the step have annotation when the ro data is different.")]
- public bool AnnotateWhenShowingDifferentRO
- {
- get { return _AnnotateWhenShowingDifferentRO; }
- set { _AnnotateWhenShowingDifferentRO = value; }
- }
- #endregion
- [Browsable(false)]
- public string ValidityCheck
- {
- get
- {
- StringBuilder sb = new StringBuilder();
- string ErrorPrefix = "Settings are not valid\r\n";
- // VEPromsPath = has to be non-blank
- if ((VEPromsPath ?? "") == "" || !Directory.Exists(VEPromsPath))
- {
- sb.Append(ErrorPrefix + "VEProms Exe Folder must point to an existing folder\r\n");
- ErrorPrefix = "";
- }
- // VESamFile = has to be non-blank
- if ((VESamFile ?? "") == "" || !File.Exists(VESamFile))
- {
- sb.Append(ErrorPrefix + "VEProms Security File must point to an existing file\r\n");
- ErrorPrefix = "";
- }
- // ProcedureSetPath = If OnlyThisSet is checked, then has to be non-blank
- if (OnlyThisSet)
- {
- if ((ProcedureSetPath ?? "") == "" || !Directory.Exists(ProcedureSetPath))
- {
- sb.Append(ErrorPrefix + "Procedure Folder must point to an existing folder\r\n");
- ErrorPrefix = "";
- }
- else
- {
- if (!InDataPaths(ProcedureSetPath))
- {
- sb.Append(ErrorPrefix + string.Format("Procedure Folder not in DataPath from Config File '{0}' \r\n", DataLoaderSettings._MyDataPaths[0]));
- ErrorPrefix = "";
- }
- else if (!File.Exists(ProcedureSetPath + @"\set.dbf"))
- {
- sb.Append(ErrorPrefix + "Procedure Folder must point to an existing procedure data folder\r\n");
- ErrorPrefix = "";
- }
- }
- }
- else
- {
- if ((ProcedureSetPath ?? "") == "" || !Directory.Exists(ProcedureSetPath))
- {
- sb.Append(ErrorPrefix + "Procedure Folder must point to an existing folder\r\n");
- ErrorPrefix = "";
- }
- else
- {
- if (!InDataPaths(ProcedureSetPath))
- {
- sb.Append(ErrorPrefix + string.Format("Procedure Folder not in DataPath from Config File '{0}' \r\n", DataLoaderSettings._MyDataPaths[0]));
- ErrorPrefix = "";
- }
- }
- }
- //added by jcb 20121127
- //check is ProcedureSetPath contains ProcessOnlyInLocation
- if (ProcedureSetPath != null && ProcedureSetPath.StartsWith(ProcessOnlyInLocation ?? "") == false)
- {
- sb.Append(ErrorPrefix + "Check Process Only In Location value is pointing to similar directory as Procedure Set Path\r\n");
- ErrorPrefix = "";
- }
- //end added by jcb 20121127
- // BackupFileName = Has to be non-blank
- if ((BackupFileName ?? "") == "")
- {
- sb.Append(ErrorPrefix + "Backup File Name must not be blank\r\n");
- ErrorPrefix = "";
- }
- if ((Phase1Suffix ?? "") == "")
- {
- sb.Append(ErrorPrefix + "Phase 1 Suffix must not be blank\r\n");
- ErrorPrefix = "";
- }
- if ((Phase2Suffix ?? "") == "")
- {
- sb.Append(ErrorPrefix + "Phase 2 Suffix must not be blank\r\n");
- ErrorPrefix = "";
- }
- if ((Phase3Suffix ?? "") == "")
- {
- sb.Append(ErrorPrefix + "Phase 3 Suffix must not be blank\r\n");
- ErrorPrefix = "";
- }
- // BackupFolder = Has to be non-blank
- if (OnlyThisSet && (BackupFolder ?? "") == "" || !Directory.Exists(BackupFolder))
- {
- sb.Append(ErrorPrefix + "Backup Folder must point to an existing folder\r\n");
- ErrorPrefix = "";
- }
- // FormatFolder = Has to be non-blank
- if (OnlyThisSet && (FormatFolder ?? "") == "" || !Directory.Exists(FormatFolder))
- {
- sb.Append(ErrorPrefix + "Format Folder must point to an existing folder\r\n");
- ErrorPrefix = "";
- }
- // GenMacFolder = Has to be non-blank
- if (OnlyThisSet && (GenMacFolder ?? "") == "" || !Directory.Exists(GenMacFolder))
- {
- sb.Append(ErrorPrefix + "GenMac Folder must point to an existing folder\r\n");
- ErrorPrefix = "";
- }
- // LogFilePath = Has to be non-blank
- if (OnlyThisSet && (LogFilePath ?? "") == "" || !Directory.Exists(LogFilePath))
- {
- sb.Append(ErrorPrefix + "Log File Folder must point to an existing folder\r\n");
- ErrorPrefix = "";
- }
- // ConnectionString = Has to be non-blank
- if ((ConnectionString ?? "") == "")
- {
- sb.Append(ErrorPrefix + "SQL Connection String must be a valid connection string\r\n");
- ErrorPrefix = "";
- }
- else
- {
- // Validate ConnectionString
- string checkConnectionString = ValidateConnectionString("Master");
- if (checkConnectionString != "")
- {
- sb.Append(ErrorPrefix + "SQL Connection String must be a valid connection string\r\n");
- sb.Append(checkConnectionString);
- ErrorPrefix = "";
- }
- }
- // DBName = Has to be non-blank
- if ((DBName ?? "") == "")
- {
- sb.Append(ErrorPrefix + "SQL Database Name must be a valid database name\r\n");
- ErrorPrefix = "";
- }
- // DBPath = if null check to see if DBName DB has Path, if it does then set DBPath
- if ((DBPath ?? "") == "" || !Directory.Exists(DBPath))
- {
- string filePath = GetDBFileName();
- if (filePath != null)
- {
- FileInfo fi = new FileInfo(filePath);
- DBPath = fi.DirectoryName;
- }
- else
- {
- sb.Append(ErrorPrefix + "SQL Database Path must point to an existing folder\r\n");
- ErrorPrefix = "";
- }
- }
- // PDFFolder = if not set, then don't set PDFFolder in DocVersion.Config
- //if (ExecutionMode == ExecutionMode.Debug && ((PDFFolder ?? "") == "" || !Directory.Exists(PDFFolder)))
- //{
- // sb.Append(ErrorPrefix + "PDF Folder must point to an existing folder in debug mode\r\n");
- // ErrorPrefix = "";
- //}
- // Skip = Any NUmber
- // PurgeExistingData = N/A
- // OnlyThisSet = N/A
- // CheckRTF = N/A
- // ConvertTo = N/A
- // RedPDFs = N/A
- return sb.ToString();
- }
- }
- private bool InDataPaths(string ProcedureSetPath)
- {
- foreach (string dp in _MyDataPaths)
- if (ProcedureSetPath.ToUpper().StartsWith(dp.ToUpper())) return true;
- return false;
- }
- private string ValidateConnectionString(string dbName)
- {
- if(!ConnectionString.Contains("{DBName}"))
- return " Needs to have a {DBName} token for the Initial Catalog";
- string cnstr = ConnectionString.Replace("{DBName}", dbName);
- try
- {
- SqlConnection cn = new SqlConnection(cnstr);
- cn.Open();
- cn.Close();
- }
- catch (Exception ex)
- {
- StringBuilder sb = new StringBuilder();
- while (ex != null)
- {
- sb.Append(string.Format(" {0}-{1}",ex.GetType().Name,ex.Message));
- ex = ex.InnerException;
- }
- return sb.ToString();
- }
- return "";
- }
- private string GetDBFileName()
- {
- string filename = null;
- SqlConnection cn = new SqlConnection(ConnectionString.Replace("{DBName}","Master"));
- cn.Open();
- string cmd = string.Format("Select FileName from sysdatabases where Name = '{0}'",DBName);
- SqlDataAdapter da = new SqlDataAdapter(cmd,cn);
- DataSet ds = new DataSet();
- da.Fill(ds);
- if (ds.Tables.Count == 1 && ds.Tables[0].Rows.Count == 1)
- filename = ds.Tables[0].Rows[0][0].ToString();
- cn.Close();
- return filename;
- }
- }
- public enum AccPageConversion : int
- {
- [Description("Don't Convert")] DoNotConvert=0,
- [Description("MS Word")] MSWord = 1,
- [Description("Rich Text Format")] RichTextFormat = 2
- }
- public enum ExecutionMode : int
- {
- [Description("Debug")] Debug = 0,
- [Description("Production")] Production = 1,
- }
- public enum ROUpdateMode : int
- {
- [Description("None")]
- None = 0,
- [Description("Missing")]
- Missing = 1,
- [Description("All")]
- All = 2,
- }
-
- public class EnumDescConverter : System.ComponentModel.EnumConverter
- {
- protected System.Type myVal;
-
- ///
- /// Gets Enum Value's Description Attribute
- ///
- /// The value you want the description attribute for
- /// The description, if any, else it's .ToString()
- public static string GetEnumDescription(Enum value)
- {
- //Console.WriteLine("{0}", value);
- FieldInfo fi = value.GetType().GetField(value.ToString());
- DescriptionAttribute[] attributes =
- (DescriptionAttribute[])fi.GetCustomAttributes(
- typeof(DescriptionAttribute), false);
- //Console.WriteLine("{0},{1},{2}", value.ToString(), attributes.Length, (attributes.Length > 0) ? attributes[0].Description : value.ToString());
- return (attributes.Length > 0) ? attributes[0].Description : value.ToString();
- }
-
- ///
- /// Gets the description for certaing named value in an Enumeration
- ///
- /// The type of the Enumeration
- /// The name of the Enumeration value
- /// The description, if any, else the passed name
- public static string GetEnumDescription(System.Type value, string name)
- {
- FieldInfo fi = value.GetField(name);
- DescriptionAttribute[] attributes =
- (DescriptionAttribute[])fi.GetCustomAttributes(
- typeof(DescriptionAttribute), false);
- return (attributes.Length > 0) ? attributes[0].Description : name;
- }
-
- ///
- /// Gets the value of an Enum, based on it's Description Attribute or named value
- ///
- /// The Enum type
- /// The description or name of the element
- /// The value, or the passed in description, if it was not found
- public static object GetEnumValue(System.Type value, string description)
- {
- FieldInfo[] fis = value.GetFields();
- foreach (FieldInfo fi in fis)
- {
- DescriptionAttribute[] attributes =
- (DescriptionAttribute[])fi.GetCustomAttributes(
- typeof(DescriptionAttribute), false);
- if (attributes.Length > 0)
- {
- if (attributes[0].Description == description)
- {
- return fi.GetValue(fi.Name);
- }
- }
- if (fi.Name == description)
- {
- return fi.GetValue(fi.Name);
- }
- }
- return description;
- }
-
- public EnumDescConverter(System.Type type)
- : base(type.GetType())
- {
- myVal = type;
- }
-
- public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
- {
- if (value is Enum && destinationType == typeof(string))
- {
- return EnumDescConverter.GetEnumDescription((Enum)value);
- }
- if (value is string && destinationType == typeof(string))
- {
- return EnumDescConverter.GetEnumDescription(myVal, (string)value);
- }
- return base.ConvertTo(context, culture, value, destinationType);
- }
-
- public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
- {
- if (value is string)
- {
- return EnumDescConverter.GetEnumValue(myVal, (string)value);
- }
- if (value is Enum)
- {
- return EnumDescConverter.GetEnumDescription((Enum)value);
- }
- return base.ConvertFrom(context, culture, value);
- }
- public override bool GetPropertiesSupported(ITypeDescriptorContext context)
- {
- return false;
- }
-
- public override TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
- {
- ArrayList values = new ArrayList();
- FieldInfo[] fis = myVal.GetFields();
- foreach (FieldInfo fi in fis)
- {
- DescriptionAttribute[] attributes = (DescriptionAttribute[])fi.GetCustomAttributes(
- typeof(DescriptionAttribute), false);
- //if (attributes.Length > 0)
- if (fi.Name != "value__")
- values.Add(fi.GetValue(fi.Name));
- }
- return new TypeConverter.StandardValuesCollection(values);
- }
- public static string GetEnumKeyDescription(Enum value)
- {
- FieldInfo fi = value.GetType().GetField(value.ToString());
- DescriptionAttribute[] attributes =
- (DescriptionAttribute[])fi.GetCustomAttributes(
- typeof(DescriptionAttribute), false);
- return (attributes.Length > 0) ? attributes[0].Description : value.ToString();
- }
-
- public static DataTable GetEnumAsDataTable(System.Type EnumType)
- {
- DataTable DTEnum = new DataTable();
- DTEnum.Columns.Add(new DataColumn("EnumID", typeof(Int32)));
- DTEnum.Columns.Add(new DataColumn("Enum", typeof(string)));
- DTEnum.Columns.Add(new DataColumn("Description", typeof(string)));
- foreach (int i in Enum.GetValues(EnumType))
- {
- System.Enum fooItem = (System.Enum)Enum.ToObject(EnumType, i);
- DTEnum.Rows.Add(new object[] { i, fooItem.ToString(), GetEnumKeyDescription(fooItem) });
- }
- return DTEnum;
- }
- }
-
-}
diff --git a/PROMS/DataLoader/DocVersions.cs b/PROMS/DataLoader/DocVersions.cs
deleted file mode 100644
index f3f86914..00000000
--- a/PROMS/DataLoader/DocVersions.cs
+++ /dev/null
@@ -1,178 +0,0 @@
-// ========================================================================
-// 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.IO;
-using System.Text;
-using VEPROMS.CSLA.Library;
-
-namespace DataLoader
-{
- public partial class Loader
- {
- public TimeSpan MigrateDocVersion(DocVersion docver)
- {
- return MigrateDocVersion(docver, true);
- }
-
- private OutsideTransition _OutTran;
- public int MultiUnitCount = 0;
- public Dictionary Old2NewApple;
- public Dictionary New2OldApple;
-
- public TimeSpan MigrateDocVersion(DocVersion docver, bool convertProcedures)
- {
- long lTime = DateTime.Now.Ticks;
- string pth = docver.Title;
- // if the Title is empty, return because this docversion has already been migrated.
- bool appending = false;
- if (frmMain.Automatic && !frmMain.PurgeExistingData)
- {
- pth = frmMain.ProcedureSetPath;
- appending = true;
- }
- if (pth == null || pth == "" || pth == "Title") return TimeSpan.FromTicks(0);
- MultiUnitCount = docver.DocVersionConfig.Unit_Count;
- if (MultiUnitCount > 0)
- {
- Old2NewApple = new Dictionary();
- New2OldApple = new Dictionary();
- for (int i = 1; i <= MultiUnitCount; i++)
- {
- docver.DocVersionConfig.SelectedSlave = i;
- int oldindex = int.Parse(docver.DocVersionConfig.Old_Index);
- Old2NewApple.Add(oldindex, i);
- New2OldApple.Add(i, oldindex);
- }
- }
- if (!File.Exists(pth + @"\set.dbf") || !File.Exists(pth + @"\curset.dat")) return TimeSpan.FromTicks(0);
- // Open connection
- OleDbConnection cn = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + pth + ";Extended Properties=dBase III;Persist Security Info=False");
- if (convertProcedures)
- {
- // JSJ 02/10/2010 - Remove all the .INF files before proceeding to convert.
- // The INF files contain a path to a corresponding NDX file - had data with bat NDX path
- DeleteINFFiles(pth);
- _OutTran = new OutsideTransition(cn);
- frmMain.AddInfo("Before MigrateROFST{0}\r\n{1}", GC.GetTotalMemory(true), VEPROMS.CSLA.Library.CSLACache.UsageAll);
- //if(!appending)
- MigrateROFST(pth, docver);
- GC.Collect();
- frmMain.AddInfo("After MigrateROFST{0}\r\n{1}", GC.GetTotalMemory(true), VEPROMS.CSLA.Library.CSLACache.UsageAll);
- // Migrate library documents
- //if(!appending)
- MigrateLibDocs(cn, pth, appending);
-
- // if migrating bge, save the 'unit' number. This unit number is used in pagelist items and is
- // based on the path/directory name of the procedure set.
- if (true) // somehow check for BGE
- {
- SetDocVersionUnitConfig(pth, docver);
- }
-
-
- // Initialize Dictionaries
- dicTrans_ItemDone = new Dictionary();
- dicTrans_ItemIds = new Dictionary();
- dicTrans_MigrationErrors = new Dictionary>();
-
- // 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
- Item itm = null;
- if (convertProcedures || docver.VersionType == (int)VEPROMS.CSLA.Library.VersionTypeEnum.WorkingDraft || docver.VersionType == (int)VEPROMS.CSLA.Library.VersionTypeEnum.Approved)
- {
- ResetApplesToOranges();
- itm = MigrateProcedures(cn, pth, docver, convertProcedures, docver.MyDocVersionInfo.ActiveFormat);
- }
- // Show any Missing Transtitons (i.e. Transitions which have not been processed)
- lTime = DateTime.Now.Ticks - lTime;
- if (convertProcedures)
- {
- ShowMissingTransitions(docver);
- //frmMain.Status = string.Format("{0}\r\nConversion completed in {1} seconds.", pth, TimeSpan.FromTicks(lTime).TotalSeconds);
- TimeSpan ts = TimeSpan.FromTicks(lTime);
- frmMain.Status = string.Format("{0}\r\nConversion completion time: {1:D2}:{2:D2}:{3:D2}.{4} ({5} Total Seconds)", pth, ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds, ts.TotalSeconds);
- log.InfoFormat("Completed Migration of {0}", pth);
-
- //MessageBox.Show("Completed Migration of " + pth); //jsj commented out to let it run through
- if (rofstinfo != null) rofstinfo.GetROFSTLookup(DocVersionInfo.Get(docver.VersionID)).Close();
- dicTrans_ItemDone.Clear();
- dicTrans_ItemDone = null;
- }
- else
- frmMain.Status = string.Format("{0}\r\nDone.", pth);
- cn.Close();
- if (itm != null)
- {
- docver.MyItem = itm;
- if (convertProcedures) docver.Title = ""; // clearing this tell us this docver (path) was converted?
- if (!docver.IsSavable) ErrorRpt.ErrorReport(docver);
- //if(frmMain.MySettings.ExecutionMode == ExecutionMode.Debug)
- // docver.DocVersionConfig.Print_PDFLocation = frmMain.MySettings.PDFFolder;
- docver.Save();
- }
- return TimeSpan.FromTicks(lTime);
- }
-
- private void SetDocVersionUnitConfig(string pth, DocVersion docver)
- {
- // the following 'rules' were taken from 16bit code, in pagelist.c, to define the unit number.
-
- string unitNum = "0";
- string testPath = pth.ToUpper();
-
- // back up further if this is a tmpchg or approved directory.
- int lastPart = pth.LastIndexOf(@"\");
- if (lastPart != -1)
- {
- testPath = testPath.Substring(testPath.LastIndexOf(@"\"));
- if (testPath.Contains("TMPCHG") || testPath.Contains("APPROVED"))
- testPath = testPath.Substring(testPath.LastIndexOf(@"\", lastPart));
- }
- if (testPath.IndexOf("PROCS2") > -1 || testPath.IndexOf("2.PRC") > -1)
- unitNum = "2";
- else if (testPath.IndexOf("PROCS") > -1 || testPath.IndexOf("1.PRC") > -1)
- unitNum = "1";
- else if (testPath.IndexOf("3.PRC") > -1)
- unitNum = "3";
- else if (testPath.IndexOf("4.PRC") > -1)
- unitNum = "4";
-
- docver.DocVersionConfig.Print_UnitNumberForPageList = unitNum;
- docver.Save();
- }
- private void DeleteINFFiles(string pth)
- {
- DirectoryInfo di = new DirectoryInfo(pth);
- FileInfo [] myFiles = di.GetFiles("*.INF");
- foreach (FileInfo myFile in myFiles)
- myFile.Delete();
- }
- private VEPROMS.CSLA.Library.VersionTypeEnum DocVersionType(string s)
- {
- if (s.EndsWith("approved")) return VEPROMS.CSLA.Library.VersionTypeEnum.Approved;
- if (s.EndsWith("chgsht")) return VEPROMS.CSLA.Library.VersionTypeEnum.Revision;
- if (s.EndsWith("tmpchg")) return VEPROMS.CSLA.Library.VersionTypeEnum.Temporary;
- return VEPROMS.CSLA.Library.VersionTypeEnum.WorkingDraft;
- }
- }
-}
\ No newline at end of file
diff --git a/PROMS/DataLoader/DocVersions.cs.bak b/PROMS/DataLoader/DocVersions.cs.bak
deleted file mode 100644
index 996562a8..00000000
--- a/PROMS/DataLoader/DocVersions.cs.bak
+++ /dev/null
@@ -1,127 +0,0 @@
-// ========================================================================
-// 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.IO;
-using System.Text;
-using VEPROMS.CSLA.Library;
-
-namespace DataLoader
-{
- public partial class Loader
- {
- public TimeSpan MigrateDocVersion(DocVersion docver)
- {
- return MigrateDocVersion(docver, true);
- }
-
- private OutsideTransition _OutTran;
- public int MultiUnitCount = 0;
- public Dictionary Old2NewApple;
- public Dictionary New2OldApple;
-
- public TimeSpan MigrateDocVersion(DocVersion docver, bool convertProcedures)
- {
- long lTime = DateTime.Now.Ticks;
- string pth = docver.Title;
- MultiUnitCount = docver.DocVersionConfig.Unit_Count;
- if (MultiUnitCount > 0)
- {
- Old2NewApple = new Dictionary();
- New2OldApple = new Dictionary();
- for (int i = 1; i <= MultiUnitCount; i++)
- {
- docver.DocVersionConfig.SelectedSlave = i;
- int oldindex = int.Parse(docver.DocVersionConfig.Old_Index);
- Old2NewApple.Add(oldindex, i);
- New2OldApple.Add(i, oldindex);
- }
- }
- if (!File.Exists(pth + @"\set.dbf") || !File.Exists(pth + @"\curset.dat")) return new TimeSpan(); // Open connection
- OleDbConnection cn = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + pth + ";Extended Properties=dBase III;Persist Security Info=False");
- if (convertProcedures)
- {
- // JSJ 02/10/2010 - Remove all the .INF files before proceeding to convert.
- // The INF files contain a path to a corresponding NDX file - had data with bat NDX path
- DeleteINFFiles(pth);
- _OutTran = new OutsideTransition(cn);
- frmMain.AddInfo("Before MigrateROFST{0}\r\n{1}", GC.GetTotalMemory(true), VEPROMS.CSLA.Library.CSLACache.UsageAll);
- MigrateROFST(pth, docver);
- GC.Collect();
- frmMain.AddInfo("After MigrateROFST{0}\r\n{1}", GC.GetTotalMemory(true), VEPROMS.CSLA.Library.CSLACache.UsageAll);
- // Migrate library documents
- MigrateLibDocs(cn, pth);
- // Initialize Dictionaries
- dicTrans_ItemDone = new Dictionary();
- dicTrans_ItemIds = new Dictionary();
- dicTrans_MigrationErrors = new Dictionary>();
-
- // 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
- Item itm = null;
- if (convertProcedures || docver.VersionType == (int)VEPROMS.CSLA.Library.VersionTypeEnum.WorkingDraft || docver.VersionType == (int)VEPROMS.CSLA.Library.VersionTypeEnum.Approved)
- itm = MigrateProcedures(cn, pth, docver, convertProcedures, docver.MyDocVersionInfo.ActiveFormat);
- // Show any Missing Transtitons (i.e. Transitions which have not been processed)
- lTime = DateTime.Now.Ticks - lTime;
- if (convertProcedures)
- {
- ShowMissingTransitions(docver);
- //frmMain.Status = string.Format("{0}\r\nConversion completed in {1} seconds.", pth, TimeSpan.FromTicks(lTime).TotalSeconds);
- TimeSpan ts = TimeSpan.FromTicks(lTime);
- frmMain.Status = string.Format("{0}\r\nConversion completion time: {1:D2}:{2:D2}:{3:D2}.{4} ({5} Total Seconds)", pth, ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds, ts.TotalSeconds);
- log.InfoFormat("Completed Migration of {0}", pth);
-
- //MessageBox.Show("Completed Migration of " + pth); //jsj commented out to let it run through
- if (rofstinfo != null) rofstinfo.ROFSTLookup.Close();
- dicTrans_ItemDone.Clear();
- dicTrans_ItemDone = null;
- }
- else
- frmMain.Status = string.Format("{0}\r\nDone.", pth);
- cn.Close();
- if (itm != null)
- {
- docver.MyItem = itm;
- if (convertProcedures) docver.Title = ""; // clearing this tell us this docver (path) was converted?
- if (!docver.IsSavable) ErrorRpt.ErrorReport(docver);
- if(frmMain.MySettings.ExecutionMode == ExecutionMode.Debug)
- docver.DocVersionConfig.Print_PDFLocation = frmMain.MySettings.PDFFolder;
- docver.Save();
- }
- return TimeSpan.FromTicks(lTime);
- }
- private void DeleteINFFiles(string pth)
- {
- DirectoryInfo di = new DirectoryInfo(pth);
- FileInfo [] myFiles = di.GetFiles("*.INF");
- foreach (FileInfo myFile in myFiles)
- myFile.Delete();
- }
- private VEPROMS.CSLA.Library.VersionTypeEnum DocVersionType(string s)
- {
- if (s.EndsWith("approved")) return VEPROMS.CSLA.Library.VersionTypeEnum.Approved;
- if (s.EndsWith("chgsht")) return VEPROMS.CSLA.Library.VersionTypeEnum.Revision;
- if (s.EndsWith("tmpchg")) return VEPROMS.CSLA.Library.VersionTypeEnum.Temporary;
- return VEPROMS.CSLA.Library.VersionTypeEnum.WorkingDraft;
- }
- }
-}
\ No newline at end of file
diff --git a/PROMS/DataLoader/Documents.cs b/PROMS/DataLoader/Documents.cs
deleted file mode 100644
index 0e4b366e..00000000
--- a/PROMS/DataLoader/Documents.cs
+++ /dev/null
@@ -1,368 +0,0 @@
-// ========================================================================
-// 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.IO;
-using System.Text;
-using System.Text.RegularExpressions;
-using Volian.MSWord;
-using VEPROMS.CSLA.Library;
-using System.Threading;
-
-namespace DataLoader
-{
- public partial class Loader
- {
- private void SaveSectionDocument(string fname, string stpseq, string stype, ref int cid, string sectName, bool isLandscape)
- {
- int docid = SaveWordDoc(fname, stype, sectName, isLandscape);
- switch (docid)
- {
- case 0:
- // could add the following back in - but many of these may be put out in the log, and
- // don't supply any pertinent info.
- //log.InfoFormat("Timing problem for save of word document, will retry. oldstepsequence = {0}", stpseq);
- break;
- case -1:
- log.ErrorFormat("Could not complete save of word document, oldstepsequence = {0}", stpseq);
- break;
- default:
- cid = docid;
- break;
- }
- }
-
- private int SaveWordDoc(string fname, string title, string stype, bool isLandscape, ConfigInfo ci, string sectName, DateTime dtsutc)
- {
- int docid = 0;
- if (System.IO.File.Exists(fname))
- {
- FileInfo myFile = new FileInfo(fname);
- GC.Collect();
- frmMain.AddInfo("Processing {0} {1}", fname, GC.GetTotalMemory(true));
- //string tmpName = @"C:\Temp\DataLoader\" + myFile.Name.Replace(".", "_") + ".RTF";
- string tmpName = Path.GetTempFileName();
- string temppath = Path.GetTempFileName();
- if (frmMain.MySettings.ExecutionMode == ExecutionMode.Production ||
- frmMain.MySettings.ConvertTo == AccPageConversion.MSWord)
- {
- FileInfo tmpFile = new FileInfo(tmpName);
- if (tmpFile.Exists)
- tmpFile.Delete();
- myFile.CopyTo(tmpName);
- LoadAndSaveRichTextBox41(tmpName);
- WordDocument wd = new WordDocument(tmpName, stype, temppath, isLandscape);
- Thread myThread = new Thread(wd.GetAsciiFromWord);
- myThread.Start();
- myThread.Join(30000); // Wait 30 seconds to time-out
- if (myThread.ThreadState == System.Threading.ThreadState.Running)
- {
- WordDoc.KillWordApps();
- Thread.Sleep(1000);// Give the process a second to shutdown
- frmMain.AddError("Could not open file '{0}'", fname);
- docid = SaveDoc(fname, title, ci, "", dtsutc); // Save the original file
- }
- else
- {
- if (ci == null) ci = new ConfigInfo(null);
- ci.AddItem("Printing", "Length", string.Format("{0:0.0000}", wd.DocLen));
- docid = SaveDoc(temppath, title, ci, wd.ASCII, dtsutc);
- DeleteFile(temppath);
- DeleteFile(tmpName);
- }
- }
- else
- {
- if (frmMain.MySettings.ConvertTo == AccPageConversion.RichTextFormat)
- docid = SaveDoc(fname, title, ci, "", dtsutc); // Need to get Ascii Text from RTF
- }
- }
- else
- frmMain.AddError("Missing rtf file: {0}", fname);
- return docid;
- }
- private RichTextBox _MyRichTextBox = null;
- public RichTextBox MyRichTextBox
- {
- get
- {
- if (_MyRichTextBox == null)
- _MyRichTextBox = new RichTextBox();
- return _MyRichTextBox;
- }
- }
- private void LoadAndSaveRichTextBox(string tmpName)
- {
- string rtf = LoadFileRaw(tmpName);
- // Parse for margins because the RTB will remove them
- rtf = rtf.Replace("\x95", @"\bullet ");
- Match match = Regex.Match(rtf, @"((\\marg[^\\]+)+)", RegexOptions.Singleline);
- //rtf = rtf.Replace("\\sectd", "");
- //rtf = rtf.Replace("\\sbkpage", "");
- //rtf = rtf.Replace("\\sect", "\\page");
- rtf = Regex.Replace(rtf, @"\\ri[0-9]*(?=[ \\{])", "");
- rtf = Regex.Replace(rtf, @"\\sectd(?=[ \\{])", "");
- rtf = Regex.Replace(rtf, @"\\sbkpage(?=[ \\{])", "");
- rtf = Regex.Replace(rtf, @"\\sect(?=[ \\{])", @"\page");
- rtf = Regex.Replace(rtf, @"\\par(?=[ \\{])", @" <>\par");
- MyRichTextBox.Rtf = rtf; // Allow the RichTextBox to parse the RTF
- rtf = MyRichTextBox.Rtf; // Get the RTF back from the RichTextBox
- // Add the margins to the RTB output
- rtf = Regex.Replace(rtf, @"( |\r\n)<>\\par(?=[\r \\{])", @"\par");
- rtf = Regex.Replace(rtf, @" <>\\f. \\", @"\par\");
- rtf = Regex.Replace(rtf, @" <>", @"\par");
- rtf = Regex.Replace(rtf, @"\\ansi(?=[ \\{])", @"\ansi" + match.Value);
- //rtf = rtf.Replace(@"\ansi\", @"\ansi\" + match.Value);
- // Save the modified rtf to the temporary file
- SaveFile(rtf, tmpName);
- }
- private RichTextBox41 _MyRichTextBox41 = null;
- public RichTextBox41 MyRichTextBox41
- {
- get
- {
- if (_MyRichTextBox41 == null)
- _MyRichTextBox41 = new RichTextBox41();
- return _MyRichTextBox41;
- }
- }
- //private void LoadAndSaveRichTextBox41(string tmpName)
- //{
- // string rtf = LoadFileRaw(tmpName);
- // // Parse for margins because the RTB will remove them
- // rtf = rtf.Replace("\x95", @"\bullet ");
- // Match match = Regex.Match(rtf, @"((\\marg[^\\]+)+)", RegexOptions.Singleline);
- // rtf = Regex.Replace(rtf, @"(? 0)
- Application.DoEvents();
- }
- else
- {
- WordDoc.KillWordApps();
- Application.DoEvents();
- while (WordDoc.WordProcesses.Length > 0)
- Application.DoEvents();
- }
- }
- catch (Exception ex)
- {
- Console.WriteLine("{0} - {1}", ex.GetType().Name, ex.Message);
- }
- }
- private static void DeleteFile(string fName)
- {
- if (File.Exists(fName))
- File.Delete(fName);
- }
- private string LoadFileRaw(string fName)
- {
- try
- {
- FileInfo file = new FileInfo(fName);
- byte[] myBytes = new byte[file.Length];
- using (FileStream fs = file.OpenRead())
- {
- fs.Read(myBytes, 0, (int)file.Length);
- fs.Close();
- }
- StringBuilder sb = new StringBuilder();
- foreach (byte byt in myBytes)
- {
- int iByte = (int)byt;
- sb.Append((char)byt);
- }
- return sb.ToString();
- }
- catch (Exception ex)
- {
- Console.WriteLine("{0} - {1}", ex.GetType().Name, ex.Message);
- Application.DoEvents();
- return LoadFileRaw(fName);
- }
- }
- private void SaveFile(string str, string fName)
- {
- FileInfo file = new FileInfo(fName);
- using (StreamWriter sw = file.CreateText())
- {
- sw.Write(str);
- sw.Close();
- }
- }
- private int SaveWordDoc(string temppath, string stype, string sectName, bool isLandscape)
- {
- ConfigInfo ci = new ConfigInfo(null);
- ci.AddItem("Edit", "Initialized", "true");
- FileInfo myFile = new FileInfo(temppath);
- ci.AddItem("History", "OriginalFileName", myFile.Name);
- return SaveWordDoc(temppath, String.Empty, stype, isLandscape, ci, sectName, myFile.LastWriteTimeUtc);
- }
- private int SaveTheDoc(string temppath, string title, ConfigInfo ci, string ascii, DateTime dtsutc)
- {
- try
- {
- FileStream fs = File.Open(temppath, FileMode.Open, FileAccess.Read, FileShare.None);
- long len = fs.Length + 1;
- byte[] ByteArray = new byte[len];
- int nBytesRead = fs.Read(ByteArray, 0, (int)len);
- fs.Close();
- string t1 = (title == null || title == "") ? null : title;
- using (Document doc = Document.MakeDocument(t1, ByteArray, null, ci == null ? null : ci.ToString(), dtsutc, "Migration", ".Doc"))
- {
- FileInfo tmpFile = new FileInfo(temppath);
- string docfile = temppath.Substring(0, temppath.LastIndexOf(".")) + @".doc";
- if (File.Exists(docfile)) File.Delete(docfile);
- FileInfo doctmpFile = tmpFile.CopyTo(docfile);
- doc.DocAscii = ascii;
- doc.Save();
- File.Delete(docfile);
- return doc.DocID;
- }
- }
- // for an io exception, keep trying
- catch (IOException exio)
- {
- Console.WriteLine("IO: {0} - {1}", exio.GetType().Name, exio.Message);
- frmMain.AddError(exio, "SaveTheDoc('{0}','{1}')", temppath, title);
- Wait(2);
- return 0;
- }
- catch (Exception ex)
- {
- log.Error("Save Word Doc");
- log.ErrorFormat("{0}\r\n\r\n{1}", ex.Message, ex.InnerException);
- frmMain.AddError(ex, "SaveTheDoc('{0}','{1}')", temppath, title);
- return -1;
- }
-
- }
- private int SaveDoc(string temppath, string title, ConfigInfo ci, string ascii, DateTime dtsutc)
- {
- int done = 0;
- int ntry = 0;
- while (done == 0 && ntry < 4)
- {
- ntry++;
- done = SaveTheDoc(temppath, title, ci, ascii, dtsutc);
- }
- return done;
- }
- }
-}
diff --git a/PROMS/DataLoader/ErrorReport.cs b/PROMS/DataLoader/ErrorReport.cs
deleted file mode 100644
index 38726b04..00000000
--- a/PROMS/DataLoader/ErrorReport.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-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 readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
- 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);
- _MyLog.Error(smess);
- }
- }
-}
diff --git a/PROMS/DataLoader/FixItem.cs b/PROMS/DataLoader/FixItem.cs
deleted file mode 100644
index 0888b2da..00000000
--- a/PROMS/DataLoader/FixItem.cs
+++ /dev/null
@@ -1,81 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.IO;
-
-namespace DataLoader
-{
- public class FixItems : List
- {
- public FixItems(FileInfo myFile):base()
- {
- if (!myFile.Exists)
- return;
- FileStream fs = myFile.OpenRead();
- int len = (int) myFile.Length;
- byte [] buffer = new byte[len];
- fs.Read(buffer, 0, len);
- int offset = 0;
- while(offset < len)
- {
- int lFixItem = (int)(buffer[offset]);
- Add(new FixItem(buffer,offset));
- offset += lFixItem + 1;
- }
- }
- }
- public class FixItem
- {
- public FixItem(byte[] buffer, int offset)
- {
- int lFixItem = (int)(buffer[offset]);
- _Section = (char)(buffer[offset + 1]);
- _Step = (int)(buffer[offset + 2]);
- string str = System.Text.Encoding.GetEncoding(1251).GetString(buffer, offset + 3, lFixItem - 2);
- if (str.Contains(" "))
- {
- int index = str.IndexOf(" ");
- _Sequence = str.Substring(0, index);
- _Rev = str.Substring(index + 1);
- }
- else
- _Sequence = str;
- }
- private char _Section;
- public char Section
- {
- get { return _Section; }
- set { _Section = value; }
- }
- private int _Step;
- public int Step
- {
- get { return _Step; }
- set { _Step = value; }
- }
- private string _Sequence;
- public string Sequence
- {
- get { return _Sequence; }
- set { _Sequence = value; }
- }
- private string _Rev;
- public string Rev
- {
- get { return _Rev; }
- set { _Rev = value; }
- }
- private string _RevDate;
- public string RevDate
- {
- get { return _RevDate; }
- set { _RevDate = value; }
- }
- private string _ReviewDate;
- public string ReviewDate
- {
- get { return _ReviewDate; }
- set { _ReviewDate = value; }
- }
- }
-}
diff --git a/PROMS/DataLoader/FolderTreeNode.cs b/PROMS/DataLoader/FolderTreeNode.cs
deleted file mode 100644
index 92775a14..00000000
--- a/PROMS/DataLoader/FolderTreeNode.cs
+++ /dev/null
@@ -1,110 +0,0 @@
-// ========================================================================
-// 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.Collections.Generic;
-using System.Text;
-using VEPROMS.CSLA.Library;
-using Csla;
-using System.Windows.Forms;
-
-namespace DataLoader
-{
- public class FolderTreeNode : TreeNode
- {
- FolderTreeNode(string s) : base(s)
- {
- this.Name="ID:" + s;
- }
- FolderTreeNode(FolderInfo folderinfo)
- : base(folderinfo.Name)
- {
- _folderinfo = folderinfo;
- this.Name = "ID:" + folderinfo.FolderID.ToString();
- }
- private FolderInfo _folderinfo;
- public FolderInfo FolderInfo
- {
- get { return _folderinfo; }
- set
- {
- _folderinfo = value;
- }
- }
- private Dictionary _findTree = null;
- private Dictionary FindTree
- {
- get { return _findTree; }
- set { _findTree = value; }
- }
- public FolderTreeNode FindTreeNode(int folderID)
- {
- if (_findTree != null) return _findTree[folderID];
- return null;
- }
- public static FolderTreeNode BuildTreeList()
- {
- FolderTreeNode root = null;
- FolderInfoList fil = FolderInfoList.Get();
- Dictionary dicMissing = new Dictionary();
- Dictionary dicExists = new Dictionary();
- foreach (FolderInfo fi in fil)
- {
- FolderTreeNode ftp = null;
- if (dicExists.ContainsKey(fi.ParentID))
- {
- ftp = dicExists[fi.ParentID];
- // dicNeedToLoad.Remove(ftp);
- }
- else
- {
- if (fi.ParentID != 0)
- {
- ftp = new FolderTreeNode(fi.ParentID.ToString());
- dicMissing.Add(fi.ParentID, ftp);
- dicExists.Add(fi.ParentID, ftp);
- if (fi.FolderDocVersionCount > 0)
- {
- TreeNode tn = new TreeNode("dummy");
- tn.Tag = "dummy";
- ftp.Nodes.Add(tn);
- }
- }
- }
- FolderTreeNode ft = null;
- if (dicMissing.ContainsKey(fi.FolderID))
- {
- ft = dicMissing[fi.FolderID];
- ft.FolderInfo = fi;
- dicMissing.Remove(fi.FolderID);
- }
- else
- {
- ft = new FolderTreeNode(fi);
- if (fi.FolderDocVersionCount > 0)
- {
- TreeNode tn = new TreeNode("dummy");
- tn.Tag = "dummy";
- ft.Nodes.Add(tn);
- }
- dicExists.Add(fi.FolderID, ft);
- //dicNeedToLoad.Add(ft);
- }
- ft.Tag = fi;
- if (fi.ParentID == 0)
- root = ft;
- else
- ftp.Nodes.Add(ft);
- }
- root.FindTree = dicExists;
- return root;
- }
- }
-}
-
diff --git a/PROMS/DataLoader/Formats.cs b/PROMS/DataLoader/Formats.cs
deleted file mode 100644
index 1a0c13bf..00000000
--- a/PROMS/DataLoader/Formats.cs
+++ /dev/null
@@ -1,250 +0,0 @@
-// ========================================================================
-// 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
- {
- //public string _FmtAllPath;
- //public string _GenmacAllPath;
- //private FormatInfoList _AllFormats;
-
- //public FormatInfoList AllFormats
- //{
- // get
- // {
- // if (_AllFormats == null)
- // _AllFormats = FormatInfoList.Get();
- // return _AllFormats;
- // }
- //}
- //private Dictionary _LookupFormats;
- //public Dictionary LookupFormats
- //{
- // get
- // {
- // if (_LookupFormats == null)
- // {
- // _LookupFormats = new Dictionary();
- // foreach (FormatInfo myFormat in AllFormats)
- // {
- // _LookupFormats.Add(myFormat.Name, myFormat.FormatID);
- // }
- // }
- // return _LookupFormats;
- // }
- //}
- //private Format AddFormatToDB(Format parent, string format, bool issub, DateTime Dts, string Userid)
- //{
- // string fmtdata = null;
- // string genmacdata = null;
- // XmlDocument xd = null;
-
- // //string path = "c:\\development\\fmtall\\" + format + "all.xml";
- // string path = _FmtAllPath + "\\" + format + "all.xml";
- // if (File.Exists(path))
- // {
- // try
- // {
- // StreamReader srf = new StreamReader(path);
- // xd = new XmlDocument();
- // xd.Load(srf);
- // //xd.Load(path);
- // fmtdata = xd.OuterXml;
- // }
- // catch (Exception ex)
- // {
- // frmMain.AddError(ex, "AddFormatToDB('{0}','{1}')", parent.Name, path);
- // return null;
- // }
- // }
-
- // // Do we need genmac - only if non-subformat
- // if (!issub)
- // {
- // //path = "c:\\development\\genmacall\\" + format + ".svg";
- // path = _GenmacAllPath + "\\" + format + ".svg";
- // if (File.Exists(path))
- // {
- // try
- // {
- // StreamReader sr = new StreamReader(path);
- // XmlDocument xdg = new XmlDocument();
- // xdg.Load(sr);
- // //xdg.Load(path);
- // genmacdata = xdg.OuterXml;
- // }
- // catch (Exception ex)
- // {
- // frmMain.AddError(ex, "AddFormatToDB('{0}','{1}')", parent.Name, path);
- // return null;
- // }
- // }
- // }
- // // 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 = null;
- // try
- // {
- // if (!LookupFormats.ContainsKey(fname))
- // {
- // rec = Format.MakeFormat(parent, fname, nmattr, fmtdata, genmacdata, Dts, Userid);
- // }
- // else
- // {
- // rec = Format.Get(LookupFormats[fname]);
- // rec.Data = fmtdata;
- // rec.GenMac = genmacdata;
- // rec = rec.Save();
- // }
- // }
- // catch (Exception ex)
- // {
- // frmMain.AddError(ex, "AddFormatToDB-make format('{0}','{1}')", parent.Name, path);
- // }
- // return rec;
- //}
- //public void LoadAllFormats()
- //{
- // Format basefmt = null;
- // Format parent = null;
-
-
- // // Load base format.
- // basefmt = AddFormatToDB(null, "base", false, DateTime.Now, "Migration");
- // if (basefmt == null) return;
- // // 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(_FmtAllPath); //(@"c:\development\fmtall");
- // FileInfo[] fis = di.GetFiles("*.xml");
-
- // foreach (FileInfo fi in fis)
- // {
- // //if (fi.Name.ToUpper() == "WCN2ALL.XML"|| fi.Name.ToUpper() == "OHLPALL.XML")
- // //{
- // 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.
- // try
- // {
- // parent = AddFormatToDB(basefmt, fmtname, issub, DateTime.Now, "Migration");
- // if (parent != null)
- // {
- // // now see if there are any subformats associated with this, if so
- // // add them here...
- // DirectoryInfo sdi = new DirectoryInfo(_FmtAllPath); //("c:\\development\\fmtall");
- // FileInfo[] sfis = di.GetFiles(fmtname + "_*.xml");
- // foreach (FileInfo sfi in sfis)
- // {
- // string nm = sfi.Name.Substring(0, sfi.Name.Length - 7);
- // //Console.WriteLine("Processing {0}", sfi.Name);
- // frmMain.Status = string.Format("Processing Format {0}", sfi.Name);
- // try
- // {
- // AddFormatToDB(parent, nm, true, DateTime.Now, "Migration");
- // }
- // catch (Exception ex)
- // {
- // frmMain.AddError(ex, "LoadAllFormats() '{0}'", sfi.Name);
- // //Console.WriteLine("{0} - {1}", ex.GetType().Name, ex.Message);
- // }
- // }
- // }
- // }
- // catch (Exception ex)
- // {
- // frmMain.AddError(ex, "LoadAllFormats() '{0}'", fi.Name);
- // //Console.WriteLine("{0} - {1}", ex.GetType().Name, ex.Message);
- // }
- // }
- // //}
- // }
- //}
- public FormatInfo 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 = null;
- try
- {
- part2 = format.Substring(format.LastIndexOf(' ') + 1, 2);
- }
- catch
- {
- }
- format = part1 + part2;
-
- // get the parent format's id (for example, AEP for AEP00).
- parent = Format.GetByParentID_Name(baseparent.FormatID, part1);
- }
- else
- parent = baseparent;
-
- // see if the format has been added, if not go get it.
- rec = Format.GetByParentID_Name(parent.FormatID, format);
- // JSJ - 02/04/10 this fixes cases where a subformat is no longer available,
- // default to the parent format
- if (rec == null)
- rec = parent;
- }
- catch (Exception ex)
- {
- log.ErrorFormat("Error getting xml version of format {0}", ex.Message);
- frmMain.AddError(ex, "GetFormat('{0}')", format);
- }
- FormatInfo recInfo = FormatInfo.Get(rec.FormatID);
- return recInfo;
- }
-
- }
-}
\ No newline at end of file
diff --git a/PROMS/DataLoader/Formats.cs.org b/PROMS/DataLoader/Formats.cs.org
deleted file mode 100644
index 552d14e8..00000000
--- a/PROMS/DataLoader/Formats.cs.org
+++ /dev/null
@@ -1,199 +0,0 @@
-// ========================================================================
-// 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 = "c:\\development\\fmtall\\" + format + "all.xml";
- if (File.Exists(path))
- {
- try
- {
- StreamReader srf = new StreamReader(path);
- xd = new XmlDocument();
- xd.Load(srf);
- //xd.Load(path);
- fmtdata = xd.OuterXml;
- }
- catch(Exception ex)
- {
- frmMain.AddError(ex, "AddFormatToDB('{0}','{1}')", parent.Name, path);
- return null;
- }
- }
-
- // Do we need genmac - only if non-subformat
- if (!issub)
- {
- path = "c:\\development\\genmacall\\" + format + ".svg";
- if (File.Exists(path))
- {
- try
- {
- StreamReader sr = new StreamReader(path);
- XmlDocument xdg = new XmlDocument();
- xdg.Load(sr);
- //xdg.Load(path);
- genmacdata = xdg.OuterXml;
- }
- catch (Exception ex)
- {
- frmMain.AddError(ex, "AddFormatToDB('{0}','{1}')", parent.Name, path);
- return null;
- }
- }
- }
- // 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 = null;
- try
- {
- rec = Format.MakeFormat(parent, fname, nmattr, fmtdata, genmacdata, Dts, Userid);
- }
- catch (Exception ex)
- {
- frmMain.AddError(ex, "AddFormatToDB-make format('{0}','{1}')", parent.Name, path);
- }
- return rec;
- }
- public void LoadAllFormats()
- {
- Format basefmt = null;
- Format parent = null;
-
- // Load base format.
- basefmt = AddFormatToDB(null, "base", false, DateTime.Now, "Migration");
- if (basefmt == null) return;
- // 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(@"c:\development\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.
- try
- {
- parent = AddFormatToDB(basefmt, fmtname, issub, DateTime.Now, "Migration");
- if (parent != null)
- {
- // now see if there are any subformats associated with this, if so
- // add them here...
- DirectoryInfo sdi = new DirectoryInfo("c:\\development\\fmtall");
- FileInfo[] sfis = di.GetFiles(fmtname + "_*.xml");
- foreach (FileInfo sfi in sfis)
- {
- string nm = sfi.Name.Substring(0, sfi.Name.Length - 7);
- //Console.WriteLine("Processing {0}", sfi.Name);
- frmMain.Status = string.Format("Processing Format {0}", sfi.Name);
- try
- {
- AddFormatToDB(parent, nm, true, DateTime.Now, "Migration");
- }
- catch (Exception ex)
- {
- frmMain.AddError(ex, "LoadAllFormats() '{0}'", sfi.Name);
- //Console.WriteLine("{0} - {1}", ex.GetType().Name, ex.Message);
- }
- }
- }
- }
- catch (Exception ex)
- {
- frmMain.AddError(ex, "LoadAllFormats() '{0}'", fi.Name);
- //Console.WriteLine("{0} - {1}", ex.GetType().Name, ex.Message);
- }
- }
- }
- }
- public FormatInfo 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.GetByParentID_Name(baseparent.FormatID, part1);
- }
- else
- parent = baseparent;
-
- // see if the format has been added, if not go get it.
- rec = Format.GetByParentID_Name(parent.FormatID, format);
- // JSJ - 02/04/10 this fixes cases where a subformat is no longer available,
- // default to the parent format
- if (rec == null)
- rec = parent;
- }
- catch (Exception ex)
- {
- log.ErrorFormat("Error getting xml version of format {0}", ex.Message);
- frmMain.AddError(ex, "GetFormat('{0}')", format);
- }
- FormatInfo recInfo = FormatInfo.Get(rec.FormatID);
- return recInfo;
- }
-
- }
-}
\ No newline at end of file
diff --git a/PROMS/DataLoader/GroupProp.Designer.cs b/PROMS/DataLoader/GroupProp.Designer.cs
deleted file mode 100644
index 87548d7f..00000000
--- a/PROMS/DataLoader/GroupProp.Designer.cs
+++ /dev/null
@@ -1,110 +0,0 @@
-namespace DataLoader
-{
- partial class GroupProp
- {
- ///
- /// Required designer variable.
- ///
- private System.ComponentModel.IContainer components = null;
-
- ///
- /// Clean up any resources being used.
- ///
- /// true if managed resources should be disposed; otherwise, false.
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Windows Form Designer generated code
-
- ///
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- ///
- private void InitializeComponent()
- {
- this.splitContainer1 = new System.Windows.Forms.SplitContainer();
- this.lbGroups = new System.Windows.Forms.ListBox();
- this.pg = new System.Windows.Forms.PropertyGrid();
- this.btnSave = new System.Windows.Forms.Button();
- this.splitContainer1.Panel1.SuspendLayout();
- this.splitContainer1.Panel2.SuspendLayout();
- this.splitContainer1.SuspendLayout();
- this.SuspendLayout();
- //
- // splitContainer1
- //
- this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
- this.splitContainer1.Location = new System.Drawing.Point(0, 0);
- this.splitContainer1.Name = "splitContainer1";
- //
- // splitContainer1.Panel1
- //
- this.splitContainer1.Panel1.Controls.Add(this.lbGroups);
- //
- // splitContainer1.Panel2
- //
- this.splitContainer1.Panel2.Controls.Add(this.pg);
- this.splitContainer1.Panel2.Controls.Add(this.btnSave);
- this.splitContainer1.Size = new System.Drawing.Size(629, 290);
- this.splitContainer1.SplitterDistance = 209;
- this.splitContainer1.TabIndex = 0;
- //
- // lbGroups
- //
- this.lbGroups.Dock = System.Windows.Forms.DockStyle.Fill;
- this.lbGroups.FormattingEnabled = true;
- this.lbGroups.Location = new System.Drawing.Point(0, 0);
- this.lbGroups.Name = "lbGroups";
- this.lbGroups.Size = new System.Drawing.Size(209, 290);
- this.lbGroups.TabIndex = 0;
- this.lbGroups.Click += new System.EventHandler(this.lbGroups_Click);
- //
- // pg
- //
- this.pg.Dock = System.Windows.Forms.DockStyle.Fill;
- this.pg.Location = new System.Drawing.Point(0, 23);
- this.pg.Name = "pg";
- this.pg.Size = new System.Drawing.Size(416, 267);
- this.pg.TabIndex = 0;
- //
- // btnSave
- //
- this.btnSave.Dock = System.Windows.Forms.DockStyle.Top;
- this.btnSave.Location = new System.Drawing.Point(0, 0);
- this.btnSave.Name = "btnSave";
- this.btnSave.Size = new System.Drawing.Size(416, 23);
- this.btnSave.TabIndex = 1;
- this.btnSave.Text = "Save";
- this.btnSave.UseVisualStyleBackColor = true;
- this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
- //
- // GroupProp
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(629, 290);
- this.Controls.Add(this.splitContainer1);
- this.Name = "GroupProp";
- this.Text = "GroupProp";
- this.Load += new System.EventHandler(this.GroupProp_Load);
- this.splitContainer1.Panel1.ResumeLayout(false);
- this.splitContainer1.Panel2.ResumeLayout(false);
- this.splitContainer1.ResumeLayout(false);
- this.ResumeLayout(false);
-
- }
-
- #endregion
-
- private System.Windows.Forms.SplitContainer splitContainer1;
- private System.Windows.Forms.ListBox lbGroups;
- private System.Windows.Forms.PropertyGrid pg;
- private System.Windows.Forms.Button btnSave;
- }
-}
\ No newline at end of file
diff --git a/PROMS/DataLoader/GroupProp.cs b/PROMS/DataLoader/GroupProp.cs
deleted file mode 100644
index 3b467dc3..00000000
--- a/PROMS/DataLoader/GroupProp.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.Text;
-using System.Windows.Forms;
-using Csla;
-using VEPROMS.CSLA.Library;
-
-namespace DataLoader
-{
- public partial class GroupProp : Form
- {
- GroupInfoList glst;
- Group grp;
- public GroupProp()
- {
- InitializeComponent();
- }
- private void GroupProp_Load(object sender, EventArgs e)
- {
- lbGroups.Dock = DockStyle.Fill;
- glst = GroupInfoList.Get();
- lbGroups.DataSource = glst;
- lbGroups.DisplayMember = "GroupName";
- lbGroups.ValueMember = "GID";
- SetGroup();
- }
- private void lbGroups_Click(object sender, EventArgs e)
- {
- SetGroup();
- Console.WriteLine("Group ID = {0}", lbGroups.SelectedValue);
- }
- private void SetGroup()
- {
- grp = glst[lbGroups.SelectedIndex].Get();
- pg.SelectedObject = grp;
- }
- private void btnSave_Click(object sender, EventArgs e)
- {
- if (!grp.IsSavable) ErrorRpt.ErrorReport(grp);
- grp.Save();
- }
- }
-}
\ No newline at end of file
diff --git a/PROMS/DataLoader/GroupProp.resx b/PROMS/DataLoader/GroupProp.resx
deleted file mode 100644
index 19dc0dd8..00000000
--- a/PROMS/DataLoader/GroupProp.resx
+++ /dev/null
@@ -1,120 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
\ No newline at end of file
diff --git a/PROMS/DataLoader/LibDoc.cs b/PROMS/DataLoader/LibDoc.cs
deleted file mode 100644
index 0bfb131a..00000000
--- a/PROMS/DataLoader/LibDoc.cs
+++ /dev/null
@@ -1,137 +0,0 @@
-// ========================================================================
-// 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.IO;
-using System.Text;
-using Volian.MSWord;
-using vlnObjectLibrary;
-using vlnServerLibrary;
-using Org.Mentalis.Files;
-
-namespace DataLoader
-{
- public partial class Loader
- {
-
- private void MigrateLibDocs(OleDbConnection cn, string pth, bool appending)
- {
- // MessageBox.Show("Before LibDocs");
- frmMain.AddInfo("Before MigrateLibDocs{0}\r\n{1}", GC.GetTotalMemory(true), VEPROMS.CSLA.Library.CSLACache.UsageAll);
- // Get all of the library documents - the first list has the entire list of files
- // found within the rtffiles folder, the second list contains usages from the 'tran'
- // file. During processing for procedures/sections occurs, the used library documents
- // will be migrated. After that, any remaining library documents will be added to
- // the section table without a reference from the structuretbl.
- Dictionary dicLibDocSect = new Dictionary();
- VEPROMS.CSLA.Library.DocumentInfoList docList = VEPROMS.CSLA.Library.DocumentInfoList.Get();
- frmMain.UpdateLabelsLibDocs(0, 0);
- if (Directory.Exists(pth + "\\rtffiles"))
- {
- DirectoryInfo di = new DirectoryInfo(pth + "\\RTFFILES");
- FileInfo[] fis = di.GetFiles("DOC_*.LIB");
- frmMain.UpdateLabelsSetProc(fis.Length);
- foreach (FileInfo fi in fis)
- {
- string fName = fi.Name.Substring(0, 8).ToUpper();
- frmMain.UpdateLabelsLibDocs(1, 0);
- if (appending)
- {
- foreach (VEPROMS.CSLA.Library.DocumentInfo docInfo in docList)
- {
- if(docInfo.Config.Contains(string.Format("\"{0}.LIB\"", fName)))
- dicLibDocSect[fName] = docInfo.DocID;
- }
- }
- else
- dicLibDocSect[fName] = MigrateLibDoc(fi);
- }
- }
- dicLibDocRef = new Dictionary();
- 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();
- da_doc.Fill(ds_doc);
- frmMain.UpdateLabelsSetSect(ds_doc.Tables[0].Rows.Count);
- foreach (DataRow dr_doc in ds_doc.Tables[0].Rows)
- {
- frmMain.UpdateLabelsLibDocs(0, 1);
- string key = dr_doc["FROMNUMBER"].ToString().PadRight(20) + TextConvert.ConvertSeq(dr_doc["FROMSEQUEN"].ToString()).PadRight(10);
- if (!dicLibDocSect.ContainsKey(dr_doc["TONUMBER"].ToString().ToUpper()))
- log.ErrorFormat("Error setting library document references: {0}", dr_doc["TONUMBER"].ToString().ToUpper());
- else
- dicLibDocRef[key] = dicLibDocSect[dr_doc["TONUMBER"].ToString().ToUpper()];
- }
- da_doc.Dispose();
- frmMain.AddInfo("After MigrateLibDocs{0}\r\n{1}", GC.GetTotalMemory(true), VEPROMS.CSLA.Library.CSLACache.UsageAll);
- // MessageBox.Show("After LibDocs");
- }
- private int MigrateLibDoc(FileInfo fi)
- {
- ConfigInfo ci = new ConfigInfo(null);
- string title = null; // for docname, remove the '.lib', i.e. substring(0,8)
- ci.AddItem("Edit", "Initialized", "true");
- ci.AddItem("History", "OriginalFileName", fi.Name);
- string tmpRtfFileName = GetLibDocData(fi, ci, ref title);
- int Docid = SaveWordDoc(tmpRtfFileName, title, null, false, ci, string.Empty,fi.LastWriteTimeUtc);
- File.Delete(tmpRtfFileName);
- return Docid;
- }
- private string LoadFromLib(BinaryReader br)
- {
- int nchar = br.ReadInt16();
- if (nchar > 0)
- {
- string tmp = new string(br.ReadChars(nchar));
- return tmp.Substring(0, tmp.Length - 1); // remove null at end.
- }
- return null;
- }
- private string GetLibDocData(FileInfo fi, ConfigInfo ci, ref string title)
- {
- title = null;
- // get the number, title, etc from the file.
- // use the path to open the file & read the title & comment
- DateTime dts = fi.LastWriteTimeUtc;
- FileStream fs = fi.Open(FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
- BinaryReader br = new BinaryReader(fs, System.Text.ASCIIEncoding.ASCII);
- string tmpRtfFileName = Path.GetTempFileName();
- FileStream tmpfile = new FileStream(tmpRtfFileName, FileMode.Create);
- BinaryWriter bw = new BinaryWriter(tmpfile, System.Text.Encoding.ASCII);
- int cntPage = br.ReadInt16();
- if (cntPage != -1)
- { // Not End of File
- ci.AddItem("Section", "NumPages", cntPage.ToString());
- string ldtitle = LoadFromLib(br);
- if (ldtitle != null && ldtitle != "") title = ldtitle;
- ci.AddItem("LibDoc", "Comment", LoadFromLib(br));
- long l = br.BaseStream.Length - br.BaseStream.Position;
- byte[] buf = new byte[l];
- br.Read(buf, 0, (int)l);
- bw.Write(buf, 0, (int)l);
- br.Close();
- fs.Close();
- bw.Close();
- tmpfile.Close();
- WaitMS(wms); // give it some time to close the tempfile before adding section
- File.SetLastWriteTimeUtc(tmpRtfFileName, dts);
- }
- return tmpRtfFileName;
- }
- }
-
-}
\ No newline at end of file
diff --git a/PROMS/DataLoader/LibDoc.cs.bak b/PROMS/DataLoader/LibDoc.cs.bak
deleted file mode 100644
index 1b37f99d..00000000
--- a/PROMS/DataLoader/LibDoc.cs.bak
+++ /dev/null
@@ -1,122 +0,0 @@
-// ========================================================================
-// 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.IO;
-using System.Text;
-using Volian.MSWord;
-using vlnObjectLibrary;
-using vlnServerLibrary;
-using Org.Mentalis.Files;
-
-namespace DataLoader
-{
- public partial class Loader
- {
-
- private void MigrateLibDocs(OleDbConnection cn, string pth)
- {
- // Get all of the library documents - the first list has the entire list of files
- // found within the rtffiles folder, the second list contains usages from the 'tran'
- // file. During processing for procedures/sections occurs, the used library documents
- // will be migrated. After that, any remaining library documents will be added to
- // the section table without a reference from the structuretbl.
- Dictionary dicLibDocSect = new Dictionary();
- frmMain.UpdateLabelsLibDocs(0, 0);
- if (Directory.Exists(pth + "\\rtffiles"))
- {
- DirectoryInfo di = new DirectoryInfo(pth + "\\RTFFILES");
- FileInfo[] fis = di.GetFiles("DOC_*.LIB");
- frmMain.UpdateLabelsSetProc(fis.Length);
- foreach (FileInfo fi in fis)
- {
- frmMain.UpdateLabelsLibDocs(1, 0);
- dicLibDocSect[fi.Name.Substring(0, 8).ToUpper()] = MigrateLibDoc(fi);
- }
- }
- dicLibDocRef = new Dictionary();
- 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();
- da_doc.Fill(ds_doc);
- frmMain.UpdateLabelsSetSect(ds_doc.Tables[0].Rows.Count);
- foreach (DataRow dr_doc in ds_doc.Tables[0].Rows)
- {
- frmMain.UpdateLabelsLibDocs(0, 1);
- string key = dr_doc["FROMNUMBER"].ToString().PadRight(20) + dr_doc["FROMSEQUEN"].ToString().PadRight(10);
- if (!dicLibDocSect.ContainsKey(dr_doc["TONUMBER"].ToString().ToUpper()))
- log.ErrorFormat("Error setting library document references: {0}", dr_doc["TONUMBER"].ToString().ToUpper());
- else
- dicLibDocRef[key] = dicLibDocSect[dr_doc["TONUMBER"].ToString().ToUpper()];
- }
- da_doc.Dispose();
- }
- private int MigrateLibDoc(FileInfo fi)
- {
- ConfigInfo ci = new ConfigInfo(null);
- string title = null; // for docname, remove the '.lib', i.e. substring(0,8)
- DateTime dts = DateTime.Now;
- ci.AddItem("Edit", "Initialized", "true");
- string tmpRtfFileName = GetLibDocData(fi, ci, ref title);
- int Docid = SaveWordDoc(tmpRtfFileName, title, null, ci, string.Empty);
- File.Delete(tmpRtfFileName);
- return Docid;
- }
- private string LoadFromLib(BinaryReader br)
- {
- int nchar = br.ReadInt16();
- if (nchar > 0)
- {
- string tmp = new string(br.ReadChars(nchar));
- return tmp.Substring(0, tmp.Length - 1); // remove null at end.
- }
- return null;
- }
- private string GetLibDocData(FileInfo fi, ConfigInfo ci, ref string title)
- {
- title = null;
- // get the number, title, etc from the file.
- // use the path to open the file & read the title & comment
- DateTime dts = fi.LastWriteTimeUtc;
- FileStream fs = fi.Open(FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
- BinaryReader br = new BinaryReader(fs, System.Text.ASCIIEncoding.ASCII);
- string tmpRtfFileName = Path.GetTempFileName();
- FileStream tmpfile = new FileStream(tmpRtfFileName, FileMode.Create);
- BinaryWriter bw = new BinaryWriter(tmpfile, System.Text.Encoding.ASCII);
- int cntPage = br.ReadInt16();
- if (cntPage != -1)
- { // Not End of File
- ci.AddItem("Section", "NumPages", cntPage.ToString());
- string ldtitle = LoadFromLib(br);
- if (ldtitle != null && ldtitle != "") title = ldtitle;
- ci.AddItem("LibDoc", "Comment", LoadFromLib(br));
- long l = br.BaseStream.Length - br.BaseStream.Position;
- byte[] buf = new byte[l];
- br.Read(buf, 0, (int)l);
- bw.Write(buf, 0, (int)l);
- br.Close();
- fs.Close();
- bw.Close();
- tmpfile.Close();
- WaitMS(wms); // give it some time to close the tempfile before adding section
- File.SetLastWriteTimeUtc(tmpRtfFileName, dts);
- }
- return tmpRtfFileName;
- }
- }
-
-}
\ No newline at end of file
diff --git a/PROMS/DataLoader/LoadConfig.cs b/PROMS/DataLoader/LoadConfig.cs
deleted file mode 100644
index 2b371cdd..00000000
--- a/PROMS/DataLoader/LoadConfig.cs
+++ /dev/null
@@ -1,243 +0,0 @@
-// ========================================================================
-// 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.IO;
-using System.Text;
-using VEPROMS.CSLA.Library;
-
-namespace Config
-{
- public class ConfigFile
- {
- #region Log4Net
- private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
- #endregion
- #region MigrateStrings
- // the following lists are used for storing the element and attribute names
- // for migrating of ini & cfg files. The names stored in these lists are
- // those that should be migrated. If not in this list, the data (either element
- // or attribute name) is prefaced with a 'z'. At some point in the future, those
- // names with a 'z' will be removed.
- public List listIni_EleName = new List();
- public List listIni_AttrName = new List();
- private void SetIniEleName()
- {
- // veproms.ini
- listIni_EleName.Add("graphics");
- listIni_EleName.Add("color");
- listIni_EleName.Add("print");
- listIni_EleName.Add("startup");
- listIni_EleName.Add("data integrity");
- listIni_EleName.Add("wordprocessor");
- listIni_EleName.Add("procedurelisttabstops");
-
- // proc.ini
- listIni_EleName.Add("rodefaults");
- listIni_EleName.Add("display");
- listIni_EleName.Add("backgrounddefaults");
- listIni_EleName.Add("unit");
- listIni_EleName.Add("applicability");
- listIni_EleName.Add("procedureset");
-
- // roapp.ini
- listIni_EleName.Add("roapp");
-
- // .cfg
- listIni_EleName.Add("spelldictionary");
- // listIni_EleName.Add("wordprocessor"); - already in here.
- }
-
- private void SetIniAttrName()
- {
- //veproms.ini
- listIni_AttrName.Add("defaultext");
- listIni_AttrName.Add("ro");
- listIni_AttrName.Add("editbackground");
- listIni_AttrName.Add("black");
- listIni_AttrName.Add("blue");
- listIni_AttrName.Add("green");
- listIni_AttrName.Add("cyan");
- listIni_AttrName.Add("red");
- listIni_AttrName.Add("magenta");
- listIni_AttrName.Add("brown");
- listIni_AttrName.Add("lightgray");
- listIni_AttrName.Add("darkgray");
- listIni_AttrName.Add("ligthblue");
- listIni_AttrName.Add("lightgreen");
- listIni_AttrName.Add("lightcyan");
- listIni_AttrName.Add("lightred");
- listIni_AttrName.Add("lightmagenta");
- listIni_AttrName.Add("yellow");
- listIni_AttrName.Add("white");
- listIni_AttrName.Add("underlinewidth");
- listIni_AttrName.Add("verticalOffset");
- listIni_AttrName.Add("strokewidth");
- listIni_AttrName.Add("strokewidthbold");
- listIni_AttrName.Add("messageboxtitle");
- listIni_AttrName.Add("messagefile");
- listIni_AttrName.Add("enableindexcheck");
- listIni_AttrName.Add("wordwrap");
- listIni_AttrName.Add("procedurenumbertab");
- listIni_AttrName.Add("proceduretitletab");
-
- // proc.ini
- listIni_AttrName.Add("setpoint");
- listIni_AttrName.Add("graphics");
- listIni_AttrName.Add("ropath");
- listIni_AttrName.Add("display");
- listIni_AttrName.Add("sectiontitle");
- listIni_AttrName.Add("sectionnumber");
- listIni_AttrName.Add("number");
- listIni_AttrName.Add("othernumber");
- listIni_AttrName.Add("name");
- listIni_AttrName.Add("othername");
- listIni_AttrName.Add("text");
- listIni_AttrName.Add("othertext");
- listIni_AttrName.Add("id");
- listIni_AttrName.Add("otherid");
- listIni_AttrName.Add("procedurenumber");
- listIni_AttrName.Add("masterdir");
-
-
- // roapp.ini
- listIni_AttrName.Add("extention"); // NOTE MIS-SPELLING was in 16-bit program!
-
- // .cfg
- listIni_AttrName.Add("custom");
- listIni_AttrName.Add("page");
- listIni_AttrName.Add("toolbar");
- listIni_AttrName.Add("paragraph");
- listIni_AttrName.Add("ruler");
- listIni_AttrName.Add("userphone1");
- listIni_AttrName.Add("userphone2");
- listIni_AttrName.Add("userloc1");
- listIni_AttrName.Add("userloc2");
- }
- #endregion
- #region LoadDataCode
- public ConfigFile()
- {
- }
- public void LoadUsrCfg(User user, string vepromspath)
- {
- string cfgpath = vepromspath + "\\config";
- if (!Directory.Exists(cfgpath))
- {
- log.Info("No user cfgs found in config directory - did not migrate any user cfgs");
- return;
- }
- DirectoryInfo di = new DirectoryInfo(cfgpath);
- FileInfo[] fis = di.GetFiles("*.cfg");
-
- foreach (FileInfo fi in fis)
- {
- string cfgname = fi.Name.Substring(0, fi.Name.IndexOf("."));
- if (cfgname.ToUpper() == user.UserID.ToUpper())
- {
- // Get Users table fields by reading the cfg file into a buffer & looking
- // for the UserNetworkId and UserName fields.
- StreamReader myReader = new StreamReader(fi.FullName);
- string sLine;
- string UserLogin = null;
- string UserName = null;
- int indx = -1;
- while ((sLine = myReader.ReadLine()) != null && (UserLogin == null || UserName == null))
- {
- if (sLine.Length > 0 && sLine.Substring(0, 1) != ";")
- {
- if ((indx = sLine.ToLower().IndexOf("usernetworkid")) >= 0)
- {
- indx = sLine.IndexOf("=", indx + 13);
- UserLogin = sLine.Substring(indx + 1, sLine.Length - indx - 1).Trim();
- }
- else if ((indx = sLine.ToLower().IndexOf("username")) >= 0)
- {
- indx = sLine.IndexOf("=", indx + 8);
- UserName = sLine.Substring(indx + 1, sLine.Length - indx - 1).Trim();
- }
- }
- }
- myReader.Close();
-
- // get the xml to set the config field
- XmlDocument d = IniToXml(fi.FullName);
- user.Config = d == null ? null : d.InnerXml;
- user.UserLogin = UserLogin;
- user.UserName = UserName;
- user.CFGName = cfgname;
- break;
- }
- }
- }
-
- public XmlDocument LoadSystemIni(string vepromspath)
- {
- string inipath = vepromspath + "\\veproms.ini";
- if (!File.Exists(inipath))
- {
- log.InfoFormat("Did not migrate {0} - file not found", inipath);
- return null;
- }
- 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;
- }
-
- public XmlDocument LoadRoAppIni(string ropath)
- {
- string inipath = ropath + "\\roapp.ini";
- // not an error if it does not exist - just return null.
- if (!File.Exists(inipath)) return null;
-
- XmlDocument d = IniToXml(inipath);
-
- return d;
- }
-
- public XmlDocument IniToXml(string path)
- {
- FileInfo fi = new FileInfo(path);
- if (fi.Exists)
- {
- PrivateProfile ppCfg;
- if (listIni_AttrName == null || listIni_AttrName.Count == 0) SetIniAttrName();
- if (listIni_EleName == null || listIni_EleName.Count == 0) SetIniEleName();
- ppCfg = new PrivateProfile(path, listIni_EleName, listIni_AttrName);
- return ppCfg.XML();
- }
- return null;
- }
- #endregion
- }
-}
\ No newline at end of file
diff --git a/PROMS/DataLoader/LoadTreeDB.cs b/PROMS/DataLoader/LoadTreeDB.cs
deleted file mode 100644
index fd7f9b43..00000000
--- a/PROMS/DataLoader/LoadTreeDB.cs
+++ /dev/null
@@ -1,392 +0,0 @@
-// ========================================================================
-// 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.IO;
-using System.Text;
-using VEPROMS.CSLA.Library;
-using vlnObjectLibrary;
-using vlnServerLibrary;
-using Org.Mentalis.Files;
-using Config;
-using Utils;
-
-namespace DataLoader
-{
- public partial class Loader
- {
- private static List _DataPaths = null;
- public static List DataPaths
- {
- get
- {
- if (_DataPaths == null)
- {
- _DataPaths = new List();
- string sCfg = Environment.GetEnvironmentVariable("veconfig");
- IniReader cfg = new IniReader(sCfg);
- // Get DataPath
- string sDP = cfg.ReadString("menu", "DataPath");
- // Split DataPath into directories
- // Get the current list of folders so that if it already exists, just get the 'Folder', otherwise
- // make it. It was done this way because there was no way to get the Folder given a name/Title.
- foreach (string s1 in sDP.Split(";".ToCharArray()))
- {
- if (s1.Length > 0)
- {
- string[] s2 = s1.Split(",".ToCharArray());
- _DataPaths.Add( s2[0]);
- }
- }
- }
- return Loader._DataPaths;
- }
- }
- public List vlnDataPathFolders() // was vlnDataPath
- {
- List dpf = new List();
- // Get path to config file
- string sCfg = Environment.GetEnvironmentVariable("veconfig");
- IniReader cfg = new IniReader(sCfg);
- // Get DataPath
- string sDP = cfg.ReadString("menu", "DataPath");
- // Split DataPath into directories
-
- // Get the current list of folders so that if it already exists, just get the 'Folder', otherwise
- // make it. It was done this way because there was no way to get the Folder given a name/Title.
- FolderInfoList fil = FolderInfoList.Get();
-
- foreach (string s1 in sDP.Split(";".ToCharArray()))
- {
- if (s1.Length > 0)
- {
- string[] s2 = s1.Split(",".ToCharArray());
- Folder fld = GetFolderFromName(s2[1], s2[0], fil);
- if (fld == null)
- fld = Folder.MakeFolder(sysFolder, dbConn, s2[1], s2[0], FolderName(s2[0]), null, null, DateTime.Now, "Migration");
- dpf.Add(fld);
- }
- }
- return dpf;
- }
- private Folder GetFolderFromName(string name, string title, FolderInfoList fil)
- {
- Folder fld = null;
- foreach (FolderInfo fi in fil)
- {
- string fi_Title = fi.Title.TrimEnd('\\');
- //if (fi.Name.ToUpper() == name.ToUpper() && fi.Title.ToUpper() == title.ToUpper())
- if (fi.Name.ToUpper() == name.ToUpper() && fi_Title.ToUpper() == title.ToUpper())
- {
- fld = Folder.Get(fi.FolderID);
- return fld;
- }
- }
- return null;
- }
- private string FolderName(string Path)
- {
- int ind = Path.LastIndexOf("\\");
- if (ind == Path.Length-1 || ind < 0) return Path;
- return Path.Substring(ind + 1);
- }
- private DocVersion GetDocVersionFromName(Folder fld, string f)
- {
- DocVersion dv = null;
- DocVersionInfoList dvil = DocVersionInfoList.GetByFolderID(fld.FolderID);
- foreach (DocVersionInfo dvi in dvil)
- {
- if (dvi.Name.ToUpper() == f.ToUpper())
- {
- dv = DocVersion.Get(dvi.VersionID);
- return dv;
- }
- }
- return null;
- }
- private object cslaObject(vlnObject vb, Connection dbConn, Object parfld, TreeNode tn)
- {
- switch (vb.Type)
- {
- case "plant":
- case "set":
- // if folder exists... get the Folder object, otherwise create it.
- FolderInfoList fil = FolderInfoList.Get();
- Folder fld = GetFolderFromName(vb.Title, vb.Path, fil);
- if (fld==null) fld = Folder.MakeFolder((Folder)parfld, dbConn, vb.Title, vb.Path, FolderName(vb.Path), null, null, DateTime.Now, "Migration");
- tn.Tag = fld;
- return (object) fld;
- case "version":
- // see if version exists for the input folder, parfld.
- DocVersion v = GetDocVersionFromName((Folder)parfld, vb.Title);
- if (v == null)
- {
- ConfigFile cfg = new ConfigFile();
-
- XmlDocument d = cfg.IniToXml(vb.Path + "\\proc.ini");
- AddSlaveUnits(d, vb.Path);
- if (frmMain.ProcessFailed)
- return null;
- //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).
- string csfile = string.Format("{0}\\curset.dat",vb.Path);
- string defPlantFmt = null;
- if (File.Exists(csfile))
- {
- CurSet cs = new CurSet(csfile);
- try
- {
- if (fld_cfg == null) fld_cfg = new FolderConfig();
- fld_cfg = cs.Convert(fld_cfg);
- defPlantFmt = cs.GetDefFmt();
- }
- catch (Exception ex)
- {
- log.ErrorFormat("error in convert curset.dat, ex = {0}", ex.Message);
- frmMain.AddError(ex, "error in convert curset.dat");
- }
- }
- // *** RHM 20120613 - Fix
- // *** This was naming the DocVersion to the folder name
- //string titlepath = vb.Path + "\\" + "Title";
- //FileInfo fi = new FileInfo(titlepath);
- //string thetitle = vb.Title;
- //if (File.Exists(titlepath))
- //{
- // StreamReader myReader = new StreamReader(titlepath);
- // thetitle = myReader.ReadLine();
- // myReader.Close();
- //}
- Folder tmpfld = (Folder)parfld;
- FormatInfo format = null;
- if (defPlantFmt != null && defPlantFmt != "")
- {
- format = GetFormat(defPlantFmt);
- }
- else
- format = FormatInfo.Get(1);
-
- using(Format fmt = format.Get())
- v = DocVersion.MakeDocVersion(tmpfld, (int)DocVersionType(vb.Path.ToLower()), vb.Title, vb.Path.ToLower(), null, fmt, fld_cfg == null ? null : fld_cfg.ToString(), DateTime.Now, "Migration");
- }
- tn.Tag = v;
- MigrateDocVersion(v, false);
- return (object)v;
- }
- return 0;
- }
-
- private void AddSlaveUnits(XmlDocument d, string path)
- {
- string masterDir = GetMasterDir(d);
- if (masterDir == null)
- {
- //not a master slave procedure set
- return;
- }
- DirectoryInfo master = new DirectoryInfo(path);
- if (master.Name.ToUpper() != masterDir.ToUpper()) return;
- List names = GetUnitNames(d);
- if (names == null)
- {
- frmMain.ProcessFailed = true;
- MessageBox.Show("Could not find Unit names in slave proc.ini files");
- frmMain.MyError = "Could not find Unit names in slave proc.ini files";
- return;
- }
- DirectoryInfo[] slaves = master.Parent.GetDirectories(masterDir.ToUpper().Replace(".PRC",".SL*"));
- XmlDocument units = new XmlDocument();
- units.LoadXml("");
- int idx = 0;
- foreach (DirectoryInfo slave in slaves)
- {
- FileInfo[] inis = slave.GetFiles("proc.ini");
- if (inis.Length > 0)
- {
- FileInfo ini = inis[0];
- ConfigFile cfg = new ConfigFile();
- XmlDocument xSlave = cfg.IniToXml(ini.FullName);
- xSlave.LoadXml(xSlave.OuterXml.Replace(" GetUnitNames(XmlDocument d)
- {
- XmlNode zapp = GetXMLNode(d, "Unit");// d.SelectSingleNode("//Unit");
- if (zapp == null) return null;
- XmlNode zmstr = GetXMLAttribute(zapp, "Name");// zapp.Attributes.GetNamedItem("Name");
- if (zmstr == null) return null;
- string[] names = zmstr.InnerText.Split(",".ToCharArray());
- return new List(names);
- }
-
- private static string GetMasterDir(XmlDocument d)
- {
- XmlNode zapp = GetXMLNode(d, "Applicability");// d.SelectSingleNode("//Applicability");
- if (zapp == null) return null;
- XmlNode zmstr = GetXMLAttribute(zapp, "MasterDir");// zapp.Attributes.GetNamedItem("MasterDir");
- if (zmstr == null) return null;
- return zmstr.InnerText;
- }
- private string _OnlyThisFolder;
- public string OnlyThisFolder
- {
- get
- {
- if (_OnlyThisFolder == null)
- {
- if (frmMain.MySettings.OnlyThisSet || frmMain.Automatic)
- {
- DirectoryInfo dir = new DirectoryInfo(frmMain.ProcedureSetPath);
- if (frmMain.Automatic)
- _OnlyThisFolder = dir.FullName.ToUpper();
- else
- _OnlyThisFolder = dir.Parent.FullName.ToUpper();
- }
- else if ((frmMain.MySettings.ProcessOnlyInLocation ?? "") != "")
- _OnlyThisFolder = frmMain.MySettings.ProcessOnlyInLocation.ToUpper();
- else
- _OnlyThisFolder = "";
- }
- return _OnlyThisFolder;
- }
- }
- private bool IsInSelectedPlantData(Object parent)
- {
- if (OnlyThisFolder == "")
- return true;
- Folder fld = parent as Folder;
- if (fld == null)
- return true;
- if (fld.MyParent.MyParent != null)
- return true;
- if (fld.Title.ToUpper() == OnlyThisFolder)
- return true;
- return false;
- }
- private void MigrateChildren(vlnObject vb, vlnServer vs, Connection dbConn, Object parent, TreeNode tn)
- {
- if (vb.Type != "version")
- {
- vb.LoadChildren(vs.GetChildren(vb.ToString()));
- List lv = vb.Children;
- if (vb.Children.Count == 0)
- frmMain.AddError("No children found for {0}", vb.Path);
- foreach (vlnObject vbc in lv)
- {
- if (vbc.Path.ToUpper().StartsWith(OnlyThisFolder) || OnlyThisFolder.StartsWith(vbc.Path.ToUpper()))
- {
- TreeNode tnc = tn.Nodes.Add(vbc.Title);
- object idc = cslaObject(vbc, dbConn, parent, tnc);
- if (frmMain.ProcessFailed)
- return;
- frmMain.Status = "Loading " + vbc.Title;
- MigrateChildren(vbc, vs, dbConn, idc, tnc);
- frmMain.ChildrenProcessed++;
- }
- }
- }
- frmMain.Status = " ";
- }
- }
-}
\ No newline at end of file
diff --git a/PROMS/DataLoader/LoadTreeDB.cs.bak b/PROMS/DataLoader/LoadTreeDB.cs.bak
deleted file mode 100644
index c58ba470..00000000
--- a/PROMS/DataLoader/LoadTreeDB.cs.bak
+++ /dev/null
@@ -1,284 +0,0 @@
-// ========================================================================
-// 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.IO;
-using System.Text;
-using VEPROMS.CSLA.Library;
-using vlnObjectLibrary;
-using vlnServerLibrary;
-using Org.Mentalis.Files;
-using Config;
-using Utils;
-
-namespace DataLoader
-{
- public partial class Loader
- {
- private List vlnDataPathFolders() // was vlnDataPath
- {
- List dpf = new List();
- // Get path to config file
- string sCfg = Environment.GetEnvironmentVariable("veconfig");
- IniReader cfg = new IniReader(sCfg);
- // Get DataPath
- string sDP = cfg.ReadString("menu", "DataPath");
- // Split DataPath into directories
-
- // Get the current list of folders so that if it already exists, just get the 'Folder', otherwise
- // make it. It was done this way because there was no way to get the Folder given a name/Title.
- FolderInfoList fil = FolderInfoList.Get();
-
- foreach (string s1 in sDP.Split(";".ToCharArray()))
- {
- if (s1.Length > 0)
- {
- string[] s2 = s1.Split(",".ToCharArray());
- Folder fld = GetFolderFromName(s2[1], s2[0], fil);
- if (fld == null)
- fld = Folder.MakeFolder(sysFolder, dbConn, s2[1], s2[0], FolderName(s2[0]), null, null, DateTime.Now, "Migration");
- dpf.Add(fld);
- }
- }
- return dpf;
- }
- private Folder GetFolderFromName(string name, string title, FolderInfoList fil)
- {
- Folder fld = null;
- foreach (FolderInfo fi in fil)
- {
- if (fi.Name.ToUpper() == name.ToUpper() && fi.Title.ToUpper() == title.ToUpper())
- {
- fld = Folder.Get(fi.FolderID);
- return fld;
- }
- }
- return null;
- }
- private string FolderName(string Path)
- {
- int ind = Path.LastIndexOf("\\");
- if (ind == Path.Length-1 || ind < 0) return Path;
- return Path.Substring(ind + 1);
- }
- private DocVersion GetDocVersionFromName(Folder fld, string f)
- {
- DocVersion dv = null;
- DocVersionInfoList dvil = DocVersionInfoList.GetByFolderID(fld.FolderID);
- foreach (DocVersionInfo dvi in dvil)
- {
- if (dvi.Name.ToUpper() == f.ToUpper())
- {
- dv = DocVersion.Get(dvi.VersionID);
- return dv;
- }
- }
- return null;
- }
- private object cslaObject(vlnObject vb, Connection dbConn, Object parfld, TreeNode tn)
- {
- switch (vb.Type)
- {
- case "plant":
- case "set":
- // if folder exists... get the Folder object, otherwise create it.
- FolderInfoList fil = FolderInfoList.Get();
- Folder fld = GetFolderFromName(vb.Title, vb.Path, fil);
- if (fld==null) fld = Folder.MakeFolder((Folder)parfld, dbConn, vb.Title, vb.Path, FolderName(vb.Path), null, null, DateTime.Now, "Migration");
- tn.Tag = fld;
- return (object) fld;
- case "version":
- // see if version exists for the input folder, parfld.
- DocVersion v = GetDocVersionFromName((Folder)parfld, vb.Title);
- if (v == null)
- {
- ConfigFile cfg = new ConfigFile();
-
- XmlDocument d = cfg.IniToXml(vb.Path + "\\proc.ini");
- AddSlaveUnits(d, vb.Path);
- //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).
- string csfile = string.Format("{0}\\curset.dat",vb.Path);
- string defPlantFmt = null;
- if (File.Exists(csfile))
- {
- CurSet cs = new CurSet(csfile);
- try
- {
- if (fld_cfg == null) fld_cfg = new FolderConfig();
- fld_cfg = cs.Convert(fld_cfg);
- defPlantFmt = cs.GetDefFmt();
- }
- catch (Exception ex)
- {
- log.ErrorFormat("error in convert curset.dat, ex = {0}", ex.Message);
- frmMain.AddError(ex, "error in convert curset.dat");
- }
- }
- // *** RHM 20120613 - Fix
- // *** This was naming the DocVersion to the folder name
- //string titlepath = vb.Path + "\\" + "Title";
- //FileInfo fi = new FileInfo(titlepath);
- //string thetitle = vb.Title;
- //if (File.Exists(titlepath))
- //{
- // StreamReader myReader = new StreamReader(titlepath);
- // thetitle = myReader.ReadLine();
- // myReader.Close();
- //}
- Folder tmpfld = (Folder)parfld;
- FormatInfo format = null;
- if (defPlantFmt != null && defPlantFmt != "")
- {
- format = GetFormat(defPlantFmt);
- }
- else
- format = FormatInfo.Get(1);
-
- using(Format fmt = format.Get())
- v = DocVersion.MakeDocVersion(tmpfld, (int)DocVersionType(vb.Path.ToLower()), vb.Title, vb.Path.ToLower(), null, fmt, fld_cfg == null ? null : fld_cfg.ToString(), DateTime.Now, "Migration");
- }
- tn.Tag = v;
- MigrateDocVersion(v, false);
- return (object)v;
- }
- return 0;
- }
-
- private void AddSlaveUnits(XmlDocument d, string path)
- {
- string masterDir = GetMasterDir(d);
- if (masterDir == null) return;
- DirectoryInfo master = new DirectoryInfo(path);
- if (master.Name.ToUpper() != masterDir.ToUpper()) return;
- List names = GetUnitNames(d);
- DirectoryInfo[] slaves = master.Parent.GetDirectories(masterDir.ToUpper().Replace(".PRC",".SL*"));
- XmlDocument units = new XmlDocument();
- units.LoadXml("");
- int idx = 0;
- foreach (DirectoryInfo slave in slaves)
- {
- FileInfo[] inis = slave.GetFiles("proc.ini");
- if (inis.Length > 0)
- {
- FileInfo ini = inis[0];
- ConfigFile cfg = new ConfigFile();
- XmlDocument xSlave = cfg.IniToXml(ini.FullName);
- xSlave.LoadXml(xSlave.OuterXml.Replace(" GetUnitNames(XmlDocument d)
- {
- XmlNode zapp = d.SelectSingleNode("//Unit");
- if (zapp == null) return null;
- XmlNode zmstr = zapp.Attributes.GetNamedItem("Name");
- if (zmstr == null) return null;
- string[] names = zmstr.InnerText.Split(",".ToCharArray());
- return new List(names);
- }
-
- private static string GetMasterDir(XmlDocument d)
- {
- XmlNode zapp = d.SelectSingleNode("//Applicability");
- if (zapp == null) return null;
- XmlNode zmstr = zapp.Attributes.GetNamedItem("MasterDir");
- if (zmstr == null) return null;
- return zmstr.InnerText;
- }
- private string _OnlyThisFolder;
- public string OnlyThisFolder
- {
- get
- {
- if (_OnlyThisFolder == null)
- {
- if (frmMain.MySettings.OnlyThisSet)
- {
- DirectoryInfo dir = new DirectoryInfo(frmMain.MySettings.ProcedureSetPath);
- _OnlyThisFolder = dir.Parent.FullName.ToUpper();
- }
- else
- _OnlyThisFolder = "";
- }
- return _OnlyThisFolder;
- }
- }
- private bool IsInSelectedPlantData(Object parent)
- {
- if (OnlyThisFolder == "")
- return true;
- Folder fld = parent as Folder;
- if (fld == null)
- return true;
- if (fld.MyParent.MyParent != null)
- return true;
- if (fld.Title.ToUpper() == OnlyThisFolder)
- return true;
- return false;
- }
- private void MigrateChildren(vlnObject vb, vlnServer vs, Connection dbConn, Object parent, TreeNode tn)
- {
- if (vb.Type != "version")
- {
- vb.LoadChildren(vs.GetChildren(vb.ToString()));
- List lv = vb.Children;
- foreach (vlnObject vbc in lv)
- {
- if (vbc.Path.ToUpper().StartsWith(OnlyThisFolder) || OnlyThisFolder.StartsWith(vbc.Path.ToUpper()))
- {
- TreeNode tnc = tn.Nodes.Add(vbc.Title);
- object idc = cslaObject(vbc, dbConn, parent, tnc);
- frmMain.Status = "Loading " + vbc.Title;
- MigrateChildren(vbc, vs, dbConn, idc, tnc);
- }
- }
- }
- frmMain.Status = " ";
- }
- }
-}
\ No newline at end of file
diff --git a/PROMS/DataLoader/LoadTreeNh.cs b/PROMS/DataLoader/LoadTreeNh.cs
deleted file mode 100644
index b76e5b01..00000000
--- a/PROMS/DataLoader/LoadTreeNh.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-// ========================================================================
-// 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.IO;
-using System.Text;
-using VEPROMS.CSLA.Library;
-
-namespace DataLoader
-{
- public partial class Loader
- {
- public bool LoadChildren(FolderInfo fld, TreeNode tn)
- {
- tn.Nodes.Clear();
- bool bLoaded = true;
- foreach (DocVersionInfo fdv in fld.FolderDocVersions)
- {
- TreeNode tnc = tn.Nodes.Add(fdv.Title);
- tnc.Tag = fdv;
- tnc.Checked = fdv.ItemID != 0;
- bLoaded &= tnc.Checked;
- }
- return bLoaded;
- }
- }
-}
\ No newline at end of file
diff --git a/PROMS/DataLoader/Loader.cs b/PROMS/DataLoader/Loader.cs
deleted file mode 100644
index 6b068d6b..00000000
--- a/PROMS/DataLoader/Loader.cs
+++ /dev/null
@@ -1,282 +0,0 @@
-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;
-using Volian.Base.Library;
-
-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 PLACEKEEPER = 0x40;
- private static int PHONELIST = 0x10;
-
- 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 ROFstInfo rofstinfo;
- private RODb rodb;
- private int EditSectId;
- private Dictionary 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 AnnotationType MigrationErrorType; // this holds the annotationtype of Migration Error for future use
- public AnnotationType VerificationRequiredType; // Using this to flag table to grid conversions
- 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 dicTrans_ItemDone;
- private Dictionary dicTrans_ItemIds;
- private Dictionary> dicTrans_MigrationErrors;
- private Dictionary