Replace GetType().Name

This commit is contained in:
Rich 2008-03-27 19:35:47 +00:00
parent f2764894ba
commit 7caa952bc3
2 changed files with 27 additions and 3 deletions

View File

@ -34,7 +34,7 @@ namespace VEPROMS.CSLA.Library
{ {
// Walk up active parents until the parent is not an item // Walk up active parents until the parent is not an item
Item tmp = this; 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; return tmp;
} }
} private IVEDrillDown _ActiveParent = null; } private IVEDrillDown _ActiveParent = null;
@ -261,6 +261,30 @@ namespace VEPROMS.CSLA.Library
return false; 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 private E_FromType ItemType
{ {
get get
@ -497,7 +521,7 @@ namespace VEPROMS.CSLA.Library
{ {
// Walk up active parents until the parent is not an item // Walk up active parents until the parent is not an item
ItemInfo tmp = this; 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; return tmp;
} }
} }

View File

@ -181,7 +181,7 @@ namespace VEPROMS.CSLA.Library
DateTime tStart = DateTime.Now; DateTime tStart = DateTime.Now;
OnLoadingChildrenSQL(this, new VETreeNodeEventArgs()); OnLoadingChildrenSQL(this, new VETreeNodeEventArgs());
IList ol; 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); ol = ((ItemInfo)_VEObject).GetChildren(allParts);
else else
ol = _VEObject.GetChildren(); ol = _VEObject.GetChildren();