Added UpdateDRoUsages to Update DROUsages when a Document is Saved

Added a list of ROIDs as a parameter to the code that walks through the MSWORD Document text and replaces ROs with their values
Fixed search string in FindRO
Added code to call GetAffectedDROUsages when an RO changes.
This adds annotations to show the changes to RO Values.
Added DROUsages table to capture ROUsages in Documents
This commit is contained in:
Rich
2011-01-20 20:22:10 +00:00
parent 7cdc7f4994
commit c4344f2308
7 changed files with 280 additions and 22 deletions

View File

@@ -169,6 +169,44 @@ namespace VEPROMS.CSLA.Library
return _UserID;
}
}
private int _RODbDROUsageCount = 0;
/// <summary>
/// Count of RODbDROUsages for this RODb
/// </summary>
public int RODbDROUsageCount
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty("RODbDROUsageCount", true);
if (_RODbDROUsageCount < 0)
_RODbDROUsageCount = RODbDROUsages.Count;
return _RODbDROUsageCount;
}
}
private DROUsageInfoList _RODbDROUsages = null;
[TypeConverter(typeof(DROUsageInfoListConverter))]
public DROUsageInfoList RODbDROUsages
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty("RODbDROUsages", true);
if (_RODbDROUsageCount < 0 || (_RODbDROUsageCount > 0 && _RODbDROUsages == null))
_RODbDROUsages = DROUsageInfoList.GetByRODbID(_RODbID);
if (_RODbDROUsageCount < 0)
_RODbDROUsageCount = _RODbDROUsages.Count;
return _RODbDROUsages;
}
}
public void RefreshRODbDROUsages()
{
_RODbDROUsageCount = -1;
ConvertListToDictionary();
if (_CacheByPrimaryKey.ContainsKey(_RODbID.ToString()))
foreach (RODbInfo tmp in _CacheByPrimaryKey[_RODbID.ToString()])
tmp._RODbDROUsageCount = -1; // This will cause the data to be requeried
}
private int _RODbROFstCount = 0;
/// <summary>
/// Count of RODbROFsts for this RODb
@@ -407,6 +445,7 @@ namespace VEPROMS.CSLA.Library
_Config = dr.GetString("Config");
_DTS = dr.GetDateTime("DTS");
_UserID = dr.GetString("UserID");
_RODbDROUsageCount = dr.GetInt32("DROUsageCount");
_RODbROFstCount = dr.GetInt32("ROFstCount");
_RODbROImageCount = dr.GetInt32("ROImageCount");
_RODbRoUsageCount = dr.GetInt32("RoUsageCount");