C2016-023 - Copy using clipboard

Convert Transition to text if the destination procedure set is different than the current procedure set and the destination procedure number exists in the current procedure set.
C2016-023 - Copy Step
Convert Transition to text if the destination procedure set is different than the current procedure set and the destination procedure number exists in the current procedure set.
This commit is contained in:
Rich 2017-07-05 19:38:43 +00:00
parent 1315645a85
commit 111fe18565
2 changed files with 41 additions and 1 deletions

View File

@ -860,7 +860,27 @@ namespace VEPROMS.CSLA.Library
// Replace Transition Text
foreach (ContentTransition ct in ctReplacements.Values)
using (TransitionInfo tran = TransitionInfo.Get(ct.TransitionID))
_MyItem.MyContent.FixTransitionText(tran);
{ // C2016-023 Convert Transition to Text is the transtion is to a different procedure set
// and the destination proedure number matches a procedure number in the current set
bool forceConvertToText = false;
if (tran.MyContent.ContentItems[0].MyDocVersion.VersionID != tran.MyItemToID.MyDocVersion.VersionID &&
(tran.MyContent.ContentItems[0].ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList[tran.TranType].TransMenu.Contains("Proc") ||
tran.MyContent.ContentItems[0].ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList[tran.TranType].TransMenu.Contains("other proc")))
{
string destProcNumber = tran.MyItemToID.MyProcedure.DisplayNumber;
foreach (ProcedureInfo prci in tran.MyContent.ContentItems[0].MyDocVersion.Procedures)
{
if (prci.DisplayNumber == destProcNumber)
{
forceConvertToText = true;
break;
}
}
}
_MyItem.MyContent.FixTransitionText(tran,forceConvertToText);
}
_MyItem.Save();
}
if (roUsgReplacements.Count > 0)

View File

@ -838,6 +838,26 @@ namespace VEPROMS.CSLA.Library
!tran.MyContent.ContentItems[0].ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList[tran.TranType].TransMenu.Contains("other proc")) //B2017-068 paste with transition fix
forceConvertToText = true;
}
if (!forceConvertToText)
{
// C2016-023 Convert Transition to Text is the transtion is to a different procedure set
// and the destination proedure number matches a procedure number in the current set
if (tran.MyContent.ContentItems[0].MyDocVersion.VersionID != tran.MyItemToID.MyDocVersion.VersionID &&
(tran.MyContent.ContentItems[0].ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList[tran.TranType].TransMenu.Contains("Proc") ||
tran.MyContent.ContentItems[0].ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList[tran.TranType].TransMenu.Contains("other proc")))
{
string destProcNumber = tran.MyItemToID.MyProcedure.DisplayNumber;
foreach (ProcedureInfo prci in tran.MyContent.ContentItems[0].MyDocVersion.Procedures)
{
if (prci.DisplayNumber == destProcNumber)
{
forceConvertToText = true;
break;
}
}
}
}
content.FixTransitionText(tran, forceConvertToText);
if (content.IsDirty)
content.Save();