From baf43ff8a200c9b5945a15f0a0b2fb724ece702b Mon Sep 17 00:00:00 2001 From: Rich Date: Wed, 13 Aug 2008 12:28:05 +0000 Subject: [PATCH] Added FullName property --- .../Extension/FormatExt.cs | 41 +++++++++++++++++-- 1 file changed, 38 insertions(+), 3 deletions(-) diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/FormatExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/FormatExt.cs index 97f764cc..a7b65896 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/FormatExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/FormatExt.cs @@ -17,6 +17,7 @@ using System.Configuration; using System.IO; using System.Xml; using System.Drawing; +using System.ComponentModel; namespace VEPROMS.CSLA.Library { @@ -24,14 +25,23 @@ namespace VEPROMS.CSLA.Library { #region PlantFormat [NonSerialized] - private PlantFormat _PlantFormat; + private PlantFormat _PlantFormat; public PlantFormat PlantFormat { get { return (_PlantFormat != null ? _PlantFormat : _PlantFormat = new PlantFormat(this)); } } #endregion public override string ToString() { //return Name; - return PlantFormat.FormatData.Name; + //return PlantFormat.FormatData.Name; + return FullName; + } + public string FullName + { + get + { + if (ParentID == 1) return Description + " (" + Name + ")"; + return MyParent.Description + " - " + Description + " (" + Name + ")"; + } } } public partial class FormatInfo @@ -45,7 +55,32 @@ namespace VEPROMS.CSLA.Library public override string ToString() { //return Name; - return PlantFormat.FormatData.Name; + //return PlantFormat.FormatData.Name; + return FullName; + } + public string FullName + { + get + { + if (ParentID == 1) return Description + " (" + Name + ")"; + return MyParent.Description + " - " + Description + " (" + Name + ")"; + } + } + } + public partial class FormatInfoList + { + private static Csla.SortedBindingList _SortedFormatInfoList; + public static Csla.SortedBindingList SortedFormatInfoList + { + get + { + if (_SortedFormatInfoList == null) + { + _SortedFormatInfoList = new SortedBindingList(FormatInfoList.Get()); + _SortedFormatInfoList.ApplySort("FullName", ListSortDirection.Ascending); + } + return _SortedFormatInfoList; + } } } }