Class EntityVisibleForHelper
Helper class for working with visible for on enteties.
Inherited Members
Namespace: SuperOffice.CRM.Entities
Assembly: SoDataBase.dll
Syntax
public sealed class EntityVisibleForHelper : ITableRowLoadHandler, INestedPersist
Constructors
EntityVisibleForHelper(VisibleForTableInfo, EntityBase, TableRowBase)
Default constructor for the visible for helper.
Declaration
public EntityVisibleForHelper(VisibleForTableInfo visibleForTableInfo, EntityBase entity, TableRowBase mainRow)
Parameters
Type | Name | Description |
---|---|---|
VisibleForTableInfo | visibleForTableInfo | TableInfo for the visible for row. |
EntityBase | entity | Entity the visible for is part of |
TableRowBase | mainRow | The main row of the entity. |
Properties
AssociateFullName
Get the associate full name of the user the entity is visible for.
Declaration
public string AssociateFullName { get; }
Property Value
Type | Description |
---|---|
string |
AssociateId
Get or set the user the entity is visible for.
Declaration
public int AssociateId { get; set; }
Property Value
Type | Description |
---|---|
int |
Remarks
Setting this value will force the visibillity to be for the associate.
GroupId
Get or set group the entity is visible for.
Declaration
public int GroupId { get; set; }
Property Value
Type | Description |
---|---|
int |
Remarks
Setting the group id will for the visibillity to be for this group.
GroupName
Get the name of the group.
Declaration
public string GroupName { get; }
Property Value
Type | Description |
---|---|
string |
IsDeleted
Get if the visible for row is deleted.
Declaration
public bool IsDeleted { get; }
Property Value
Type | Description |
---|---|
bool |
IsMarkedForDelete
Get or set the IsMarkedForDelete flag on the visible for row.
Declaration
public bool IsMarkedForDelete { get; set; }
Property Value
Type | Description |
---|---|
bool |
Row
The actual visible for row that is being worked on.
Declaration
public VisibleForRow Row { get; }
Property Value
Type | Description |
---|---|
VisibleForRow |
Sentries
Get sentries governing the visible for row
Declaration
public SentryCollection Sentries { get; }
Property Value
Type | Description |
---|---|
SentryCollection |
VisibleFor
Get or set the type of visibility for the entity.
Declaration
public Visibility VisibleFor { get; set; }
Property Value
Type | Description |
---|---|
Visibility |
VisibleForId
Get the visible for id for used on the visible for row.
Declaration
public int VisibleForId { get; set; }
Property Value
Type | Description |
---|---|
int |
Remarks
If Visibility is All, 1 is allways returned. GroupId and AssociateId will be returned for corresponding values on the VisibleFor property.
VisibleForTableInfo
Get the TableInfo for the visible for row.
Declaration
public VisibleForTableInfo VisibleForTableInfo { get; }
Property Value
Type | Description |
---|---|
VisibleForTableInfo |
Methods
CopyVisibilityTo(VisibleForRow)
Copy visibility from the helper to a visible for row.
Declaration
public void CopyVisibilityTo(VisibleForRow visibleForRow)
Parameters
Type | Name | Description |
---|---|---|
VisibleForRow | visibleForRow | Visible for row to set visibility on. |
ModifyQuery(IdxBase)
Modify a query to join in visible for using inner join.
Declaration
public static VisibleForTableInfo ModifyQuery(IdxBase query)
Parameters
Type | Name | Description |
---|---|---|
IdxBase | query | Query to modify. |
Returns
Type | Description |
---|---|
VisibleForTableInfo | TableInfo for the visible for table used in the query. |
OnRowLoad(SoDataReader, TableRowBase)
Called by the entity when it is loaded from the database so the underlying VisibleForRow object can be fetched.
Declaration
public void OnRowLoad(SoDataReader reader, TableRowBase row)
Parameters
Type | Name | Description |
---|---|---|
SoDataReader | reader | Reader to read publish information from |
TableRowBase | row | The main row of the query. |
OnRowLoaded()
Called by the entity when it has been loaded successfully.
Declaration
public void OnRowLoaded()
SetVisibleForTypeOnRow(VisibleForRow, Visibility)
Set a visible for type on a visible for row.
Declaration
public static void SetVisibleForTypeOnRow(VisibleForRow visibleForRow, Visibility visibleForType)
Parameters
Type | Name | Description |
---|---|---|
VisibleForRow | visibleForRow | Row to set visible for on. |
Visibility | visibleForType | Type of visibility. |
SetVisibleForTypeOnRow(VisibleForRow, Visibility, int)
Set a visible for type on a visible for row.
Declaration
public static void SetVisibleForTypeOnRow(VisibleForRow visibleForRow, Visibility visibleForType, int id)
Parameters
Type | Name | Description |
---|---|---|
VisibleForRow | visibleForRow | Row to set visible for on. |
Visibility | visibleForType | Type of visibility. |
int | id | Value of group or associate if one of these are chosen. |