diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/TransitionExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/TransitionExt.cs index eb2a7849..2b47b89f 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/TransitionExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/TransitionExt.cs @@ -676,37 +676,47 @@ namespace VEPROMS.CSLA.Library } public void AppendPrefix() { - if (HasText && Prefix != null) + if (Prefix == null) return; // no Prefix text to add + if (HasText) { - if (!_Results.ToString().EndsWith(_Prefix)) + if (!_Results.ToString().EndsWith(_Prefix)) //existing transition text does not end with Prefix text, OK to append _Results.Append(Prefix); _Prefix = null; } else if (_TranType == 4 && _ToItem.MoreThanOneStepSection()) { - if (!HasText && Prefix != null && Prefix.ToUpper().StartsWith(", STEP") - && _FromItem.ActiveFormat.Name.StartsWith("WEP")) - { - Console.WriteLine("Format,'{0}'", _FromItem.ActiveFormat.Name); - _Prefix = null; - return; - } + // WEP (Point Beach) is no longer a customer - commented out + //if (!HasText && Prefix.ToUpper().StartsWith(", STEP") + // && _FromItem.ActiveFormat.Name.StartsWith("WEP")) + //{ + // Console.WriteLine("Format,'{0}'", _FromItem.ActiveFormat.Name); + // _Prefix = null; + // return; + //} _Results.Append(Prefix); _Prefix = null; } - else if (_TranType == 5 && Prefix != null) - { - if (!HasText && Prefix.StartsWith(", ")) - _Results.Append(Prefix.TrimStart(", ".ToCharArray())); - else - _Results.Append(Prefix); - _Prefix = null; - } // If the prefix contains an open paren, we want to add the open paren regardless // of whether there already is text in the resulting string. - else if (!HasText && Prefix != null && Prefix.Contains("(")) + else if (!HasText && Prefix.Contains("(")) { _Results.Append(Prefix.TrimStart(" ".ToCharArray())); // since no text in result, trim starting space. + _Prefix = null; + } + else if (!HasText && Prefix.StartsWith(", ")) + { + _Results.Append(Prefix.TrimStart(", ".ToCharArray()));// no preceeding text, remove comma and space + _Prefix = null; + } + else if (!HasText && Prefix.StartsWith(",")) + { + _Results.Append(Prefix.TrimStart(",".ToCharArray())); // no preceeding text, remove comma + _Prefix = null; + } + else + { + _Results.Append(Prefix); // append prefix as is + _Prefix = null; } } public string OverridePrefix diff --git a/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs b/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs index 61c3d0a9..c586773b 100644 --- a/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs +++ b/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs @@ -6407,7 +6407,7 @@ public StepData Equation // equation has a parent of embedded object. } public TransData(XmlNode xmlNode) : base(xmlNode) { } - // a character that is placed before and after the title that's in the transition text + // a character that is placed before and after the procedure title that's in the transition text private LazyLoad _DelimiterForTransitionTitle; public string DelimiterForTransitionTitle { @@ -6684,7 +6684,9 @@ public StepData Equation // equation has a parent of embedded object. } } - // holdover from 16bit, used to define whether transitions are range (types 2 & 3). this is used in the logic for transitions with page numbers + // Holdover from 16bit, used to define whether transitions are range (types 2 & 3). + // This is used in the logic for transitions with page numbers. This gets defined as "Type" in the code for the transition class. + // NOTE: the TransType you see in the code is actually the index into the list of transition definitions for given format. private LazyLoad _Type; public int? Type {