Modified code to use Section Title when Section Number is blank when creating a transition that uses procedure section

This commit is contained in:
Rich 2014-02-11 04:59:27 +00:00
parent df664a045a
commit e45307bce2

View File

@ -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;
}
}
}