Class SingleItemWithChildTransactionsController<T>
A standard base view that displays all the header transactions that have their ParentItemID set to the instance of this single item type T
Inheritance
Implements
Inherited Members
Namespace: LemonEdge.Client.Core.Views
Assembly: ClientCore.dll
Syntax
public abstract class SingleItemWithChildTransactionsController<T> : BaseGridRelatedCollectionController<T, ITransaction>, IBaseGridController, ICollectionExportable, INewGridItemImplementor<ITransaction>, ICopyGridItemImplementor<ITransaction>, IGrid, IDeleteGridItemImplementor<ITransaction>, ILockableController, IModelViewController where T : IBaseEntity
Type Parameters
Name | Description |
---|---|
T | The type of entity that is the parent of a set of child transactions |
Constructors
SingleItemWithChildTransactionsController(IBaseGridRelatedCollection<T, ITransaction>)
Creates a new SingleItemWithChildTransactionsController
Declaration
public SingleItemWithChildTransactionsController(IBaseGridRelatedCollection<T, ITransaction> view)
Parameters
Type | Name | Description |
---|---|---|
IBaseGridRelatedCollection<T, ITransaction> | view | The IBaseGridRelatedCollection view implementation using the UI components of the client application |
Properties
AllowCopyCommand
Declaration
public override bool AllowCopyCommand { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Overrides
AllowOpenCommand
Declaration
public override bool AllowOpenCommand { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Overrides
AllowXMLImportExport
Declaration
public override bool AllowXMLImportExport { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Overrides
AutoOpenNewItemInTab
Declaration
public override bool AutoOpenNewItemInTab { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Overrides
AutoSelectFirstRow
True - Always select the first transaction
Declaration
protected override bool AutoSelectFirstRow { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Overrides
CanWrite
Uses the ITransactionProcessor CanWrite and Locked to determine if a transaction can be written too
Declaration
public override bool CanWrite { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Overrides
CollectionRelationshipColumnName
Declaration
public override string CollectionRelationshipColumnName { get; }
Property Value
Type | Description |
---|---|
System.String |
Overrides
ContextHelpURL
Declaration
public override string ContextHelpURL { get; }
Property Value
Type | Description |
---|---|
System.String |
Overrides
DefaultSearchColumn
Declaration
protected override string DefaultSearchColumn { get; }
Property Value
Type | Description |
---|---|
System.String |
Overrides
LockableHandler
LockableHandler implementation returning the ITransactionProcessor
Declaration
public ILockable LockableHandler { get; }
Property Value
Type | Description |
---|---|
ILockable |
Methods
AlterColumnInfo(ControlDisplayInfo)
Ensures all the columns have the correct filters depending on the instrument, entity and path selected for the transaction
Declaration
protected override void AlterColumnInfo(ControlDisplayInfo info)
Parameters
Type | Name | Description |
---|---|---|
ControlDisplayInfo | info | The column to alter |
Overrides
AlterQuery(QueryableExecuter<ITransaction>)
Ensures the query is filtered to only the header transactions that have this SingleItem as their parent
This is not used by the controller, but can be used by the inheriting implementation. This controller overrides the GetGridSourceItems() to use the processor loaded transactions instead
Declaration
protected override QueryableExecuter<ITransaction> AlterQuery(QueryableExecuter<ITransaction> query)
Parameters
Type | Name | Description |
---|---|---|
QueryableExecuter<ITransaction> | query | The query to modify to only return the transactions in for this parent item |
Returns
Type | Description |
---|---|
QueryableExecuter<ITransaction> | The query to return only transactions that have this SingleItem as their parent |
Overrides
CanDelete(ITransaction)
Declaration
public override bool CanDelete(ITransaction item)
Parameters
Type | Name | Description |
---|---|---|
ITransaction | item | The transaction item to see if it can be deleted |
Returns
Type | Description |
---|---|
System.Boolean | True if a transaction can be deleted and is not Finalized or Cancelled |
Overrides
ColumnNames()
Adds the header information for a transaction along with net total func, local and reporting amounts as columns
Declaration
protected override IEnumerable<ControlDisplayInfoLight> ColumnNames()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<ControlDisplayInfoLight> | The columns to be dislayed against this grid |
Overrides
DisplayUI()
Loads all the related transactions through the ITransactionProcessor for this SingleItem and populates the grid with all the loaded transactions
GetGridSourceItems() is overridden to return the processor transactions instead of loading the transactions from the query
Declaration
public override Task DisplayUI()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A task indicating the completion of the operation |
Overrides
GetGridSourceItems()
Instead of using the query (base implementation) we return all the HeaderTransactions loaded by the processor
Declaration
public override Task<IEnumerable<ITransaction>> GetGridSourceItems()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<ITransaction>> | All the header transactions that have this SingleItem as their parent |
Overrides
GetNewItemTranInfo(ITransaction)
When creating a new transaction this provides the default status/transaction date for the transaction that should come from the SingleItem
Declaration
protected abstract (TransactionStatus Status, DateTimeOffset TransactionDate) GetNewItemTranInfo(ITransaction item)
Parameters
Type | Name | Description |
---|---|---|
ITransaction | item | The new transaction being created |
Returns
Type | Description |
---|---|
System.ValueTuple<TransactionStatus, System.DateTimeOffset> | A status and date to use for the new transaction |
InitCommands(IList<ViewCommand>)
Adds the ViewAllocation and TransactionSettingsEdit commands to the standard grid commands
Declaration
protected override void InitCommands(IList<ViewCommand> commands)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IList<ViewCommand> | commands | The commands for this transaction grid |
Overrides
RemoveItems(IEnumerable<ITransaction>)
Removes the specified items from the ITransactionProcessor as well as the base implementation from the grid itself
Declaration
public override Task RemoveItems(IEnumerable<ITransaction> items)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<ITransaction> | items | The transactions to be removed |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A task indicating the completion of the operation |
Overrides
UpdateLocked()
UpdateLocked() implementation which enumerates each column in the grid and updates their status
Declaration
public void UpdateLocked()
UpdateNewItem(ITransaction)
Declaration
protected override Task UpdateNewItem(ITransaction item)
Parameters
Type | Name | Description |
---|---|---|
ITransaction | item |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |