Update related lists when related value changes.

This commit is contained in:
Rich
2008-05-01 11:01:21 +00:00
parent 26de18fb28
commit 1973b9646c
20 changed files with 561 additions and 87 deletions

View File

@@ -195,11 +195,17 @@ namespace VEPROMS.CSLA.Library
get
{
CanReadProperty("ContentDetails",true);
if (_ContentDetailCount > 0 && _ContentDetails == null)
if (_ContentDetailCount < 0 || (_ContentDetailCount > 0 && _ContentDetails == null))
_ContentDetails = DetailInfoList.GetByContentID(_ContentID);
if (_ContentDetailCount < 0)
_ContentDetailCount = _ContentDetails.Count;
return _ContentDetails;
}
}
internal void RefreshContentDetails()
{
_ContentDetailCount = -1; // This will cause the data to be requeried
}
private int _ContentEntryCount = 0;
/// <summary>
/// Count of ContentEntries for this Content
@@ -247,11 +253,17 @@ namespace VEPROMS.CSLA.Library
get
{
CanReadProperty("ContentItems",true);
if (_ContentItemCount > 0 && _ContentItems == null)
if (_ContentItemCount < 0 || (_ContentItemCount > 0 && _ContentItems == null))
_ContentItems = ItemInfoList.GetByContentID(_ContentID);
if (_ContentItemCount < 0)
_ContentItemCount = _ContentItems.Count;
return _ContentItems;
}
}
internal void RefreshContentItems()
{
_ContentItemCount = -1; // This will cause the data to be requeried
}
private int _ContentPartCount = 0;
/// <summary>
/// Count of ContentParts for this Content
@@ -273,11 +285,17 @@ namespace VEPROMS.CSLA.Library
get
{
CanReadProperty("ContentParts",true);
if (_ContentPartCount > 0 && _ContentParts == null)
if (_ContentPartCount < 0 || (_ContentPartCount > 0 && _ContentParts == null))
_ContentParts = PartInfoList.GetByContentID(_ContentID);
if (_ContentPartCount < 0)
_ContentPartCount = _ContentParts.Count;
return _ContentParts;
}
}
internal void RefreshContentParts()
{
_ContentPartCount = -1; // This will cause the data to be requeried
}
private int _ContentRoUsageCount = 0;
/// <summary>
/// Count of ContentRoUsages for this Content
@@ -299,11 +317,17 @@ namespace VEPROMS.CSLA.Library
get
{
CanReadProperty("ContentRoUsages",true);
if (_ContentRoUsageCount > 0 && _ContentRoUsages == null)
if (_ContentRoUsageCount < 0 || (_ContentRoUsageCount > 0 && _ContentRoUsages == null))
_ContentRoUsages = RoUsageInfoList.GetByContentID(_ContentID);
if (_ContentRoUsageCount < 0)
_ContentRoUsageCount = _ContentRoUsages.Count;
return _ContentRoUsages;
}
}
internal void RefreshContentRoUsages()
{
_ContentRoUsageCount = -1; // This will cause the data to be requeried
}
private int _ContentTransitionCount = 0;
/// <summary>
/// Count of ContentTransitions for this Content
@@ -325,11 +349,17 @@ namespace VEPROMS.CSLA.Library
get
{
CanReadProperty("ContentTransitions",true);
if (_ContentTransitionCount > 0 && _ContentTransitions == null)
if (_ContentTransitionCount < 0 || (_ContentTransitionCount > 0 && _ContentTransitions == null))
_ContentTransitions = TransitionInfoList.GetByFromID(_ContentID);
if (_ContentTransitionCount < 0)
_ContentTransitionCount = _ContentTransitions.Count;
return _ContentTransitions;
}
}
internal void RefreshContentTransitions()
{
_ContentTransitionCount = -1; // This will cause the data to be requeried
}
private int _ContentZContentCount = 0;
/// <summary>
/// Count of ContentZContents for this Content
@@ -400,14 +430,20 @@ namespace VEPROMS.CSLA.Library
_Number = tmp.Number;
_Text = tmp.Text;
_Type = tmp.Type;
_FormatID = tmp.FormatID;
if (_FormatID != tmp.FormatID)
{
MyFormat.RefreshFormatContents(); // Update List for old value
_FormatID = tmp.FormatID; // Update the value
_MyFormat = null; // Reset list so that the next line gets a new list
MyFormat.RefreshFormatContents(); // Update List for new value
}
_Config = tmp.Config;
_DTS = tmp.DTS;
_UserID = tmp.UserID;
_ContentInfoExtension.Refresh(this);
_MyFormat = null;
_MyEntry = null;
_MyZContent = null;
_MyEntry = null;//
_MyZContent = null;//
OnChange();// raise an event
}
public static void Refresh(FormatContent tmp)
@@ -426,8 +462,8 @@ namespace VEPROMS.CSLA.Library
_UserID = tmp.UserID;
_ContentInfoExtension.Refresh(this);
_MyFormat = null;
_MyEntry = null;
_MyZContent = null;
_MyEntry = null;//
_MyZContent = null;//
OnChange();// raise an event
}
public static ContentInfo Get(int contentID)