Changed how ROFSTLookup object was obtained based on correct DocVersion

Changed how RoFst date time is compared to actual ro.fst file date time
This commit is contained in:
Rich 2014-02-07 17:37:51 +00:00
parent 7ab6604534
commit f864d03eec
5 changed files with 20 additions and 18 deletions

View File

@ -1607,7 +1607,7 @@ namespace VEPROMS.CSLA.Library
if (cont.ContentRoUsageCount > 0) if (cont.ContentRoUsageCount > 0)
{ {
ROFstInfo myrofst = tmp.MyContent.ContentItems[0].MyProcedure.MyDocVersion.DocVersionAssociations[0].MyROFst; ROFstInfo myrofst = tmp.MyContent.ContentItems[0].MyProcedure.MyDocVersion.DocVersionAssociations[0].MyROFst;
ROFSTLookup mylookup = myrofst.ROFSTLookup; ROFSTLookup mylookup = myrofst.GetROFSTLookup(tmp.MyContent.ContentItems[0].MyProcedure.MyDocVersion);
foreach (ContentRoUsage ro in cont.ContentRoUsages) foreach (ContentRoUsage ro in cont.ContentRoUsages)
{ {
RoUsageInfo rou = RoUsageInfo.Get(ro.ROUsageID); RoUsageInfo rou = RoUsageInfo.Get(ro.ROUsageID);
@ -1807,7 +1807,7 @@ namespace VEPROMS.CSLA.Library
ctmp.Save(); ctmp.Save();
} }
ROFstInfo myrofst = tmp.ContentItems[0].MyProcedure.MyDocVersion.DocVersionAssociations[0].MyROFst; ROFstInfo myrofst = tmp.ContentItems[0].MyProcedure.MyDocVersion.DocVersionAssociations[0].MyROFst;
ROFSTLookup mylookup = myrofst.ROFSTLookup; ROFSTLookup mylookup = myrofst.GetROFSTLookup(tmp.ContentItems[0].MyProcedure.MyDocVersion);
foreach(RoUsageInfo rou in tmp.ContentRoUsages) foreach(RoUsageInfo rou in tmp.ContentRoUsages)
{ {
ROFSTLookup.rochild rocc = mylookup.GetRoChild12(rou.ROID); ROFSTLookup.rochild rocc = mylookup.GetRoChild12(rou.ROID);

View File

@ -178,6 +178,8 @@ namespace VEPROMS.CSLA.Library
// if the database Ro.Fst is newer or if the files have identical DTS, // if the database Ro.Fst is newer or if the files have identical DTS,
// assume that they are the same file. // assume that they are the same file.
if (roFstInfo.DTS >= fiRofst.LastWriteTimeUtc) return false; if (roFstInfo.DTS >= fiRofst.LastWriteTimeUtc) return false;
TimeSpan ts = roFstInfo.DTS - fiRofst.LastWriteTimeUtc;
if (ts.TotalSeconds > -1F) return false;
// next see if the data is the same size, i.e. byte count of record and byte count // 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. // of file. If different sizes, the date/time stamp check will hold.

View File

@ -694,7 +694,7 @@ namespace VEPROMS.CSLA.Library
{ {
hasRos = true; hasRos = true;
rofst = dvi.DocVersionAssociations[0].MyROFst; rofst = dvi.DocVersionAssociations[0].MyROFst;
lookup = rofst.ROFSTLookup; lookup = rofst.GetROFSTLookup(dvi);
igPrefix = dvi.DocVersionConfig.RODefaults_graphicsprefix; igPrefix = dvi.DocVersionConfig.RODefaults_graphicsprefix;
spPrefix = dvi.DocVersionConfig.RODefaults_setpointprefix; spPrefix = dvi.DocVersionConfig.RODefaults_setpointprefix;
} }
@ -808,14 +808,14 @@ namespace VEPROMS.CSLA.Library
// If multiple return values includes X-Y Plot, check to see if it is an X-Y Plot // If multiple return values includes X-Y Plot, check to see if it is an X-Y Plot
if (val == null) if (val == null)
{ {
if(sel.Text.ToUpper() == "<U-TEXT>") val =lookup.DocVersionInfo.DocVersionConfig.Unit_Text; if(sel.Text.ToUpper() == "<U-TEXT>") val =lookup.MyDocVersionInfo.DocVersionConfig.Unit_Text;
else if (sel.Text.ToUpper() == "<U-NUMBER>") val = lookup.DocVersionInfo.DocVersionConfig.Unit_Number; else if (sel.Text.ToUpper() == "<U-NUMBER>") val = lookup.MyDocVersionInfo.DocVersionConfig.Unit_Number;
else if (sel.Text.ToUpper() == "<U-NAME>") val = lookup.DocVersionInfo.DocVersionConfig.Unit_Name; else if (sel.Text.ToUpper() == "<U-NAME>") val = lookup.MyDocVersionInfo.DocVersionConfig.Unit_Name;
else if (sel.Text.ToUpper() == "<U-ID>") val = lookup.DocVersionInfo.DocVersionConfig.Unit_ID; else if (sel.Text.ToUpper() == "<U-ID>") val = lookup.MyDocVersionInfo.DocVersionConfig.Unit_ID;
else if (sel.Text.ToUpper() == "<U-OTHER TEXT>") val = lookup.DocVersionInfo.DocVersionConfig.Other_Unit_Text; else if (sel.Text.ToUpper() == "<U-OTHER TEXT>") val = lookup.MyDocVersionInfo.DocVersionConfig.Other_Unit_Text;
else if (sel.Text.ToUpper() == "<U-OTHER NUMBER>") val = lookup.DocVersionInfo.DocVersionConfig.Other_Unit_Number; else if (sel.Text.ToUpper() == "<U-OTHER NUMBER>") val = lookup.MyDocVersionInfo.DocVersionConfig.Other_Unit_Number;
else if (sel.Text.ToUpper() == "<U-OTHER NAME>") val = lookup.DocVersionInfo.DocVersionConfig.Other_Unit_Name; else if (sel.Text.ToUpper() == "<U-OTHER NAME>") val = lookup.MyDocVersionInfo.DocVersionConfig.Other_Unit_Name;
else if (sel.Text.ToUpper() == "<U-OTHER ID>") val = lookup.DocVersionInfo.DocVersionConfig.Other_Unit_ID; else if (sel.Text.ToUpper() == "<U-OTHER ID>") val = lookup.MyDocVersionInfo.DocVersionConfig.Other_Unit_ID;
//val = "<U-ID>",MyDocVersion.DocVersionConfig.Unit_ID); //val = "<U-ID>",MyDocVersion.DocVersionConfig.Unit_ID);
//text = text.Replace(@"<S\u8209?ID>", _MyItemInfo.MyDocVersion.DocVersionConfig.Unit_ProcedureSetID); //text = text.Replace(@"<S\u8209?ID>", _MyItemInfo.MyDocVersion.DocVersionConfig.Unit_ProcedureSetID);
//text = text.Replace("<U>", _MyItemInfo.MyDocVersion.DocVersionConfig.Unit_Number); //text = text.Replace("<U>", _MyItemInfo.MyDocVersion.DocVersionConfig.Unit_Number);

View File

@ -478,9 +478,9 @@ namespace VEPROMS.CSLA.Library
itemInfo.ActiveSection = sectionInfo; itemInfo.ActiveSection = sectionInfo;
itemInfo.MyDocVersion = docVersionInfo; itemInfo.MyDocVersion = docVersionInfo;
ROFstInfo rofstinfo = docVersionInfo.DocVersionAssociations[0].MyROFst; ROFstInfo rofstinfo = docVersionInfo.DocVersionAssociations[0].MyROFst;
rofstinfo.docVer = docVersionInfo; //rofstinfo.docVer = docVersionInfo;
ROFSTLookup lookup = rofstinfo.ROFSTLookup; ROFSTLookup lookup = rofstinfo.GetROFSTLookup(docVersionInfo);
lookup.DocVersionInfo = docVersionInfo; lookup.MyDocVersionInfo = docVersionInfo;
//DateTime dts = DateTime.Now; //DateTime dts = DateTime.Now;
if (itemInfo.MyContent.ContentGridCount > 0) if (itemInfo.MyContent.ContentGridCount > 0)
itemInfo.MyContent.LoadNonCachedGrid(); itemInfo.MyContent.LoadNonCachedGrid();
@ -2843,7 +2843,7 @@ namespace VEPROMS.CSLA.Library
// is used as a separator and the following code will not impact other formats // is used as a separator and the following code will not impact other formats
HighLevelStepTabPageList = @"\ul " + FormatStepData.TabData.IdentAltPrint.Substring(0, indxnewtab).Trim() + @"\ulnone " + tbformat; HighLevelStepTabPageList = @"\ul " + FormatStepData.TabData.IdentAltPrint.Substring(0, indxnewtab).Trim() + @"\ulnone " + tbformat;
else else
HighLevelStepTabPageList = FormatStepData.TabData.IdentAltPrint.Substring(0, indxnewtab) + tbformat; HighLevelStepTabPageList = FormatStepData.TabData.IdentAltPrint.Substring(0, indxnewtab) + tbformat;
_MyTab.AltPrintTab = newtab; _MyTab.AltPrintTab = newtab;
if (tbformate != null && tbformate != "") tbformat = tbformate; if (tbformate != null && tbformate != "") tbformat = tbformate;
} }

View File

@ -79,7 +79,7 @@ namespace VEPROMS.CSLA.Library
if (MyDifferences.ROConsistency.MyROChecks.Length > 0) if (MyDifferences.ROConsistency.MyROChecks.Length > 0)
{ {
sb.Append("Reference Objects Differences:\r\n"); sb.Append("Reference Objects Differences:\r\n");
ROFSTLookup lu = MyDocVersion.DocVersionAssociations[0].MyROFst.ROFSTLookup; ROFSTLookup lu = MyDocVersion.DocVersionAssociations[0].MyROFst.GetROFSTLookup(MyDocVersion);
foreach (ROCheck roc in MyDifferences.ROConsistency.MyROChecks) foreach (ROCheck roc in MyDifferences.ROConsistency.MyROChecks)
{ {
ROFSTLookup.rochild rocc = lu.GetRoChild12(roc.ROID); ROFSTLookup.rochild rocc = lu.GetRoChild12(roc.ROID);
@ -923,8 +923,8 @@ namespace VEPROMS.CSLA.Library
//_MyTimer.ActiveProcess = "Get MyROFst"; //_MyTimer.ActiveProcess = "Get MyROFst";
ROFstInfo rofst = ROFstInfo.GetJustROFst(dvi.DocVersionAssociations[0].ROFstID); ROFstInfo rofst = ROFstInfo.GetJustROFst(dvi.DocVersionAssociations[0].ROFstID);
//_MyTimer.ActiveProcess = "Get ROFst Lookup"; //_MyTimer.ActiveProcess = "Get ROFst Lookup";
rofst.docVer = dvi; //rofst.docVer = dvi;
ROFSTLookup lookup = rofst.ROFSTLookup; ROFSTLookup lookup = rofst.GetROFSTLookup(dvi);
//_MyTimer.ActiveProcess = "Populating RevisionChecksXML table"; //_MyTimer.ActiveProcess = "Populating RevisionChecksXML table";
cc.ROConsistency.ROFstDate = rofst.DTS; cc.ROConsistency.ROFstDate = rofst.DTS;
foreach (string s in myROIDs) foreach (string s in myROIDs)