B2017-076 Added checks to see if we processed any transitions or ROs and added a status message at the end of importing explaining the procedure that was imported did not have transitions or ROs.

B2017-076 Added a Boolean return value to FixTransitionText so that we know if any transition was processed.
This commit is contained in:
2017-08-25 13:50:57 +00:00
parent 5ce26f2350
commit 52b40b0f5e
2 changed files with 31 additions and 12 deletions

View File

@@ -20,12 +20,13 @@ namespace VEPROMS.CSLA.Library
{
return string.Format("{0} {1}", Number, Text);
}
public void FixTransitionText(TransitionInfo tran)
public bool FixTransitionText(TransitionInfo tran) // B2017-076 return whether Transitions were processed (used when importing a procedure)
{
FixTransitionText(tran, false);
return FixTransitionText(tran, false);
}
public void FixTransitionText(TransitionInfo tran, bool forceConvertToText)
public bool FixTransitionText(TransitionInfo tran, bool forceConvertToText)
{
bool didFixATransition = false; // B2017-076 return whether Transitions were processed (used when importing a procedure)
//string transText = tran.ResolvePathTo();
//string lookFor = string.Format(@"<START\](\\[^v \\]+)*\\v0(\\[^v \\]+)* ([^#]*?)(\\[^v'? \\]+)*\\v(\\[^v \\]+)* #Link:Transition[^:]*?:{0} {1}( [0-9]*){{1,2}}\[END>", tran.TranType, tran.TransitionID);
////string lookFor = string.Format(@"<START\]\\v0 ([^#]*?)\\v #Link:Transition[^:]*?:{0} {1} [0-9]*\[END>", tran.TranType, tran.TransitionID);
@@ -81,12 +82,14 @@ namespace VEPROMS.CSLA.Library
}
if(tran != null)
Transition.Delete(tran.TransitionID);
didFixATransition = true; // B2017-076 return Transitions were processed (used when importing a procedure)
break;
}
//else if ((gg.Contains("\\u8209?") ? gg.Replace("\\u8209?", "-") : gg) != (newvalue.Contains("\\u8209?") ? newvalue.Replace("\\u8209?", "-") : newvalue))
else if ((gg.Replace(@"\u8209?", "-").Replace(@"\u9568?", @"\\")) != (newvalue.Replace(@"\u8209?", "-").Replace(@"\u9568?", @"\\")))
{
Text = Text.Substring(0, myIndex) + newvalue + Text.Substring(myIndex + myLength);
didFixATransition = true; // B2017-076 return Transitions were processed (used when importing a procedure)
break; // Text has been processed
}
}
@@ -125,16 +128,18 @@ namespace VEPROMS.CSLA.Library
newvalue = ProcessSpecChar(gg, newvalue, @"\u8593?","^");
if (newvalue.Contains(@"\u9586?")) // process backslash
newvalue = ProcessSpecChar(gg, newvalue, @"\u9586?",@"\\");
if (gg != newvalue)
{
if (gg != newvalue)
{
if (newvalue == "?")
ConvertTransitionToTextInGrid(tran, newvalue);
else
MyGrid.Data = MyGrid.Data.Substring(0, myIndex) + newvalue + MyGrid.Data.Substring(myIndex + myLength);
}
MyGrid.Data = MyGrid.Data.Substring(0, myIndex) + newvalue + MyGrid.Data.Substring(myIndex + myLength);
didFixATransition = true; // B2017-076 return Transitions were processed (used when importing a procedure)
}
}
}
}
return didFixATransition;
}
private string ProcessSpecChar(string orgText, string newValue, string specChar, string kbChar)