Added logic to only process RO value updates for the specified DocVersion.
This commit is contained in:
@@ -284,6 +284,7 @@ namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
docver.DocVersionAssociations[0].MyROFst = rofst;
|
||||
docver.Save();
|
||||
UpdateROValuesText(origROFst, rofst,docver.VersionID.ToString());
|
||||
return rofst;
|
||||
}
|
||||
|
||||
@@ -322,7 +323,7 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
// Now update the usages: compare old to new rofsts and update usages accordingly, i.e. modified
|
||||
// values, deleted ros, etc.
|
||||
UpdateROValuesText(origROFst, rofst);
|
||||
UpdateROValuesText(origROFst, rofst, docver.VersionID.ToString());
|
||||
return rofst;
|
||||
}
|
||||
}
|
||||
@@ -348,7 +349,7 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
return sb.ToString();
|
||||
}
|
||||
private static void UpdateROValuesText(ROFstInfo origROFstInfo, ROFst newROFst)
|
||||
private static void UpdateROValuesText(ROFstInfo origROFstInfo, ROFst newROFst, string versionList)
|
||||
{
|
||||
ROFSTLookup origLU = new ROFSTLookup(origROFstInfo);
|
||||
ROFSTLookup newLU = new ROFSTLookup(newROFst);
|
||||
@@ -365,7 +366,7 @@ namespace VEPROMS.CSLA.Library
|
||||
// roid's are stored in database as 16 characters long in the rousages table. They may be stored
|
||||
// as 12 characters in the ro.fst.
|
||||
string padroid = chg.Length <= 12 ? chg + "0000" : chg;
|
||||
using (RoUsageInfoList affected = RoUsageInfoList.GetAffected(origROFstInfo.MyRODb.RODbID, padroid, desc, "Changed"))
|
||||
using (RoUsageInfoList affected = RoUsageInfoList.GetAffected(origROFstInfo.MyRODb.RODbID, padroid, desc, "Changed", versionList))
|
||||
{
|
||||
foreach (RoUsageInfo roUsg in affected)
|
||||
{
|
||||
@@ -398,7 +399,7 @@ namespace VEPROMS.CSLA.Library
|
||||
// roid's are stored in database as 16 characters long in the rousages table. They may be stored
|
||||
// as 12 characters in the ro.fst.
|
||||
string padroid = chg.Length <= 12 ? chg + "0000" : chg;
|
||||
using (DROUsageInfoList affected = DROUsageInfoList.GetAffected(origROFstInfo.MyRODb.RODbID, padroid.Substring(0,12), desc, "Changed"))
|
||||
using (DROUsageInfoList affected = DROUsageInfoList.GetAffected(origROFstInfo.MyRODb.RODbID, padroid.Substring(0, 12), desc, "Changed", versionList))
|
||||
{
|
||||
foreach (DROUsageInfo droUsg in affected)
|
||||
{
|
||||
@@ -411,7 +412,7 @@ namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
string desc = string.Format("Deleted RO: Value = {0}", origLU.GetRoValue(del));
|
||||
string padroiddel = del.Length <= 12 ? del + "0000" : del;
|
||||
using (RoUsageInfoList affected = RoUsageInfoList.GetAffected(origROFstInfo.MyRODb.RODbID, padroiddel, desc, "Deleted"))
|
||||
using (RoUsageInfoList affected = RoUsageInfoList.GetAffected(origROFstInfo.MyRODb.RODbID, padroiddel, desc, "Deleted",versionList))
|
||||
{
|
||||
foreach (RoUsageInfo roUsg in affected)
|
||||
{
|
||||
@@ -428,7 +429,7 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
}
|
||||
}
|
||||
using (DROUsageInfoList Daffected = DROUsageInfoList.GetAffected(origROFstInfo.MyRODb.RODbID, del.Substring(0,12), desc, "Deleted"))
|
||||
using (DROUsageInfoList Daffected = DROUsageInfoList.GetAffected(origROFstInfo.MyRODb.RODbID, del.Substring(0, 12), desc, "Deleted", versionList))
|
||||
{
|
||||
foreach (DROUsageInfo droUsg in Daffected)
|
||||
{
|
||||
|
Reference in New Issue
Block a user