Changed logic to find ROs or XY Plots. VEPROMS_BGE/OI-34 has the text

<<<--Isolators-->>> which was being identified as an XY Plot and then as an RO.
Add location information to the error log for RO Image problems
Reduce duplicated error log messages for RO Value update
This commit is contained in:
Rich 2015-02-20 17:39:13 +00:00
parent 64b3b06375
commit a54c2eaa09
2 changed files with 21 additions and 9 deletions

View File

@ -1279,8 +1279,8 @@ namespace VEPROMS.CSLA.Library
{
if (roValue == null)
{
sel.Text = "RO Not Found";
sel.Font.Color = LBWdColor.wdColorRed;
//sel.Text = "RO Not Found";
//sel.Font.Color = LBWdColor.wdColorRed;
}
else
{
@ -1341,7 +1341,7 @@ namespace VEPROMS.CSLA.Library
// - Dash
// [!<> ]@ - 1 or more characters not including Less-Than, Greater-Than or Space
// [>] - Greater-Than Character
find.Text = "[<][<]*[>][>]";
find.Text = "[<][<]G*[>][>]";
//find.Wrap = LBWdFindWrap.wdFindStop;
find.Wrap = LBWdFindWrap.wdFindContinue;
find.MatchCase = false;
@ -1366,12 +1366,12 @@ namespace VEPROMS.CSLA.Library
// If you do a search in MSWord, make sure wildcard box is checked and then press the
// Special button to see the definitions of the various wildcards
// [<] - Less-Than Character
// [!<> ]@ - 1 or more characters not including Less-Than, Greater-Than or Space
// [!<> -]@ - 1 or more characters not including Less-Than, Greater-Than, Dash or Space
// - Dash
// [!<>]@ - 1 or more characters not including Less-Than, Greater-Than.
// a space be included as part of the accessory page id (Callaway, EOP Addendum 37)
// [>] - Greater-Than Character
find.Text = "[<][!<> ]@-[!<>]@[>]";
find.Text = "[<][!<> -]@-[!<>]@[>]";
find.Wrap = LBWdFindWrap.wdFindContinue;
find.MatchCase = false;
find.MatchWholeWord = false;

View File

@ -881,12 +881,12 @@ namespace VEPROMS.CSLA.Library
throw new DbCslaException("ROFstInfo.DataPortal_Fetch", ex);
}
}
public ROImageInfo GetROImageByFilename(string filename)
public ROImageInfo GetROImageByFilename(string filename, ItemInfo myItemInfo)
{
ROImageInfoList images = ROImageInfoList.GetByRODbIDFilename(RODbID, filename);
if (images == null || images.Count == 0)
{
_MyLog.WarnFormat("\r\nReferenced Object Image {0} Missing\r\nNeed to Update RO Values",filename);
ROWarning(myItemInfo,"Referenced Object Image {0} Missing", filename);
return null;
}
ROImageInfo retval = null;
@ -896,11 +896,23 @@ namespace VEPROMS.CSLA.Library
retval = image;
}
if(retval.DTS > DTS)
_MyLog.WarnFormat("\r\nReferenced Object Image {0} newer {1} than RO.FST {2}\r\nNeed to Update RO Values",filename,retval.DTS.ToShortDateString(),DTS.ToShortDateString());
ROWarning(myItemInfo, "Referenced Object Image {0} newer {1} than RO.FST {2}", filename, retval.DTS.ToShortDateString(), DTS.ToShortDateString());
else
_MyLog.WarnFormat("Referenced Object Image {0} older {1} then RO.FST {2}\r\nNeed to Update RO Values",filename,retval.DTS.ToShortDateString(),DTS.ToShortDateString());
ROWarning(myItemInfo, "Referenced Object Image {0} older {1} then RO.FST {2}", filename, retval.DTS.ToShortDateString(), DTS.ToShortDateString());
return retval;
}
private static List<int> DocVersionsNeedingROUpdate = new List<int>();
private static void ROWarning(ItemInfo myItemInfo, string format, params object[] args)
{
int key = 0;
if(myItemInfo.MyDocVersion != null) key = myItemInfo.MyDocVersion.VersionID;
if (!DocVersionsNeedingROUpdate.Contains(key))
{
string prefix = string.Format("\r\nNeed to Update RO Values for {0}\r\nProcedure {1}\r\n" , myItemInfo.SearchDVPath ,myItemInfo.MyProcedure.DisplayNumber);
_MyLog.WarnFormat(prefix + format, args);
DocVersionsNeedingROUpdate.Add(key);
}
}
}
public class ROFstInfoROTableUpdateEventArgs
{