Class Transaction
A helper class used for translating values held against an ITransaction
This is because transactions and transaction allocated records store their values in different value fields depending on the configuration of the ITransactionCode
Inheritance
Inherited Members
Namespace: LemonEdge.API.Entities.Helpers
Assembly: API.dll
Syntax
public class Transaction
Fields
MAX_VALUES
Declaration
public static short MAX_VALUES
Field Value
Type | Description |
---|---|
System.Int16 |
Methods
GetFuncValue(ITransaction, Int16)
Returns the functional value for the specified transaction record given the specified sequence which corresponds to a Sequence
Declaration
public static decimal GetFuncValue(ITransaction transaction, short sequence)
Parameters
Type | Name | Description |
---|---|---|
ITransaction | transaction | The record to return the specified functional value from |
System.Int16 | sequence | The sequence indicating the value to be retrieved as defined by the Sequence against the transactions transaction code |
Returns
Type | Description |
---|---|
System.Decimal | The functional value for the specified transaction record given the specified sequence which corresponds to a Sequence |
GetLocalValue(ITransaction, Int16)
Returns the local value for the specified transaction record given the specified sequence which corresponds to a Sequence
Declaration
public static decimal GetLocalValue(ITransaction transaction, short sequence)
Parameters
Type | Name | Description |
---|---|---|
ITransaction | transaction | The record to return the specified local value from |
System.Int16 | sequence | The sequence indicating the value to be retrieved as defined by the Sequence against the transactions transaction code |
Returns
Type | Description |
---|---|
System.Decimal | The local value for the specified transaction record given the specified sequence which corresponds to a Sequence |
GetManualChange(ITransaction, Int16)
Returns if the specified value for the specified transaction record was manually modified or calculated automatically
Declaration
public static bool GetManualChange(ITransaction transaction, short sequence)
Parameters
Type | Name | Description |
---|---|---|
ITransaction | transaction | The record to see if the value was manually modified on |
System.Int16 | sequence | The sequence indicating if the value was manually updated as defined by the Sequence against the transactions transaction code |
Returns
Type | Description |
---|---|
System.Boolean | True if the value was manually updated, or false if it was done so automatically |
GetReportingValue(ITransaction, Int16)
Returns the reporting value for the specified transaction record given the specified sequence which corresponds to a Sequence
Declaration
public static decimal GetReportingValue(ITransaction transaction, short sequence)
Parameters
Type | Name | Description |
---|---|---|
ITransaction | transaction | The record to return the specified reporting value from |
System.Int16 | sequence | The sequence indicating the value to be retrieved as defined by the Sequence against the transactions transaction code |
Returns
Type | Description |
---|---|
System.Decimal | The reporting value for the specified transaction record given the specified sequence which corresponds to a Sequence |
GetSequence(ITransaction, Int16)
Returns the sequence of the value that is stored against the specified transaction for the specified ValueIndex
Declaration
public static short? GetSequence(ITransaction transaction, short valueIndex)
Parameters
Type | Name | Description |
---|---|---|
ITransaction | transaction | The record to return the sequence of value field that holds the specified type |
System.Int16 | valueIndex | The id of the type of value that is stored against the transaction |
Returns
Type | Description |
---|---|
System.Nullable<System.Int16> | The sequence of the value that is stored against the specified transaction for the specified ValueIndex. Returns null if it is not being stored. |
GetValueIndex(ITransaction, Int16)
Returns the ValueIndex for the type stored against the specified sequence as defined from Sequence
Declaration
public static short GetValueIndex(ITransaction transaction, short sequence)
Parameters
Type | Name | Description |
---|---|---|
ITransaction | transaction | The record to return the value index of for the specified sequence |
System.Int16 | sequence | The sequence indicating the value index to be returned by the Sequence against the transactions transaction code |
Returns
Type | Description |
---|---|
System.Int16 | The ValueIndex for the type stored against the specified sequence as defined from Sequence |
HasManualChange(ITransaction)
Returns true if any of the values have been manually updated by the user rather than all having been automatically calculated
Declaration
public static bool HasManualChange(ITransaction transaction)
Parameters
Type | Name | Description |
---|---|---|
ITransaction | transaction |
Returns
Type | Description |
---|---|
System.Boolean | True if any of the values have been manually updated by the user rather than all having been automatically calculated |
SetFuncValue(ITransaction, Int16, Decimal)
Sets the functional value for the specified transaction record given the specified sequence which corresponds to a Sequence
Declaration
public static void SetFuncValue(ITransaction transaction, short sequence, decimal value)
Parameters
Type | Name | Description |
---|---|---|
ITransaction | transaction | The record to modify the specified functional value of |
System.Int16 | sequence | The sequence indicating the value to be updated as defined by the Sequence against the transactions transaction code |
System.Decimal | value | The value to update the functional value against the transaction record with |
SetLocalValue(ITransaction, Int16, Decimal)
Sets the local value for the specified transaction record given the specified sequence which corresponds to a Sequence
Declaration
public static void SetLocalValue(ITransaction transaction, short sequence, decimal value)
Parameters
Type | Name | Description |
---|---|---|
ITransaction | transaction | The record to modify the specified local value of |
System.Int16 | sequence | The sequence indicating the value to be updated as defined by the Sequence against the transactions transaction code |
System.Decimal | value | The value to update the local value against the transaction record with |
SetManualChange(ITransaction, Int16, Boolean)
Sets if the specified value for the specified transaction record was manually modified or calculated automatically
Declaration
public static void SetManualChange(ITransaction transaction, short sequence, bool value)
Parameters
Type | Name | Description |
---|---|---|
ITransaction | transaction | The record to update if the value was manually modified on |
System.Int16 | sequence | The sequence to indicate if the value was manually updated as defined by the Sequence against the transactions transaction code |
System.Boolean | value |
SetReportingValue(ITransaction, Int16, Decimal)
Sets the reporting value for the specified transaction record given the specified sequence which corresponds to a Sequence
Declaration
public static void SetReportingValue(ITransaction transaction, short sequence, decimal value)
Parameters
Type | Name | Description |
---|---|---|
ITransaction | transaction | The record to modify the specified reporting value of |
System.Int16 | sequence | The sequence indicating the value to be updated as defined by the Sequence against the transactions transaction code |
System.Decimal | value | The value to update the reporting value against the transaction record with |
SetValueIndex(ITransaction, Int16, Int16)
Sets the ValueIndex of the type being stored against the specified Sequence
Declaration
public static void SetValueIndex(ITransaction transaction, short sequence, short index)
Parameters
Type | Name | Description |
---|---|---|
ITransaction | transaction | The record to update the value index of for the specified sequence |
System.Int16 | sequence | The sequence indicating the value index to be updated by the Sequence against the transactions transaction code |
System.Int16 | index | The new ValueIndex |