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

@@ -150,11 +150,17 @@ namespace VEPROMS.CSLA.Library
get
{
CanReadProperty("RoleAssignments",true);
if (_RoleAssignmentCount > 0 && _RoleAssignments == null)
if (_RoleAssignmentCount < 0 || (_RoleAssignmentCount > 0 && _RoleAssignments == null))
_RoleAssignments = AssignmentInfoList.GetByRID(_RID);
if (_RoleAssignmentCount < 0)
_RoleAssignmentCount = _RoleAssignments.Count;
return _RoleAssignments;
}
}
internal void RefreshRoleAssignments()
{
_RoleAssignmentCount = -1; // This will cause the data to be requeried
}
private int _RolePermissionCount = 0;
/// <summary>
/// Count of RolePermissions for this Role
@@ -176,11 +182,17 @@ namespace VEPROMS.CSLA.Library
get
{
CanReadProperty("RolePermissions",true);
if (_RolePermissionCount > 0 && _RolePermissions == null)
if (_RolePermissionCount < 0 || (_RolePermissionCount > 0 && _RolePermissions == null))
_RolePermissions = PermissionInfoList.GetByRID(_RID);
if (_RolePermissionCount < 0)
_RolePermissionCount = _RolePermissions.Count;
return _RolePermissions;
}
}
internal void RefreshRolePermissions()
{
_RolePermissionCount = -1; // This will cause the data to be requeried
}
// TODO: Replace base RoleInfo.ToString function as necessary
/// <summary>
/// Overrides Base ToString