From e45307bce228e4495295713b88fce7bd466cb3fc Mon Sep 17 00:00:00 2001 From: Rich Date: Tue, 11 Feb 2014 04:59:27 +0000 Subject: [PATCH] Modified code to use Section Title when Section Number is blank when creating a transition that uses procedure section --- .../Extension/TransitionExt.cs | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/TransitionExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/TransitionExt.cs index 5e61cee2..9abc5ec4 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/TransitionExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/TransitionExt.cs @@ -955,7 +955,11 @@ namespace VEPROMS.CSLA.Library //if (TranGetSectionItem(itminfo).IsDefaultSection) return; StringBuilder retstr = new StringBuilder(); retstr.Append(TranGetSectionNumber(tb._ToItem)); - string txt = TranGetSectionTitle(tb,tb._ToItem); + string txt; + if(retstr.Length > 0) + txt = TranGetSectionTitle(tb,tb._ToItem); + else + txt = TranGetSectionTitle(tb,tb._ToItem, true); if (retstr.Length > 0 && (txt!=null && txt.Length > 0)) retstr.Append(", "); retstr.Append(txt); tb.AppendPrefix(); @@ -1073,5 +1077,19 @@ namespace VEPROMS.CSLA.Library } return null; } + private static string TranGetSectionTitle(TransitionBuilder tb, ItemInfo itminfo, bool overRide) + { + // LATER: Cap1stSectionTitle, CapFirstLetterOnly + if (overRide) + { + ItemInfo tmpitm = TranGetSectionItem(itminfo); + string sectionTitle = tmpitm.MyContent.Text; + sectionTitle = (tb._FormatData.TransData.CapsTransitionsSection ? sectionTitle.ToUpper().Replace(@"\U", @"\u") : + tb._FormatData.TransData.Cap1stCharTransSection ? CapFirstLetterOnly(sectionTitle, 0) : + sectionTitle); + return (sectionTitle); + } + return null; + } } }