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

@@ -344,13 +344,19 @@ namespace VEPROMS.CSLA.Library
get
{
CanReadProperty("FormatContents", true);
if (_FormatContentCount > 0 && _FormatContents == null)
if (_FormatContentCount < 0 || (_FormatContentCount > 0 && _FormatContents == null))
_FormatContents = FormatContents.GetByFormatID(FormatID);
else if (_FormatContents == null)
if (_FormatContentCount < 0 )
_FormatContentCount = _FormatContents == null ? 0 : _FormatContents.Count;
if (_FormatContents == null)
_FormatContents = FormatContents.New();
return _FormatContents;
}
}
public void Reset_FormatContents()
{
_FormatContentCount = -1;
}
private int _FormatDocVersionCount = 0;
/// <summary>
/// Count of FormatDocVersions for this Format
@@ -375,13 +381,19 @@ namespace VEPROMS.CSLA.Library
get
{
CanReadProperty("FormatDocVersions", true);
if (_FormatDocVersionCount > 0 && _FormatDocVersions == null)
if (_FormatDocVersionCount < 0 || (_FormatDocVersionCount > 0 && _FormatDocVersions == null))
_FormatDocVersions = FormatDocVersions.GetByFormatID(FormatID);
else if (_FormatDocVersions == null)
if (_FormatDocVersionCount < 0 )
_FormatDocVersionCount = _FormatDocVersions == null ? 0 : _FormatDocVersions.Count;
if (_FormatDocVersions == null)
_FormatDocVersions = FormatDocVersions.New();
return _FormatDocVersions;
}
}
public void Reset_FormatDocVersions()
{
_FormatDocVersionCount = -1;
}
private int _FormatFolderCount = 0;
/// <summary>
/// Count of FormatFolders for this Format
@@ -406,13 +418,19 @@ namespace VEPROMS.CSLA.Library
get
{
CanReadProperty("FormatFolders", true);
if (_FormatFolderCount > 0 && _FormatFolders == null)
if (_FormatFolderCount < 0 || (_FormatFolderCount > 0 && _FormatFolders == null))
_FormatFolders = FormatFolders.GetByFormatID(FormatID);
else if (_FormatFolders == null)
if (_FormatFolderCount < 0 )
_FormatFolderCount = _FormatFolders == null ? 0 : _FormatFolders.Count;
if (_FormatFolders == null)
_FormatFolders = FormatFolders.New();
return _FormatFolders;
}
}
public void Reset_FormatFolders()
{
_FormatFolderCount = -1;
}
private int _ChildFormatCount = 0;
/// <summary>
/// Count of ChildFormats for this Format
@@ -437,13 +455,19 @@ namespace VEPROMS.CSLA.Library
get
{
CanReadProperty("ChildFormats", true);
if (_ChildFormatCount > 0 && _ChildFormats == null)
if (_ChildFormatCount < 0 || (_ChildFormatCount > 0 && _ChildFormats == null))
_ChildFormats = ChildFormats.GetByParentID(FormatID);
else if (_ChildFormats == null)
if (_ChildFormatCount < 0 )
_ChildFormatCount = _ChildFormats == null ? 0 : _ChildFormats.Count;
if (_ChildFormats == null)
_ChildFormats = ChildFormats.New();
return _ChildFormats;
}
}
public void Reset_ChildFormats()
{
_ChildFormatCount = -1;
}
public override bool IsDirty
{
get { return base.IsDirty || (_FormatContents == null ? false : _FormatContents.IsDirty) || (_FormatDocVersions == null ? false : _FormatDocVersions.IsDirty) || (_FormatFolders == null ? false : _FormatFolders.IsDirty) || (_ChildFormats == null ? false : _ChildFormats.IsDirty); }