Revert to previous version
This commit is contained in:
@@ -590,11 +590,9 @@ namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
TranCheckCount = 0;
|
||||
TranFixCount = 0;
|
||||
TranConvertCount = 0;// B2018-002 - Invalid Transitions - Initialize Transition Conversion Count
|
||||
}
|
||||
public static int TranCheckCount = 0;
|
||||
public static int TranFixCount = 0;
|
||||
public static int TranConvertCount = 0;// B2018-002 - Invalid Transitions - Declare Transition Conversion Count
|
||||
internal static TransitionInfoList TransitionsToDisconnected;
|
||||
internal static TransitionInfoList TransitionsToNonEditable;
|
||||
internal static void MyRefreshTransitions(ItemInfo itemInfo, IVEDrillDownReadOnly itemParent, SectionInfo sectionInfo, ProcedureInfo procInfo, DocVersionInfo docVersionInfo, TransitionLookup tranLookup)
|
||||
@@ -623,9 +621,7 @@ namespace VEPROMS.CSLA.Library
|
||||
//foreach (ItemInfo ii in myItems)
|
||||
MyRefreshTransitions(ii, itemInfo, (itemInfo as SectionInfo) ?? sectionInfo, procInfo, docVersionInfo, tranLookup);
|
||||
}
|
||||
// B2018-002 - Invalid Transitions - Convert Invalid Transitions to Text
|
||||
// An invalid transition is a transition embedded in the content text that does not match the transition table record.
|
||||
if(ConvertInvalidTransitionsToText(itemInfo))
|
||||
if (itemInfo.MyContent.ContentTransitionCount > 0)
|
||||
{
|
||||
itemInfo.ResetOrdinal();
|
||||
foreach (TransitionInfo traninfo in itemInfo.MyContent.ContentTransitions)
|
||||
@@ -665,14 +661,14 @@ namespace VEPROMS.CSLA.Library
|
||||
if (itemInfo.MyProcedure.ItemID != traninfo.MyItemToID.MyProcedure.ItemID) //different proc
|
||||
if (!itemInfo.ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList[traninfo.TranType].TransMenu.Contains("Proc")) //internal format
|
||||
if (!itemInfo.ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList[traninfo.TranType].TransMenu.Contains("other proc")) //B2017-068 paste with transition fix
|
||||
{
|
||||
forceConvertToText = true;
|
||||
TranFixCount++;
|
||||
itemInfo.MyContent.FixTransitionText(traninfo, itemInfo, "Reason for Change: Transition to External Procedure using Internal Format");
|
||||
Content content = Content.Get(itemInfo.MyContent.ContentID);
|
||||
content.FixTransitionText(traninfo, true);
|
||||
content.Save();
|
||||
}
|
||||
{
|
||||
forceConvertToText = true;
|
||||
TranFixCount++;
|
||||
itemInfo.MyContent.FixTransitionText(traninfo, itemInfo, "Reason for Change: Transition to External Procedure using Internal Format");
|
||||
Content content = Content.Get(itemInfo.MyContent.ContentID);
|
||||
content.FixTransitionText(traninfo, true);
|
||||
content.Save();
|
||||
}
|
||||
}
|
||||
if (!forceConvertToText)
|
||||
{
|
||||
@@ -680,14 +676,14 @@ namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
if (!itemInfo.ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList[traninfo.TranType].TransMenu.Contains("Proc")) //internal format
|
||||
if (!itemInfo.ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList[traninfo.TranType].TransMenu.Contains("other proc")) //B2017-068 paste with transition fix
|
||||
{
|
||||
forceConvertToText = true;
|
||||
TranFixCount++;
|
||||
itemInfo.MyContent.FixTransitionText(traninfo, itemInfo, "Reason for Change: Transition to Outside Procedure using Internal Format");
|
||||
Content content = Content.Get(itemInfo.MyContent.ContentID);
|
||||
content.FixTransitionText(traninfo, true);
|
||||
content.Save();
|
||||
}
|
||||
{
|
||||
forceConvertToText = true;
|
||||
TranFixCount++;
|
||||
itemInfo.MyContent.FixTransitionText(traninfo, itemInfo, "Reason for Change: Transition to Outside Procedure using Internal Format");
|
||||
Content content = Content.Get(itemInfo.MyContent.ContentID);
|
||||
content.FixTransitionText(traninfo, true);
|
||||
content.Save();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!forceConvertToText)
|
||||
@@ -697,7 +693,7 @@ namespace VEPROMS.CSLA.Library
|
||||
string newText = itemInfo.MyContent.Text;
|
||||
// B2017-165 added check of newValue (special case for old 16-bit transition that was not fixed by the customer)
|
||||
string newValue = traninfo.ResolvePathTo(itemInfo.ActiveFormat, itemInfo, traninfo.TranType, traninfo.MyItemToID, traninfo.MyItemRangeID);
|
||||
if (newText != oldText || newValue == "?")
|
||||
if (newText != oldText|| newValue == "?")
|
||||
{
|
||||
TranFixCount++;
|
||||
Content content = Content.Get(itemInfo.MyContent.ContentID);
|
||||
@@ -708,42 +704,6 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
}
|
||||
}
|
||||
// // B2018-002 - Invalid Transitions - Method to check for invalid transitions and convert them to text
|
||||
public static bool ConvertInvalidTransitionsToText(ItemInfo itemInfo)
|
||||
{
|
||||
bool retval = true;
|
||||
MatchCollection mc = Regex.Matches(itemInfo.MyContent.Text, @"\#Link\:Transition");
|
||||
if (itemInfo.MyContent.ContentTransitionCount <= 0 || mc.Count > itemInfo.MyContent.ContentTransitionCount)
|
||||
{
|
||||
retval = false;
|
||||
if (itemInfo.MyContent.Text.Contains("Link:Transition"))
|
||||
{
|
||||
//Console.WriteLine("\"TranCount\"\t\"{0}\"\t{1}\t{2}\t{3}", itemInfo.ShortPath, itemInfo.ItemID, mc.Count, itemInfo.MyContent.ContentTransitionCount);
|
||||
Content content = Content.Get(itemInfo.MyContent.ContentID);
|
||||
//if (itemInfo.InList(616031, 615898, 5516866))
|
||||
// Console.WriteLine("here");
|
||||
if (itemInfo.MyContent.ContentTransitions != null)
|
||||
foreach (TransitionInfo ct in itemInfo.MyContent.ContentTransitions)
|
||||
Transition.Delete(ct.TransitionID);
|
||||
itemInfo.MyContent.RefreshContentTransitions();
|
||||
//if (content.Text.Contains("Link:TransitionRange"))
|
||||
// Console.WriteLine("Here");
|
||||
while (content.Text.Contains("Link:Transition"))
|
||||
{
|
||||
TranCheckCount++;
|
||||
TranConvertCount++;
|
||||
if (content.FixTransitionText(null, true))
|
||||
{
|
||||
ContentInfo.OnStaticContentInfoChange(itemInfo, new StaticContentInfoEventArgs("", "", ""));
|
||||
if (itemInfo.MyContent.MyGrid != null)
|
||||
content.ConvertTransitionToTextInGrid(null, null);
|
||||
content.Save();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
//private static bool IsTransitionToDisconnected(TransitionInfo ti)
|
||||
//{
|
||||
// foreach (TransitionInfo til in TransitionsToDisconnected)
|
||||
|
Reference in New Issue
Block a user