diff --git a/PROMS/DataLoader/Documents.cs b/PROMS/DataLoader/Documents.cs index 9f9e46ed..5c601f94 100644 --- a/PROMS/DataLoader/Documents.cs +++ b/PROMS/DataLoader/Documents.cs @@ -46,7 +46,7 @@ namespace DataLoader } } - private int SaveWordDoc(string fname, string title, string stype, ConfigInfo ci, string sectName) + private int SaveWordDoc(string fname, string title, string stype, ConfigInfo ci, string sectName, DateTime dtsutc) { int docid = 0; if (System.IO.File.Exists(fname)) @@ -111,7 +111,7 @@ namespace DataLoader string s = myWordDoc.Save(temppath); myWordDoc.Close(); WaitMS(wms); - docid = SaveDoc(temppath, title, ci, ascii); + docid = SaveDoc(temppath, title, ci, ascii, dtsutc); DeleteFile(temppath); DeleteFile(tmpName); keepTrying = false; @@ -164,7 +164,7 @@ namespace DataLoader TryToShowMSWord(myWordDoc); CloseMSWord(myWordDoc); } - docid = SaveDoc(fname, title, ci, ""); // Save the original file + docid = SaveDoc(fname, title, ci, "",dtsutc); // Save the original file keepTrying = false; DeleteFile(temppath); DeleteFile(tmpName); @@ -178,7 +178,7 @@ namespace DataLoader else { if (frmMain.MySettings.ConvertTo == AccPageConversion.RichTextFormat) - docid = SaveDoc(fname, title, ci,""); // Need to get Ascii Text from RTF + docid = SaveDoc(fname, title, ci,"",dtsutc); // Need to get Ascii Text from RTF } } else @@ -273,9 +273,10 @@ namespace DataLoader { ConfigInfo ci = new ConfigInfo(null); ci.AddItem("Edit", "Initialized", "true"); - return SaveWordDoc(temppath, String.Empty, stype, ci, sectName); + FileInfo myFile = new FileInfo(temppath); + return SaveWordDoc(temppath, String.Empty, stype, ci, sectName, myFile.LastWriteTimeUtc); } - private int SaveTheDoc(string temppath, string title, ConfigInfo ci, string ascii) + private int SaveTheDoc(string temppath, string title, ConfigInfo ci, string ascii, DateTime dtsutc) { try { @@ -285,7 +286,7 @@ namespace DataLoader int nBytesRead = fs.Read(ByteArray, 0, (int)len); fs.Close(); string t1 = (title == null || title == "") ? null : title; - Document doc = Document.MakeDocument(t1, ByteArray, null, ci == null ? null : ci.ToString(), DateTime.Now, "Migration", ".Doc"); + 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); @@ -312,14 +313,14 @@ namespace DataLoader } } - private int SaveDoc(string temppath, string title, ConfigInfo ci, string ascii) + 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); + done = SaveTheDoc(temppath, title, ci, ascii, dtsutc); } return done; } diff --git a/PROMS/DataLoader/Formats.cs b/PROMS/DataLoader/Formats.cs index 81e6506b..bc12d73a 100644 --- a/PROMS/DataLoader/Formats.cs +++ b/PROMS/DataLoader/Formats.cs @@ -26,8 +26,8 @@ namespace DataLoader { public partial class Loader { - public string _FmtAllPath; - public string _GenmacAllPath; + //public string _FmtAllPath; + //public string _GenmacAllPath; //private FormatInfoList _AllFormats; //public FormatInfoList AllFormats diff --git a/PROMS/DataLoader/LibDoc.cs b/PROMS/DataLoader/LibDoc.cs index 1b37f99d..fa533350 100644 --- a/PROMS/DataLoader/LibDoc.cs +++ b/PROMS/DataLoader/LibDoc.cs @@ -69,10 +69,10 @@ namespace DataLoader { 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"); + ci.AddItem("History", "OriginalFileName", fi.Name); string tmpRtfFileName = GetLibDocData(fi, ci, ref title); - int Docid = SaveWordDoc(tmpRtfFileName, title, null, ci, string.Empty); + int Docid = SaveWordDoc(tmpRtfFileName, title, null, ci, string.Empty,fi.LastWriteTimeUtc); File.Delete(tmpRtfFileName); return Docid; } diff --git a/PROMS/DataLoader/Loader.cs b/PROMS/DataLoader/Loader.cs index ed8d5498..2dee9e78 100644 --- a/PROMS/DataLoader/Loader.cs +++ b/PROMS/DataLoader/Loader.cs @@ -82,8 +82,8 @@ namespace DataLoader { try { - _FmtAllPath = frmMain.MySettings.FormatFolder; - _GenmacAllPath = frmMain.MySettings.GenMacFolder; + //_FmtAllPath = frmMain.MySettings.FormatFolder; + //_GenmacAllPath = frmMain.MySettings.GenMacFolder; frmMain.Status = "Make Connection"; // make the initial database connection record, annotation types & top // system folder. @@ -105,7 +105,8 @@ namespace DataLoader frmMain.Status = "Load All Formats"; //LoadAllFormats(); - Format.UpdateFormats(_FmtAllPath, _GenmacAllPath); + //Format.UpdateFormats(_FmtAllPath, _GenmacAllPath); + Format.UpdateFormats(frmMain.MySettings.FormatFolder, frmMain.MySettings.GenMacFolder); Format baseFormat = Format.Get(1); sysFolder = Folder.MakeFolder(null, dbConn, "VEPROMS", "VEPROMS", "VEPROMS", baseFormat, d.InnerXml, DateTime.Now, "Migration"); diff --git a/PROMS/DataLoader/frmLoader.cs b/PROMS/DataLoader/frmLoader.cs index 58a6f99e..37cef1d5 100644 --- a/PROMS/DataLoader/frmLoader.cs +++ b/PROMS/DataLoader/frmLoader.cs @@ -294,10 +294,11 @@ namespace DataLoader if (FormatsOnly) { // ASSUMES No Formats/genmacs exist in database. - MessageBox.Show(@"Format files are taken from c:\development\fmtall"); - ldr._FmtAllPath = @"c:\development\fmtall"; - ldr._GenmacAllPath = @"c:\development\genmacall"; - Format.UpdateFormats(@"c:\development\fmtall",@"c:\development\genmacall"); //ldr.LoadAllFormats(); + //MessageBox.Show(@"Format files are taken from c:\development\fmtall"); + //ldr._FmtAllPath = @"c:\development\fmtall"; + //ldr._GenmacAllPath = @"c:\development\genmacall"; + Format.UpdateFormats(MySettings.FormatFolder, MySettings.GenMacFolder); + //Format.UpdateFormats(@"c:\development\fmtall",@"c:\development\genmacall"); //ldr.LoadAllFormats(); MessageBox.Show("Formats Loaded"); return; } @@ -579,6 +580,11 @@ namespace DataLoader LoadSettings(); _Loading = false; MSWordToPDF.CloseWordWhenDone = false; + Format.FormatLoaded += new FormatEvent(Format_FormatLoaded); + } + void Format_FormatLoaded(object sender, FormatEventArgs args) + { + MyInfo = args.Status; } private void btnFixTransitions_Click(object sender, EventArgs e) { @@ -708,7 +714,6 @@ namespace DataLoader btnFixTransitions_Click(this, new System.EventArgs()); mb.Append("Fix Transtions Complete"); Status = "Backing up Phase 2 Data"; - mb.Append("dBase Conversion Complete"); Backup("_" + MySettings.Phase2Suffix); mb.Append("Phase 2 Backup Complete"); // Phase 3 - Convert to Change Manager Version diff --git a/PROMS/VEPROMS.CSLA.Library/Config/DocumentConfig.cs b/PROMS/VEPROMS.CSLA.Library/Config/DocumentConfig.cs index ba43909c..22de1f0e 100644 --- a/PROMS/VEPROMS.CSLA.Library/Config/DocumentConfig.cs +++ b/PROMS/VEPROMS.CSLA.Library/Config/DocumentConfig.cs @@ -85,6 +85,21 @@ namespace VEPROMS.CSLA.Library OnPropertyChanged("Edit_Initialized"); } } + [Category("History")] + [DisplayName("Original File Name")] + [Description("File Name from 16-Bit Data")] + public string History_OriginalFileName + { + get + { + return _Xp["History", "OriginalFileName"]; + } + set + { + _Xp["History", "OriginalFileName"] = value; + OnPropertyChanged("History_OriginalFileName"); + } + } // RHM 20110415 - These are now stored in the PDF table. //[Category("Printing")] //[DisplayName("Length")] diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/FormatExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/FormatExt.cs index 3ca9c8c6..ddeaa1fb 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/FormatExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/FormatExt.cs @@ -33,7 +33,6 @@ namespace VEPROMS.CSLA.Library public class FormatEventArgs { private string _Status; - public string Status { get { return _Status; } @@ -110,7 +109,8 @@ namespace VEPROMS.CSLA.Library foreach (FileInfo sfi in sfis) { string nm = sfi.Name.Substring(0, sfi.Name.Length - 7); - Console.WriteLine("Processing {0}", sfi.Name); + OnFormatLoaded(null, new FormatEventArgs("Loading Format " + sfi.Name)); + //Console.WriteLine("Processing {0}", sfi.Name); //frmMain.Status = string.Format("Processing Format {0}", sfi.Name); try { @@ -159,7 +159,7 @@ namespace VEPROMS.CSLA.Library string genmacdata = null; XmlDocument xd = null; - OnFormatLoaded(null, new FormatEventArgs("Loading "+format)); + OnFormatLoaded(null, new FormatEventArgs("Loading Format "+format)); //string path = "c:\\development\\fmtall\\" + format + "all.xml"; string path = fmtPath + "\\" + format + "all.xml"; if (File.Exists(path)) diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ROFSTExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ROFSTExt.cs index 8b876c3c..c7875ca5 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ROFSTExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ROFSTExt.cs @@ -377,7 +377,7 @@ namespace VEPROMS.CSLA.Library // roid's are stored in database as 16 characters long in the rousages table. They may be stored // as 12 characters in the ro.fst. string padroid = chg.Length <= 12 ? chg + "0000" : chg; - using (DROUsageInfoList affected = DROUsageInfoList.GetAffected(origROFstInfo.MyRODb.RODbID, padroid, desc, "Changed")) + using (DROUsageInfoList affected = DROUsageInfoList.GetAffected(origROFstInfo.MyRODb.RODbID, padroid.Substring(0,12), desc, "Changed")) { foreach (DROUsageInfo droUsg in affected) {