When restoring content or item changes in change manager, make sure update both ro values and transitions

This commit is contained in:
Rich 2013-05-21 14:14:45 +00:00
parent d09eac44b8
commit 53123154fc

View File

@ -1603,6 +1603,32 @@ namespace VEPROMS.CSLA.Library
} }
cont.Save(); cont.Save();
} }
if (cont.ContentRoUsageCount > 0)
{
ROFstInfo myrofst = tmp.MyContent.ContentItems[0].MyProcedure.MyDocVersion.DocVersionAssociations[0].MyROFst;
ROFSTLookup mylookup = myrofst.ROFSTLookup;
foreach (ContentRoUsage ro in cont.ContentRoUsages)
{
RoUsageInfo rou = RoUsageInfo.Get(ro.ROUsageID);
ROFSTLookup.rochild rocc = mylookup.GetRoChild12(rou.ROID);
if (rocc.value == null)
rocc = mylookup.GetRoChild(rou.ROID);
string myvalue = rocc.value;
//if (myvalue == null)
//{
// myvalue = rocc.children[0].value;
//}
int mytype = rocc.type;
cont.FixContentText(rou, myvalue, mytype, null);
}
Content cctmp = cont;
if (cont.IsDirty)
{
cctmp.DTS = DateTime.Now;
cctmp = cont.Save();
}
ContentInfo.Refresh(cctmp);
}
} }
return tmp; return tmp;
} }
@ -1761,14 +1787,36 @@ namespace VEPROMS.CSLA.Library
tmp.RefreshContentParts(); tmp.RefreshContentParts();
tmp.RefreshContentRoUsages(); tmp.RefreshContentRoUsages();
tmp.RefreshContentTransitions(); tmp.RefreshContentTransitions();
if (tmp.ContentTransitions != null)
{
foreach (TransitionInfo tran in tmp.ContentTransitions)
{
if (tran.MyItemToID != null)
tran.MyItemToID.UpdateTransitionText();
}
}
using (Content ctmp = tmp.Get()) using (Content ctmp = tmp.Get())
{ {
if (ctmp.ContentTransitionCount > 0)
{
foreach (ContentTransition tran in ctmp.ContentTransitions)
{
ctmp.FixTransitionText(TransitionInfo.Get(tran.TransitionID));
}
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.ROFSTLookup;
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);
if (rocc.value == null)
rocc = mylookup.GetRoChild(rou.ROID);
string myvalue = rocc.value; string myvalue = rocc.value;
//if (myvalue == null)
//{
// myvalue = rocc.children[0].value;
//}
int mytype = rocc.type; int mytype = rocc.type;
ctmp.FixContentText(rou, myvalue, mytype, null); ctmp.FixContentText(rou, myvalue, mytype, null);
} }