Reset related lists

This commit is contained in:
Rich
2009-02-06 15:55:52 +00:00
parent 1731dbe43b
commit 26f8e03a8c
29 changed files with 360 additions and 71 deletions

View File

@@ -310,13 +310,19 @@ namespace VEPROMS.CSLA.Library
get
{
CanReadProperty("ItemAnnotations", true);
if (_ItemAnnotationCount > 0 && _ItemAnnotations == null)
if (_ItemAnnotationCount < 0 || (_ItemAnnotationCount > 0 && _ItemAnnotations == null))
_ItemAnnotations = ItemAnnotations.GetByItemID(ItemID);
else if (_ItemAnnotations == null)
if (_ItemAnnotationCount < 0 )
_ItemAnnotationCount = _ItemAnnotations == null ? 0 : _ItemAnnotations.Count;
if (_ItemAnnotations == null)
_ItemAnnotations = ItemAnnotations.New();
return _ItemAnnotations;
}
}
public void Reset_ItemAnnotations()
{
_ItemAnnotationCount = -1;
}
private int _ItemDocVersionCount = 0;
/// <summary>
/// Count of ItemDocVersions for this Item
@@ -341,13 +347,19 @@ namespace VEPROMS.CSLA.Library
get
{
CanReadProperty("ItemDocVersions", true);
if (_ItemDocVersionCount > 0 && _ItemDocVersions == null)
if (_ItemDocVersionCount < 0 || (_ItemDocVersionCount > 0 && _ItemDocVersions == null))
_ItemDocVersions = ItemDocVersions.GetByItemID(ItemID);
else if (_ItemDocVersions == null)
if (_ItemDocVersionCount < 0 )
_ItemDocVersionCount = _ItemDocVersions == null ? 0 : _ItemDocVersions.Count;
if (_ItemDocVersions == null)
_ItemDocVersions = ItemDocVersions.New();
return _ItemDocVersions;
}
}
public void Reset_ItemDocVersions()
{
_ItemDocVersionCount = -1;
}
private int _NextItemCount = 0;
/// <summary>
/// Count of NextItems for this Item
@@ -372,13 +384,19 @@ namespace VEPROMS.CSLA.Library
get
{
CanReadProperty("NextItems", true);
if (_NextItemCount > 0 && _NextItems == null)
if (_NextItemCount < 0 || (_NextItemCount > 0 && _NextItems == null))
_NextItems = NextItems.GetByPreviousID(ItemID);
else if (_NextItems == null)
if (_NextItemCount < 0 )
_NextItemCount = _NextItems == null ? 0 : _NextItems.Count;
if (_NextItems == null)
_NextItems = NextItems.New();
return _NextItems;
}
}
public void Reset_NextItems()
{
_NextItemCount = -1;
}
private int _ItemPartCount = 0;
/// <summary>
/// Count of ItemParts for this Item
@@ -403,13 +421,19 @@ namespace VEPROMS.CSLA.Library
get
{
CanReadProperty("ItemParts", true);
if (_ItemPartCount > 0 && _ItemParts == null)
if (_ItemPartCount < 0 || (_ItemPartCount > 0 && _ItemParts == null))
_ItemParts = ItemParts.GetByItemID(ItemID);
else if (_ItemParts == null)
if (_ItemPartCount < 0 )
_ItemPartCount = _ItemParts == null ? 0 : _ItemParts.Count;
if (_ItemParts == null)
_ItemParts = ItemParts.New();
return _ItemParts;
}
}
public void Reset_ItemParts()
{
_ItemPartCount = -1;
}
private int _ItemTransition_RangeIDCount = 0;
/// <summary>
/// Count of ItemTransitions for this Item
@@ -434,13 +458,19 @@ namespace VEPROMS.CSLA.Library
get
{
CanReadProperty("ItemTransitions_RangeID", true);
if (_ItemTransition_RangeIDCount > 0 && _ItemTransitions_RangeID == null)
if (_ItemTransition_RangeIDCount < 0 || (_ItemTransition_RangeIDCount > 0 && _ItemTransitions_RangeID == null))
_ItemTransitions_RangeID = ItemTransitions_RangeID.GetByRangeID(ItemID);
else if (_ItemTransitions_RangeID == null)
if (_ItemTransition_RangeIDCount < 0 )
_ItemTransition_RangeIDCount = _ItemTransitions_RangeID == null ? 0 : _ItemTransitions_RangeID.Count;
if (_ItemTransitions_RangeID == null)
_ItemTransitions_RangeID = ItemTransitions_RangeID.New();
return _ItemTransitions_RangeID;
}
}
public void Reset_ItemTransitions_RangeID()
{
_ItemTransition_RangeIDCount = -1;
}
private int _ItemTransition_ToIDCount = 0;
/// <summary>
/// Count of ItemTransitions for this Item
@@ -465,13 +495,19 @@ namespace VEPROMS.CSLA.Library
get
{
CanReadProperty("ItemTransitions_ToID", true);
if (_ItemTransition_ToIDCount > 0 && _ItemTransitions_ToID == null)
if (_ItemTransition_ToIDCount < 0 || (_ItemTransition_ToIDCount > 0 && _ItemTransitions_ToID == null))
_ItemTransitions_ToID = ItemTransitions_ToID.GetByToID(ItemID);
else if (_ItemTransitions_ToID == null)
if (_ItemTransition_ToIDCount < 0 )
_ItemTransition_ToIDCount = _ItemTransitions_ToID == null ? 0 : _ItemTransitions_ToID.Count;
if (_ItemTransitions_ToID == null)
_ItemTransitions_ToID = ItemTransitions_ToID.New();
return _ItemTransitions_ToID;
}
}
public void Reset_ItemTransitions_ToID()
{
_ItemTransition_ToIDCount = -1;
}
public override bool IsDirty
{
get { return base.IsDirty || (_ItemAnnotations == null ? false : _ItemAnnotations.IsDirty) || (_ItemDocVersions == null ? false : _ItemDocVersions.IsDirty) || (_NextItems == null ? false : _NextItems.IsDirty) || (_ItemParts == null ? false : _ItemParts.IsDirty) || (_ItemTransitions_RangeID == null ? false : _ItemTransitions_RangeID.IsDirty) || (_ItemTransitions_ToID == null ? false : _ItemTransitions_ToID.IsDirty) || (_MyContent == null ? false : _MyContent.IsDirty); }