use DisplayNumber and DisplayText

This commit is contained in:
John Jenko 2009-07-24 21:32:16 +00:00
parent 73407f36d0
commit cf69fdd572
2 changed files with 21 additions and 15 deletions

View File

@ -85,7 +85,7 @@ namespace VEPROMS.CSLA.Library
foreach (ItemInfo myItem in myEntry.MyContent.ContentItems)
{
ItemInfo proc = myItem.MyProcedure;
sb.Append(sep + proc.MyContent.Number + " - " + proc.MyContent.Text);
sb.Append(sep + proc.DisplayNumber + " - " + proc.DisplayText);
sep = "\r\n ";
}
}

View File

@ -856,9 +856,11 @@ namespace VEPROMS.CSLA.Library
//return string.Format("{0}{1} {2}", (editable == null ? "" : (editable.IsDirty ? "* " : "")),
// (MyContent.Type >= 20000 ? Ordinal.ToString() + "." : MyContent.Number), MyContent.Text);
ContentInfo cont = MyContent;
string number = cont.Number;
//string number = cont.Number;
string number = DisplayNumber;
if (cont.Type >= 20000) number = Ordinal.ToString() + ".";
return string.Format("{0} {1}", number, cont.Text).Trim();
return string.Format("{0} {1}", number, DisplayText).Trim();
//return string.Format("{0} {1}", number, cont.Text).Trim();
//return string.Format("{0} {1}", cont.Number, cont.Text);
//return "Now is the time for all good men to come to the aid of their country!";
}
@ -882,7 +884,7 @@ namespace VEPROMS.CSLA.Library
}
public string ShortSearchPath
{
get { return Regex.Replace(_SearchPath, "\x11.*?\x07", "\x07"); }
get { return ConvertToDisplayText(Regex.Replace(_SearchPath, "\x11.*?\x07", "\x07")); }
}
internal int _SearchAnnotationID;
public int SearchAnnotationID
@ -903,6 +905,10 @@ namespace VEPROMS.CSLA.Library
{
get { return ConvertToDisplayText(MyContent.Text); }
}
public string DisplayNumber
{
get { return ConvertToDisplayText(MyContent.Number); }
}
public static string ConvertToDisplayText(string txt)
{
string retval = txt;
@ -960,11 +966,11 @@ namespace VEPROMS.CSLA.Library
{
get
{
string number = (MyContent.Type >= 20000 ? Ordinal.ToString() + "." : (nz(MyContent.Number,"")==""? MyContent.Text: MyContent.Number));
string number = (MyContent.Type >= 20000 ? Ordinal.ToString() + "." : (nz(DisplayNumber,"")==""? DisplayText: DisplayNumber));
ItemInfo parent = this;
while (parent.MyPrevious != null) parent = parent.MyPrevious;
if (parent.ItemPartCount == 0)
return number + ", " + MyContent.Text;
return number + ", " + DisplayText;
else
{
PartInfo partInfo = parent.ItemParts[0];
@ -1097,12 +1103,12 @@ namespace VEPROMS.CSLA.Library
get
{
if (MyContent.MyEntry == null)
return MyContent.Number + " - " + MyContent.Text;
return DisplayNumber + " - " + DisplayText;
string toolTip = MyProcedure.TabToolTip + "\r\n";
if (MyContent.Number != "")
toolTip += MyContent.Number + " - " + MyContent.Text;
toolTip += DisplayNumber + " - " + DisplayText;
else
toolTip += MyContent.Text;
toolTip += DisplayText;
DocumentInfo myDocument = MyContent.MyEntry.MyDocument;
if (myDocument.LibTitle != "")
{
@ -1117,12 +1123,12 @@ namespace VEPROMS.CSLA.Library
get
{
if (MyContent.MyEntry == null)
return MyContent.Number;
return DisplayNumber.Replace("\u2011","-");
if (MyContent.Number != "")
return ((MyContent.MyEntry.MyDocument.LibTitle ?? "")== "" ? "" : "\xA3 ") + MyContent.Number;
if (MyContent.Text.Length <= 10)
return MyContent.Text;
return MyContent.Text.Split(" ,.;:-_".ToCharArray())[0] + "...";
return ((MyContent.MyEntry.MyDocument.LibTitle ?? "")== "" ? "" : "\xA3 ") + DisplayNumber;
if (DisplayText.Length <= 10)
return DisplayText.Replace("\u2011", "-");
return DisplayText.Replace("\u2011", "-").Split(" ,.;:-_".ToCharArray())[0]+ "...";
}
}
#region IVEReadOnlyItem
@ -1431,7 +1437,7 @@ namespace VEPROMS.CSLA.Library
}
catch (Exception ex)
{
throw new DbCslaException("Error on ItemInfoList.GetChildren", ex);
throw new DbCslaException("Error on ItemInfoList.GetListFromTextSearch", ex);
}
}
[Serializable()]