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.Controllers
Assembly: LemonEdge.ClientCore.dll
Syntax
public abstract class SingleItemWithChildTransactionsController<T> : BaseGridRelatedCollectionController<T, ITransaction>, IBaseGridController, ICollectionExportable, INewGridItemImplementor<ITransaction>, ICopyGridItemImplementor<ITransaction>, IGrid, IDeleteGridItemImplementor<ITransaction>, ISearchController, 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
Indicates that by default selected entities can be copied by the user with the copy command
Declaration
public override bool AllowCopyCommand { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
AllowOpenCommand
Indicates that by default selected entities can be opened by the user with the open command
Declaration
public override bool AllowOpenCommand { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
AllowSequencing
Indicates the command to allow selected rows to be moved up/down by the user is included in the InitCommands(IList<ViewCommand>)
The default is true if one of the properties against the type ITransaction is defined as having SequenceStart
Declaration
public override bool AllowSequencing { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
AllowXMLImportExport
Indicates the command to allow the xml export of the data by the user is included in the InitCommands(IList<ViewCommand>)
The default is true if the type ITransaction derives from ISetCopier
Declaration
public override bool AllowXMLImportExport { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
AutoOpenNewItemInTab
Indicates when creating a new item in the grid that it should automatically be opened in a new tab as well
The default is true if the type ITransaction is an entity that is not a IsStandingDataEntity
Declaration
public override bool AutoOpenNewItemInTab { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
AutoSelectFirstRow
True - Always select the first transaction
Declaration
protected override bool AutoSelectFirstRow { get; }
Property Value
Type | Description |
---|---|
bool |
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 |
---|---|
bool |
Overrides
CollectionRelationshipColumnName
This is the property on the ITransaction entities that holds a relationship value that points to the SingleItem type
This controller will automatically use that to filter the correct entities for the grid in AlterQuery(QueryableExecuter<TCollection>)
Declaration
public override string CollectionRelationshipColumnName { get; }
Property Value
Type | Description |
---|---|
string |
Overrides
ContextHelpURL
An optional associated url of a help file for the view this controller works with
Declaration
public override string ContextHelpURL { get; }
Property Value
Type | Description |
---|---|
string |
Overrides
DefaultSearchColumn
The name of the column to use in the default search of text in the grid
Declaration
protected override string DefaultSearchColumn { get; }
Property Value
Type | Description |
---|---|
string |
Overrides
LockableHandler
LockableHandler implementation returning the ITransactionProcessor
Declaration
public ILockable LockableHandler { get; }
Property Value
Type | Description |
---|---|
ILockable |
UpdateSubViewsWhenMultipleRowSelectionChanges
Normally sub views are updated when the selection changes. If multiple rows are selected the single item passed to sub views can be the same in which case by default they will not be refreshed. Setting this to true will mean sub views are always refreshed when multiple rows are selected
Declaration
protected override bool UpdateSubViewsWhenMultipleRowSelectionChanges { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
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)
Indicates a transaction can be deleted if it is not API.Core.TransactionStatus.Finalized or API.Core.TransactionStatus.Cancelled
Declaration
public override Task<bool> CanDelete(ITransaction item)
Parameters
Type | Name | Description |
---|---|---|
ITransaction | item | The transaction item to see if it can be deleted |
Returns
Type | Description |
---|---|
Task<bool> | True if a transaction can be deleted and is not API.Core.TransactionStatus.Finalized or API.Core.TransactionStatus.Cancelled |
Overrides
CanEditRowItem(ITransaction)
Indicates if the user is permitted to edit the specified row item from the state of the item itself
Declaration
public override bool CanEditRowItem(ITransaction item)
Parameters
Type | Name | Description |
---|---|---|
ITransaction | item | The item to check if the user is permitted to edit |
Returns
Type | Description |
---|---|
bool | True if the user is permitted to edit the specified row item from the state of the item itself |
Overrides
CanEditRowItem(ITransaction, short)
Indicates if the user is permitted to edit the specified column for the specified row item
Declaration
public override bool CanEditRowItem(ITransaction item, short columnDefinitionIndex)
Parameters
Type | Name | Description |
---|---|---|
ITransaction | item | The item to check if the user is permitted to edit |
short | columnDefinitionIndex |
Returns
Type | Description |
---|---|
bool | True if the user is permitted to edit the specified row item from the state of the item itself |
Overrides
Clear()
Clears the paging information for the loaded grid items
Declaration
public override Task Clear()
Returns
Type | Description |
---|---|
Task | A task indicating the completion of the operation |
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 |
---|---|
IEnumerable<ControlDisplayInfoLight> | The columns to be dislayed against this grid |
Overrides
DeleteCommandIsQuickAccess()
Declaration
public override bool DeleteCommandIsQuickAccess()
Returns
Type | Description |
---|---|
bool |
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 |
---|---|
Task | A task indicating the completion of the operation |
Overrides
GetDownCommand()
Returns the command for moving an item down in the grid
Declaration
protected override ViewCommand GetDownCommand()
Returns
Type | Description |
---|---|
ViewCommand | The command for moving an item down in the grid |
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 |
---|---|
Task<IEnumerable<ITransaction>> | All the header transactions that have this SingleItem as their parent |
Overrides
GetGridSourceItems(IEnumerable<ITransaction>, QueryableExecuterApplyType)
Returns the currentItems
with the AlterQuery(QueryableExecuter<T>) filtering
applied to the results
Declaration
public override IEnumerable<ITransaction> GetGridSourceItems(IEnumerable<ITransaction> currentItems, QueryableExecuterApplyType typeToApply = QueryableExecuterApplyType.All)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<ITransaction> | currentItems | The current items to be displayed in the grid |
QueryableExecuterApplyType | typeToApply |
Returns
Type | Description |
---|---|
IEnumerable<ITransaction> | The |
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 |
---|---|
(TransactionStatus Status, DateTimeOffset TransactionDate) | A status and date to use for the new transaction |
GetUpCommand()
Returns the command for moving an item up in the grid
Declaration
protected override ViewCommand GetUpCommand()
Returns
Type | Description |
---|---|
ViewCommand | The command for moving an item up in the grid |
Overrides
InitAsync()
Provides the controller a chance to initialize any dependant data. Called once by the system after controller creation.
Declaration
public override Task InitAsync()
Returns
Type | Description |
---|---|
Task | A task indicating the completion of the operation |
Overrides
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 |
---|---|---|
IList<ViewCommand> | commands | The commands for this transaction grid |
Overrides
MoveItemSequence(object, object)
Declaration
public override void MoveItemSequence(object fromItem, object toItem)
Parameters
Type | Name | Description |
---|---|---|
object | fromItem | |
object | toItem |
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 |
---|---|---|
IEnumerable<ITransaction> | items | The transactions to be removed |
Returns
Type | Description |
---|---|
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)
Updates any new item created in this grid to also have the CollectionRelationshipColumnName property hold the value of the SingleItem ID
Declaration
protected override Task UpdateNewItem(ITransaction item)
Parameters
Type | Name | Description |
---|---|---|
ITransaction | item | The new item created for this grid |
Returns
Type | Description |
---|---|
Task | A task indicating the completion of the operation |