Added method RofstInfo.GetROImageByFilename to find image files by name.

Added method RoImageInforList GetByRODbIDFilename to find image files by name.
Find ROImages if not attached to the current ROFST.  The Export/Import code was not saving ROImage usages properly
This commit is contained in:
Rich committed 2015-02-18 14:43:00 +00:00
1 parent 8d46574ec2
commit 14a0b600fd
3 files changed
+93 -2

No files matched your search

@@ -881,7 +881,26 @@ namespace VEPROMS.CSLA.Library
throw new DbCslaException("ROFstInfo.DataPortal_Fetch", ex);
}
}
public ROImageInfo GetROImageByFilename(string filename)
{
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);
return null;
}
ROImageInfo retval = null;
foreach (ROImageInfo image in images)
{
if (image.DTS > DTS && retval != null) break;
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());
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());
return retval;
}
}
public class ROFstInfoROTableUpdateEventArgs
{