Class RowForeignKeyHelper
Implements
Inherited Members
Namespace: SuperOffice.CRM.Rows.Util
Assembly: SoDataBase.dll
Syntax
public class RowForeignKeyHelper : NestedPersistFacade, INestedPersist
Constructors
RowForeignKeyHelper(TableRowBase)
Constructor
Declaration
public RowForeignKeyHelper(TableRowBase sourceEntityRow)
Parameters
Type | Name | Description |
---|---|---|
TableRowBase | sourceEntityRow | Table to reflect foreignkeys from |
Properties
IsDeleted
This object do not support full delete. ForeignKeys need to be deleted individually
Declaration
public override bool IsDeleted { get; }
Property Value
Type | Description |
---|---|
Boolean |
Overrides
IsDirty
Do we have any changes
Declaration
public override bool IsDirty { get; }
Property Value
Type | Description |
---|---|
Boolean |
Overrides
IsMarkedForDelete
This object do not support full delete. ForeignKeys need to be deleted individually
Declaration
public override bool IsMarkedForDelete { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Overrides
Methods
Get(Int32, String)
Get the value of a foreign key
Declaration
public string Get(int deviceId, string foreignKey)
Parameters
Type | Name | Description |
---|---|---|
Int32 | deviceId | Owner device identifier |
String | foreignKey | Name of foreign key |
Returns
Type | Description |
---|---|
String |
GetAll()
Get all associated foreign keys
Declaration
public IEnumerable<ForeignKeyRow> GetAll()
Returns
Type | Description |
---|---|
IEnumerable<ForeignKeyRow> |
GetAllKeys(Int32)
Get all associated keys for one device
Declaration
public string[] GetAllKeys(int deviceId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | deviceId |
Returns
Type | Description |
---|---|
String[] | A string array containing the keys |
GetFacadingItems()
Declaration
protected override IEnumerable<INestedPersist> GetFacadingItems()
Returns
Type | Description |
---|---|
IEnumerable<INestedPersist> |
Overrides
GetForeignAppRow(String)
Get a foreign app row from the database. If the row is not found, one is created
Declaration
public static ForeignAppRow GetForeignAppRow(string appName)
Parameters
Type | Name | Description |
---|---|---|
String | appName |
Returns
Type | Description |
---|---|
ForeignAppRow |
GetForeignDeviceRow(Int32, String, String)
Get a foreign device row from the database. If the row is not found, one is created
Declaration
public static ForeignDeviceRow GetForeignDeviceRow(int foreignAppId, string deviceName, string deviceId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | foreignAppId | Id of "parent" foreign app row |
String | deviceName | Name of device |
String | deviceId | Device id |
Returns
Type | Description |
---|---|
ForeignDeviceRow |
MergeValue(String[])
Take a string splitted with SplitValue(String) and merge it back to a long string.
Declaration
public static string MergeValue(params string[] valueParts)
Parameters
Type | Name | Description |
---|---|---|
String[] | valueParts | Fragments to be joined into one part. |
Returns
Type | Description |
---|---|
String | Long string merged back from its' individual parts. |
Remarks
The current implementation does not address trailing white space, but future implementations will.
See Also
OnIdUpdate()
Declaration
protected override void OnIdUpdate()
Overrides
OnPreIdUpdate()
Declaration
protected override void OnPreIdUpdate()
Overrides
OnPrimaryKeyUpdate(PKContainer)
Update primary key.
Declaration
protected override void OnPrimaryKeyUpdate(PKContainer pkContainer)
Parameters
Type | Name | Description |
---|---|---|
PKContainer | pkContainer | Collection of objects getting a primary key. |
Overrides
OnSave(BatchSave)
Declaration
protected override void OnSave(BatchSave batchSave)
Parameters
Type | Name | Description |
---|---|---|
BatchSave | batchSave |
Overrides
OnSaved(Boolean)
Declaration
protected override void OnSaved(bool bSucceeded)
Parameters
Type | Name | Description |
---|---|---|
Boolean | bSucceeded |
Overrides
Remove(Int32, String)
Remove a foreign key
Declaration
public void Remove(int deviceId, string foreignKey)
Parameters
Type | Name | Description |
---|---|---|
Int32 | deviceId | |
String | foreignKey |
Set(Int32, String, String)
Add/edit a foreignkey
Declaration
public void Set(int deviceId, string foreignKey, string foreignValue)
Parameters
Type | Name | Description |
---|---|---|
Int32 | deviceId | |
String | foreignKey | |
String | foreignValue |
SplitValue(String)
The filed in the database storing the foreign key values are limited, hence; long values needs to be splits in parts. Due to database issues with trailing white spaces, some additional logic needs to be performed.
Declaration
public static string[] SplitValue(string value)
Parameters
Type | Name | Description |
---|---|---|
String | value | Value in foreign key to be split into separate parts that fits into the database. |
Returns
Type | Description |
---|---|
String[] | Value split into parts that fit into the database. |
Remarks
The current implementation does not address trailing white space, but future implementations will.