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:
parent
83f9e1cc75
commit
3ba7971ece
@ -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
|
||||
|
@ -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")]
|
||||
|
@ -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))
|
||||
|
@ -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)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user