diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs index 82e817e3..555ae6fa 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs @@ -34,7 +34,7 @@ namespace VEPROMS.CSLA.Library { // Walk up active parents until the parent is not an item Item tmp = this; - while (tmp.ActiveParent.GetType().Name != "DocVersion") tmp = (Item)tmp.ActiveParent; + while (tmp.ActiveParent.GetType() != typeof(DocVersion)) tmp = (Item)tmp.ActiveParent; return tmp; } } private IVEDrillDown _ActiveParent = null; @@ -261,6 +261,30 @@ namespace VEPROMS.CSLA.Library return false; } } + public bool IsSection + { + get + { + if ((MyContent.Type / 10000) == 1) return true; + return false; + } + } + public bool IsProcedure + { + get + { + if ((MyContent.Type / 10000) == 0) return true; + return false; + } + } + public bool IsStep + { + get + { + if ((MyContent.Type / 10000) == 2) return true; + return false; + } + } private E_FromType ItemType { get @@ -497,7 +521,7 @@ namespace VEPROMS.CSLA.Library { // Walk up active parents until the parent is not an item ItemInfo tmp = this; - while (tmp.ActiveParent.GetType().Name != "DocVersionInfo") tmp = (ItemInfo)tmp.ActiveParent; + while (tmp.ActiveParent.GetType() != typeof(DocVersionInfo)) tmp = (ItemInfo)tmp.ActiveParent; return tmp; } } diff --git a/PROMS/VEPROMS.CSLA.Library/VEObjects/VETreeNode.cs b/PROMS/VEPROMS.CSLA.Library/VEObjects/VETreeNode.cs index abd1a073..e9eb7811 100644 --- a/PROMS/VEPROMS.CSLA.Library/VEObjects/VETreeNode.cs +++ b/PROMS/VEPROMS.CSLA.Library/VEObjects/VETreeNode.cs @@ -181,7 +181,7 @@ namespace VEPROMS.CSLA.Library DateTime tStart = DateTime.Now; OnLoadingChildrenSQL(this, new VETreeNodeEventArgs()); IList ol; - if(_VEObject.GetType().Name == "StepInfo" ||_VEObject.GetType().Name == "SectionInfo" ||_VEObject.GetType().Name == "ItemInfo" ) + if(_VEObject.GetType() == typeof(StepInfo) ||_VEObject.GetType() == typeof(SectionInfo) ||_VEObject.GetType() == typeof(ItemInfo) ) ol = ((ItemInfo)_VEObject).GetChildren(allParts); else ol = _VEObject.GetChildren();