Show / Hide Table of Contents

Class RowForeignKeyHelper

Inheritance
Object
NestedPersist
NestedPersistFacade
RowForeignKeyHelper
Implements
INestedPersist
Inherited Members
NestedPersistFacade.OnPrimaryKeyRequest(PKContainer)
NestedPersist._saveOwner
NestedPersist._isSaving
NestedPersist.SetSaveOwner(INestedPersist)
NestedPersist.Save()
NestedPersist.INestedPersist.OnPreIdUpdate()
NestedPersist.INestedPersist.OnPrimaryKeyRequest(PKContainer)
NestedPersist.INestedPersist.OnPrimaryKeyUpdate(PKContainer)
NestedPersist.INestedPersist.OnIdUpdate()
NestedPersist.INestedPersist.OnSave(BatchSave)
NestedPersist.INestedPersist.OnSaved(Boolean)
NestedPersist.IsSaving
NestedPersist.OnElementSaved
NestedPersist.OnElementIdUpdate
Object.ToString()
Object.Equals(Object)
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
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
NestedPersist.IsDeleted

IsDirty

Do we have any changes

Declaration
public override bool IsDirty { get; }
Property Value
Type Description
Boolean
Overrides
NestedPersistFacade.IsDirty

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
NestedPersist.IsMarkedForDelete

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
NestedPersistFacade.GetFacadingItems()

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.
This must be in the same order as returned by SplitValue(String).

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
SplitValue(String)

OnIdUpdate()

Declaration
protected override void OnIdUpdate()
Overrides
NestedPersistFacade.OnIdUpdate()

OnPreIdUpdate()

Declaration
protected override void OnPreIdUpdate()
Overrides
NestedPersistFacade.OnPreIdUpdate()

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
NestedPersistFacade.OnPrimaryKeyUpdate(PKContainer)

OnSave(BatchSave)

Declaration
protected override void OnSave(BatchSave batchSave)
Parameters
Type Name Description
BatchSave batchSave
Overrides
NestedPersistFacade.OnSave(BatchSave)

OnSaved(Boolean)

Declaration
protected override void OnSaved(bool bSucceeded)
Parameters
Type Name Description
Boolean bSucceeded
Overrides
NestedPersistFacade.OnSaved(Boolean)

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.

See Also
MergeValue(String[])

Implements

INestedPersist

Extension Methods

EnumUtil.MapEnums<From, To>(From)
Converters.MapEnums<From, To>(From)
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top