File Date/Time changed to UTC to eliminate Daylight Savings Time Issue
This commit is contained in:
parent
f5e8cca1f8
commit
aed6c8740c
@ -729,12 +729,12 @@ namespace VEPROMS
|
||||
break;
|
||||
}
|
||||
FileInfo fiRofst = new FileInfo(rofstPath);
|
||||
if (SelectedROFst.DTS == fiRofst.LastWriteTime)
|
||||
if (SelectedROFst.DTS == fiRofst.LastWriteTimeUtc)
|
||||
{
|
||||
MessageBox.Show("ro.fst files are same for path " + rdi.FolderPath + ", import of that ro.fst will not be done");
|
||||
break;
|
||||
}
|
||||
if (SelectedROFst.DTS > fiRofst.LastWriteTime)
|
||||
if (SelectedROFst.DTS > fiRofst.LastWriteTimeUtc)
|
||||
{
|
||||
MessageBox.Show("Cannot copy older ro.fst from " + rdi.FolderPath + ", import of that ro.fst will not be done");
|
||||
break;
|
||||
|
@ -339,7 +339,7 @@ namespace VEPROMS.CSLA.Library
|
||||
|
||||
// using (RODb rd = RODb.Get(rdi.RODbID))
|
||||
// {
|
||||
// ROFst rofst = ROFst.MakeROFst(rd, ab, null, di.LastWriteTime, rdi.UserID);
|
||||
// ROFst rofst = ROFst.MakeROFst(rd, ab, null, di.LastWriteTimeUtc, rdi.UserID);
|
||||
// // Hook this into the current docversion by replacing the rofstid field in the doc version
|
||||
// // association object:
|
||||
// dva.MyROFst = rofst;
|
||||
@ -428,7 +428,7 @@ namespace VEPROMS.CSLA.Library
|
||||
// {
|
||||
// FileInfo fi = new FileInfo(imgfile);
|
||||
// // if the roimage record exists, don't create a new one...
|
||||
// using (roImg = ROImage.GetByRODbID_FileName_DTS(rdi.RODbID, imgname, fi.LastWriteTime))
|
||||
// using (roImg = ROImage.GetByRODbID_FileName_DTS(rdi.RODbID, imgname, fi.LastWriteTimeUtc))
|
||||
// {
|
||||
// if (roImg == null)
|
||||
// {
|
||||
@ -439,7 +439,7 @@ namespace VEPROMS.CSLA.Library
|
||||
// fsIn.Close();
|
||||
// using (RODb rodb = RODb.Get(rdi.RODbID))
|
||||
// {
|
||||
// roImg = ROImage.MakeROImage(rodb, imgname, ab, null, fi.LastWriteTime, "Migration");
|
||||
// roImg = ROImage.MakeROImage(rodb, imgname, ab, null, fi.LastWriteTimeUtc, "Migration");
|
||||
// }
|
||||
// }
|
||||
// Figure figure = Figure.GetByROFstID_ImageID(this.ROFstID, roImg.ImageID);
|
||||
|
@ -275,8 +275,8 @@ namespace VEPROMS.CSLA.Library
|
||||
FileStream fs = _MyFile.Create();
|
||||
if (MyDocument.DocContent != null) fs.Write(MyDocument.DocContent, 0, MyDocument.DocContent.Length);
|
||||
fs.Close();
|
||||
_MyFile.CreationTime = _MyDocument.DTS;
|
||||
_MyFile.LastWriteTime = _MyDocument.DTS;
|
||||
_MyFile.CreationTimeUtc = _MyDocument.DTS;
|
||||
_MyFile.LastWriteTimeUtc = _MyDocument.DTS;
|
||||
_Created = true;
|
||||
}
|
||||
}
|
||||
@ -333,7 +333,7 @@ namespace VEPROMS.CSLA.Library
|
||||
cfg.Edit_Initialized = true;
|
||||
doc.Config = cfg.ToString();
|
||||
doc.UserID = Volian.Base.Library.VlnSettings.UserID;
|
||||
doc.DTS = _MyFile.LastWriteTime;
|
||||
doc.DTS = _MyFile.LastWriteTimeUtc;
|
||||
doc = doc.Save();
|
||||
List<string> roids = new List<string>();
|
||||
string pdfTmp = MSWordToPDF.ToPDFReplaceROs(_MyDocument, roids, myItemInfo);
|
||||
|
@ -197,7 +197,7 @@ namespace VEPROMS.CSLA.Library
|
||||
|
||||
// check if this rofst has been loaded, i.e. dts on file versus dts in db...
|
||||
// if so, just make association with docversion.
|
||||
ROFst rofst = ROFst.GetByRODbID_DTS(rdi.RODbID, di.LastWriteTime);
|
||||
ROFst rofst = ROFst.GetByRODbID_DTS(rdi.RODbID, di.LastWriteTimeUtc);
|
||||
if (rofst != null)
|
||||
{
|
||||
docver.DocVersionAssociations.Add(rofst);
|
||||
@ -218,7 +218,7 @@ namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
Dictionary<string, int> myROImagesList = BuildROImagesList(myROImages);
|
||||
List<int> myROImageIDs = new List<int>();
|
||||
rofst = ROFst.MakeROFst(rodb, ab, null, di.LastWriteTime, rdi.UserID);
|
||||
rofst = ROFst.MakeROFst(rodb, ab, null, di.LastWriteTimeUtc, rdi.UserID);
|
||||
// Hook this into the current docversion by replacing the rofstid field in the doc version
|
||||
// association object:
|
||||
docver.DocVersionAssociations.Add(rofst);
|
||||
@ -258,7 +258,7 @@ namespace VEPROMS.CSLA.Library
|
||||
DirectoryInfo di = new DirectoryInfo(rdi.FolderPath);
|
||||
// check if this rofst has been loaded, i.e. dts on file versus dts in db...
|
||||
// if so, just make association to existing with docversion.
|
||||
ROFst rofst = ROFst.GetByRODbID_DTS(rdi.RODbID, di.LastWriteTime);
|
||||
ROFst rofst = ROFst.GetByRODbID_DTS(rdi.RODbID, di.LastWriteTimeUtc);
|
||||
if (rofst != null)
|
||||
{
|
||||
docver.DocVersionAssociations[0].MyROFst = rofst;
|
||||
@ -275,7 +275,7 @@ namespace VEPROMS.CSLA.Library
|
||||
fsIn.Close();
|
||||
using (RODb rodb = RODb.GetJustRoDb(rdi.RODbID))
|
||||
{
|
||||
rofst = ROFst.MakeROFst(rodb, ab, null, di.LastWriteTime, rdi.UserID);
|
||||
rofst = ROFst.MakeROFst(rodb, ab, null, di.LastWriteTimeUtc, rdi.UserID);
|
||||
// Hook this into the current docversion by replacing the rofstid field in the doc version
|
||||
// association object:
|
||||
dva.MyROFst = rofst;
|
||||
@ -508,7 +508,7 @@ namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
FileInfo fi = new FileInfo(imgfile);
|
||||
// if the roimage record exists, don't create a new one...
|
||||
string key = ROImageKey(imgname, fi.LastWriteTime);
|
||||
string key = ROImageKey(imgname, fi.LastWriteTimeUtc);
|
||||
if (myROImagesList.ContainsKey(key))
|
||||
{
|
||||
int imageID = myROImagesList[key];
|
||||
@ -522,7 +522,7 @@ namespace VEPROMS.CSLA.Library
|
||||
byte[] ab = r.ReadBytes((int)fsIn.Length);
|
||||
r.Close();
|
||||
fsIn.Close();
|
||||
roImg = ROImage.MakeROImage(rodb, imgname, ab, null, fi.LastWriteTime, "Migration");
|
||||
roImg = ROImage.MakeROImage(rodb, imgname, ab, null, fi.LastWriteTimeUtc, "Migration");
|
||||
Figure figure = Figure.GetByROFstID_ImageID(this.ROFstID, roImg.ImageID);
|
||||
if (figure != null) return;
|
||||
figure = Figure.MakeFigure(rofst, roImg, null);
|
||||
|
@ -165,8 +165,8 @@ namespace VEPROMS.CSLA.Library
|
||||
FileStream fs = _MyFile.Create();
|
||||
fs.Write(MyROImage.Content, 0, MyROImage.Content.Length);
|
||||
fs.Close();
|
||||
_MyFile.CreationTime = MyROImage.DTS;
|
||||
_MyFile.LastWriteTime = MyROImage.DTS;
|
||||
_MyFile.CreationTimeUtc = MyROImage.DTS;
|
||||
_MyFile.LastWriteTimeUtc = MyROImage.DTS;
|
||||
_Created = true;
|
||||
}
|
||||
}
|
||||
@ -196,7 +196,7 @@ namespace VEPROMS.CSLA.Library
|
||||
//roImage.FileName;
|
||||
roImage.Content = buf;
|
||||
roImage.UserID = Volian.Base.Library.VlnSettings.UserID;
|
||||
roImage.DTS = _MyFile.LastWriteTime;
|
||||
roImage.DTS = _MyFile.LastWriteTimeUtc;
|
||||
roImage.Save();
|
||||
}
|
||||
#endregion
|
||||
|
@ -1282,12 +1282,12 @@ namespace Volian.Controls.Library
|
||||
return;
|
||||
}
|
||||
FileInfo fiRofst = new FileInfo(rofstPath);
|
||||
if (roFstInfo.DTS == fiRofst.LastWriteTime)
|
||||
if (roFstInfo.DTS == fiRofst.LastWriteTimeUtc)
|
||||
{
|
||||
MessageBox.Show("ro.fst files are same for path " + roFstInfo.MyRODb.FolderPath + ", import of that ro.fst will not be done");
|
||||
return;
|
||||
}
|
||||
if (roFstInfo.DTS > fiRofst.LastWriteTime)
|
||||
if (roFstInfo.DTS > fiRofst.LastWriteTimeUtc)
|
||||
{
|
||||
MessageBox.Show("Cannot copy older ro.fst from " + roFstInfo.MyRODb.FolderPath + ", import of that ro.fst will not be done");
|
||||
return;
|
||||
@ -1368,11 +1368,11 @@ namespace Volian.Controls.Library
|
||||
|
||||
// if the database Ro.Fst is newer or if the files have identical DTS,
|
||||
// assume that they are the same file.
|
||||
if (roFstInfo.DTS >= fiRofst.LastWriteTime) return false;
|
||||
if (roFstInfo.DTS >= fiRofst.LastWriteTimeUtc) return false;
|
||||
|
||||
// next see if the data is the same size, i.e. byte count of record and byte count
|
||||
// of file. If different sizes, the date/time stamp check will hold.
|
||||
if (fiRofst.Length != roFstInfo.ROLookup.Length) return fiRofst.LastWriteTime > roFstInfo.DTS;
|
||||
if (fiRofst.Length != roFstInfo.ROLookup.Length) return fiRofst.LastWriteTimeUtc > roFstInfo.DTS;
|
||||
|
||||
// if we can't tell by the DTS or size, compare the contents. Get all of the rodb's
|
||||
// rofsts of the size of the file & compare bytes. If
|
||||
|
Loading…
x
Reference in New Issue
Block a user