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

@@ -250,13 +250,19 @@ namespace VEPROMS.CSLA.Library
get
{
CanReadProperty("RoleAssignments", true);
if (_RoleAssignmentCount > 0 && _RoleAssignments == null)
if (_RoleAssignmentCount < 0 || (_RoleAssignmentCount > 0 && _RoleAssignments == null))
_RoleAssignments = RoleAssignments.GetByRID(RID);
else if (_RoleAssignments == null)
if (_RoleAssignmentCount < 0 )
_RoleAssignmentCount = _RoleAssignments == null ? 0 : _RoleAssignments.Count;
if (_RoleAssignments == null)
_RoleAssignments = RoleAssignments.New();
return _RoleAssignments;
}
}
public void Reset_RoleAssignments()
{
_RoleAssignmentCount = -1;
}
private int _RolePermissionCount = 0;
/// <summary>
/// Count of RolePermissions for this Role
@@ -281,13 +287,19 @@ namespace VEPROMS.CSLA.Library
get
{
CanReadProperty("RolePermissions", true);
if (_RolePermissionCount > 0 && _RolePermissions == null)
if (_RolePermissionCount < 0 || (_RolePermissionCount > 0 && _RolePermissions == null))
_RolePermissions = RolePermissions.GetByRID(RID);
else if (_RolePermissions == null)
if (_RolePermissionCount < 0 )
_RolePermissionCount = _RolePermissions == null ? 0 : _RolePermissions.Count;
if (_RolePermissions == null)
_RolePermissions = RolePermissions.New();
return _RolePermissions;
}
}
public void Reset_RolePermissions()
{
_RolePermissionCount = -1;
}
public override bool IsDirty
{
get { return base.IsDirty || (_RoleAssignments == null ? false : _RoleAssignments.IsDirty) || (_RolePermissions == null ? false : _RolePermissions.IsDirty); }