Save File Last Write UTC as Document.DTS
Eliminate unused variables Use settings for Format Load Output status of Formats being loaded Save File Last Write UTC as Document.DTS added History_OriginalFileName to DocumentConfig Use settings rather than local variables Only use the first 12 characters of a ROID for DROUsage Lookup
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
@@ -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
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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");
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user