Class SQLWrapperResultsController
A standard controller that displays results of executing a ISQLWrapper against any entity in the system
Uses the SQLWrapperResultsViewParams for the parameters of the ISQLWrapper to execute
Inheritance
Implements
Inherited Members
Namespace: LemonEdge.Client.Core.Views.Controllers
Assembly: ClientCore.dll
Syntax
[ViewSerializedParam(typeof(SQLWrapperResultsViewParams))]
public class SQLWrapperResultsController : BaseGridAnyRelatedAnyCollectionController<ISQLWrapperResult>, IBaseGridController, IModelViewController, ICollectionExportable, INewGridItemImplementor<ISQLWrapperResult>, ICopyGridItemImplementor<ISQLWrapperResult>, IGrid, IDeleteGridItemImplementor<ISQLWrapperResult>
Constructors
SQLWrapperResultsController(IBaseGridAnyRelatedAnyCollection<ISQLWrapperResult>)
Creates a new SQLWrapperResultsController
Declaration
public SQLWrapperResultsController(IBaseGridAnyRelatedAnyCollection<ISQLWrapperResult> view)
Parameters
| Type | Name | Description |
|---|---|---|
| IBaseGridAnyRelatedAnyCollection<ISQLWrapperResult> | view | The IBaseGridRelatedCollection view implementation using the UI components of the client application |
Properties
AllowOpenCommand
Declaration
public override bool AllowOpenCommand { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Overrides
AutoSelectFirstRow
Declaration
protected override bool AutoSelectFirstRow { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Overrides
CollectionRelationshipColumnName
Indicates all ISQLWrapperResult are related through the SQLWrapperID property
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
DefaultColumnGroupIndexes
Returns the indexes of the columns that should be grouped by default which are marked as GridGroupBy in the ISQLWrapper definition
Declaration
public override IEnumerable<int> DefaultColumnGroupIndexes { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<System.Int32> |
Overrides
DefaultFrozenColumnCount
Returns the index of the column to show the pane freeze splitter which is marked as GridFreezeUpTo in the ISQLWrapper definition
If there are no columns marked as such then the default is returned of the first column
Declaration
public override int DefaultFrozenColumnCount { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Overrides
DefaultSearchColumn
Returns the column to be used when searching the grid by default, which is marked with GridIsDefaultSearch
Declaration
protected override string DefaultSearchColumn { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Overrides
ExcelExportCommand
Overrides the standard excel export command to use the ExportData command with the ISQLWrapper this controller is executing
Declaration
protected override ViewCommand ExcelExportCommand { get; }
Property Value
| Type | Description |
|---|---|
| ViewCommand |
Overrides
OnlyExportFromQuery
Returns True - Indicates the export functionality should only work from the query itself, and not from results that are displayed in the grid
Declaration
public override bool OnlyExportFromQuery { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Overrides
RowPreviewColumns
Returns the column(s) that should have their values appear as text in a preview tooltip when scrolling, which are marked as GridPartOfRowHeader in the ISQLWrapper definition
Declaration
public override IEnumerable<ControlDisplayInfo> RowPreviewColumns { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<ControlDisplayInfo> |
Overrides
SelectedItemForSubViews
Declaration
public override object SelectedItemForSubViews { get; }
Property Value
| Type | Description |
|---|---|
| System.Object |
Overrides
Methods
ColumnGroups()
Returns all the column groups setup in the ISQLWrapper by the columns marked with GridGroupHeader and GridSubGroupHeader values
Declaration
public override IEnumerable<GridColumnGroup> ColumnGroups()
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<GridColumnGroup> | All the column groups setup in the ISQLWrapper by the columns marked with GridGroupHeader and GridSubGroupHeader values |
Overrides
Columns()
Returns all the columns defined in the ISQLWrapper with their appropriate type, settings and visibility
Declaration
public override IEnumerable<ControlDisplayInfo> Columns()
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<ControlDisplayInfo> | All the columns defined in the ISQLWrapper with their appropriate type, settings and visibility |
Overrides
DisplayUI()
Loads the ISQLWrapper to execute, from the wrapper specified in the SQLWrapperResultsViewParams or from the SingleItem this view is displaying if it is a SQLWrapper or Dataset
Once loaded (or already loaded), the system displays parameters (if required or is not the first execution of the grid) then displays the results
Declaration
public override Task DisplayUI()
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task | A task indicating the completion of the operation |
Overrides
Execute()
Forces the query to be re-run (including prompting for parameters if required)
Declaration
public Task Execute()
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task | A task indicating the completion of the operation |
GetControlDisplayInfo(SQLWrapperInterpretor, ISQLTypeWrapper, Int16)
Returns a control display info for displaying the specified control (defined using a ISQLTypeWrapper) against a ISQLWrapperResult
Declaration
public static ControlDisplayInfo GetControlDisplayInfo(SQLWrapperInterpretor helper, ISQLTypeWrapper col, short index)
Parameters
| Type | Name | Description |
|---|---|---|
| SQLWrapperInterpretor | helper | The sql wrapper interprator this control is being defined for |
| ISQLTypeWrapper | col | The column defining the control |
| System.Int16 | index | The index to use for this control in the sequence of controls being created |
Returns
| Type | Description |
|---|---|
| ControlDisplayInfo | A control display info for displaying the specified control (defined using a ISQLTypeWrapper) against a ISQLWrapperResult |
GetControlDisplayInfo(Func<ISQLTypeWrapper, String>, Func<Int32, ISQLTypeWrapper>, ISQLTypeWrapper, Int16)
Returns a control display info for displaying the specified control (defined using a ISQLTypeWrapper) against a ISQLWrapperResult
Declaration
public static ControlDisplayInfo GetControlDisplayInfo(Func<ISQLTypeWrapper, string> getColumnBinding, Func<int, ISQLTypeWrapper> getColumnFromIndex, ISQLTypeWrapper col, short index)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Func<ISQLTypeWrapper, System.String> | getColumnBinding | The binding this control will bound to on the ISQLWrapperResult |
| System.Func<System.Int32, ISQLTypeWrapper> | getColumnFromIndex | Returns the column definition for the specified index |
| ISQLTypeWrapper | col | The column defining the control |
| System.Int16 | index | The index to use for this control in the sequence of controls being created |
Returns
| Type | Description |
|---|---|
| ControlDisplayInfo | A control display info for displaying the specified control (defined using a ISQLTypeWrapper) against a ISQLWrapperResult |
GetExportableColumnInfo(IEnumerable<ColumnDescriptor>)
Gets the columns that can be exported from this query including their visibility status
Declaration
public override Task<IEnumerable<ControlDisplayVisibilityInfo>> GetExportableColumnInfo(IEnumerable<ColumnDescriptor> visibleColumns)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<ColumnDescriptor> | visibleColumns | The current columns visible in the grid |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<ControlDisplayVisibilityInfo>> | The columns that can be exported from this query including their visibility status |
Overrides
GetGridSourceItems()
Prompts for parameters (if required or not the first execution), and executes the query with the correct filters/parameters, returning the results
Declaration
public override Task<IEnumerable<ISQLWrapperResult>> GetGridSourceItems()
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<ISQLWrapperResult>> | A list of all the results given the query execution |
Overrides
GetOpenGridCommand()
Overridse the default open behaviour with a custom open command that provides the ability to open all the different type of openable items in a single query result
Declaration
protected override ViewCommand GetOpenGridCommand()
Returns
| Type | Description |
|---|---|
| ViewCommand | A custom open command capable of opening more than one item from a query result row |
Overrides
GetQueryForExcelResults()
Returns the QueryableExecuter used to filter results from this custom ISQLWrapper query
Declaration
public override QueryableExecuter GetQueryForExcelResults()
Returns
| Type | Description |
|---|---|
| QueryableExecuter | The QueryableExecuter used to filter results from this custom ISQLWrapper query |
Overrides
InitAsync()
Initializes this controller by loading the View.Descriptor.Param as a SQLWrapperResultsViewParams
If the WrapperID is set then the system loads the definition using a SQLWrapperInterpretor
Declaration
public override Task InitAsync()
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task | A task indicating the completion of the operation |
Overrides
InitCommands(IList<ViewCommand>)
Adds a command called [Run] that prompts for parameter changes to the query and then re-runs to get all the new results
Declaration
protected override void InitCommands(IList<ViewCommand> commands)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IList<ViewCommand> | commands | The current commands for the controller |
Overrides
OnOpenRowItem(ISQLWrapperResult)
Automatically opens in a new layout the default openable item from this query
The openable items can be retrieved from OpenableColumns
Declaration
public override Task OnOpenRowItem(ISQLWrapperResult rowItem)
Parameters
| Type | Name | Description |
|---|---|---|
| ISQLWrapperResult | rowItem | The selected row to open an item from |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task | A task indicating the completion of the operation |
Overrides
Redisplay()
Forces the query to be re-run (including prompting for parameters if required)
Declaration
public override Task Redisplay()
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task | A task indicating the completion of the operation |