Class ExportData
A controller for displaying the ExportCSVParameter parameters to the user for choosing the data they would like to export
Inheritance
Implements
Inherited Members
Namespace: LemonEdge.Client.Core.Tasks.Params
Assembly: LemonEdge.ClientCore.dll
Syntax
public class ExportData : ParamSingleViewerController<ExportCSVParameter>, IPopupWindowController<ExportCSVParameter>, IParamViewerController, IPopupWindowController, IController
Constructors
ExportData(IParamSingleViewer<ExportCSVParameter>, ExportCSVParameter)
Creates a new export data parameter controller
Declaration
public ExportData(IParamSingleViewer<ExportCSVParameter> window, ExportCSVParameter param)
Parameters
Type | Name | Description |
---|---|---|
IParamSingleViewer<ExportCSVParameter> | window | The parameter popup window for displaying these parameters |
ExportCSVParameter | param | The initial parameters to display |
Methods
AlterControlInfo(ControlDisplayInfo)
Used to alter the sql wrapper control to hold a selection of all sql wrappers, and the entity control to have a selection of all entities
Declaration
protected override void AlterControlInfo(ControlDisplayInfo info)
Parameters
Type | Name | Description |
---|---|---|
ControlDisplayInfo | info | The description for a control being displayed by this parameter view |
Overrides
ControlNames()
The controls to display for the parameter are a ISQLWrapper selection and an entity type selection, indicating the data to export comes from an underlying sql wrapper or raw entity record data
Declaration
protected override IEnumerable<ControlDisplayInfoLight> ControlNames()
Returns
Type | Description |
---|---|
IEnumerable<ControlDisplayInfoLight> | A ISQLWrapper selection and an entity type selection control |
Overrides
GetExportableColumnInfo(SQLWrapperInterpretor, IEnumerable<ColumnDescriptor>)
Returns a list of columns that can be exported from the specified sql wrapper taking into account the currently
visibleColumns
in the grid displaying sql wrapper results
Declaration
public static IEnumerable<ControlDisplayVisibilityInfo> GetExportableColumnInfo(SQLWrapperInterpretor helper, IEnumerable<ColumnDescriptor> visibleColumns)
Parameters
Type | Name | Description |
---|---|---|
SQLWrapperInterpretor | helper | A sql wraper that holds the structure of all the columns returned from executing it |
IEnumerable<ColumnDescriptor> | visibleColumns | A list of currently visible columns for the sql wrapper that is displaying a result set. Used to ensure the resulting list of columns is correctly marking those that are visible or not according to their current setup |
Returns
Type | Description |
---|---|
IEnumerable<ControlDisplayVisibilityInfo> | A list of columns that can be exported from the specified sql wrapper taking into account the currently
|
GetQueryParameters<T>(T, string, bool, bool, ModelViewController, IEntityUpdater, Func<Task<ISQLWrapper>>, IBaseEntity, bool, IModelLayoutCommon, bool)
Returns a ExportCSVParameter with the parameters, filters, and settings required to execute the export of data the way the user requires through popup param windows if required
This function may popup parameter windows for the parameter selections, any visible column selection and possible further filtering depending on the provided settings and requirement
Declaration
public static Task<T> GetQueryParameters<T>(T param, string entityTypeKey, bool allowColumnFilter, bool ignoreCollectionExportableInterfaceOfController, ModelViewController controller, IEntityUpdater cn, Func<Task<ISQLWrapper>> getWrapper, IBaseEntity contextItem, bool allowDesign, IModelLayoutCommon host, bool promptForQueryFilter = true) where T : class, IQueryExportParams
Parameters
Type | Name | Description |
---|---|---|
T | param | The initial setting describing at least which type of data should be exported, including any other configured parameters |
string | entityTypeKey | |
bool | allowColumnFilter | |
bool | ignoreCollectionExportableInterfaceOfController | Indicates if the controller should be ignored for using it as a source of the data to export |
ModelViewController | controller | The controller this data can be exported from - can be null if all the data is explicitly
defined in the |
IEntityUpdater | cn | An updater context for evaluating formulas when getting default parameter values |
Func<Task<ISQLWrapper>> | getWrapper | A function that returns the sql wrapper used by the param if configured to use a sql wrapper |
IBaseEntity | contextItem | |
bool | allowDesign | |
IModelLayoutCommon | host | The host context the popups (if they occur) should operate within |
bool | promptForQueryFilter |
Returns
Type | Description |
---|---|
Task<T> | A ExportCSVParameter with the parameters, filters, and settings required to execute the export of data the way the user requires through popup param windows if required |
Type Parameters
Name | Description |
---|---|
T |
GetSerializedParameters(SQLWrapperResultsViewParams, SQLWrapperInterpretor, IEntityUpdater, object, IModelLayoutCommon, bool, bool)
Returns a serialized dictionary of parameter name and value, selected by the user from a popup presented for all posssible parameters
Declaration
public static Task<(bool Valid, bool Accepted, string SerializedParams, SQLWrapperResultsViewParams Params)> GetSerializedParameters(SQLWrapperResultsViewParams p, SQLWrapperInterpretor helper, IEntityUpdater updater, object contextItem, IModelLayoutCommon host, bool run, bool forceParamShow)
Parameters
Type | Name | Description |
---|---|---|
SQLWrapperResultsViewParams | p | The current parameters to display to the user and allow selection of. Could display pivot, chart, or sql wrapper parameters for executing the underlying sql wrapper. |
SQLWrapperInterpretor | helper | The underlying sql wrapper to display parameters for |
IEntityUpdater | updater | The updater context for running custom formulas with for default parameter values |
object | contextItem | The context item that formulas can be run against |
IModelLayoutCommon | host | The owning host context this runs within |
bool | run | Indicates these parameter values will be executed. If true then return false if the current If false will prompt user for parameters via a popup window for the appropriate SQLWrapperResultsViewParams type (sqlwrapper, pivot, chart, etc) |
bool | forceParamShow | Forces the parameters to be shown even if the required parameters already have a value |
Returns
Type | Description |
---|---|
Task<(bool Valid, bool Accepted, string SerializedParams, SQLWrapperResultsViewParams Params)> | The following tuple:
|
GetVisibleColumns(bool, ModelViewController, SQLWrapperInterpretor, EntityDescriptor)
Returns a list of columns that can be exported from the specified dataset
The columns used come from an ICollectionExportable controller
if the
ignoreCollectionExportableInterfaceOfController
is false.
sqlWrapperHelper
, or the properties of the
provided entity descriptor desc
Declaration
public static Task<IEnumerable<ControlDisplayVisibilityInfo>> GetVisibleColumns(bool ignoreCollectionExportableInterfaceOfController, ModelViewController controller, SQLWrapperInterpretor sqlWrapperHelper, EntityDescriptor desc)
Parameters
Type | Name | Description |
---|---|---|
bool | ignoreCollectionExportableInterfaceOfController | If false and |
ModelViewController | controller | If |
SQLWrapperInterpretor | sqlWrapperHelper | Uses the visible columns definied within the structure of the provided sql wrapper |
EntityDescriptor | desc | Uses the properties of the provided entity descriptor |
Returns
Type | Description |
---|---|
Task<IEnumerable<ControlDisplayVisibilityInfo>> | A list of columns that can be exported from the specified dataset. Must come from the controller defintion, a sql wrapper helper, or an entity descriptor |
InitCommands(IList<ViewCommand>)
Adds the query parameters command which provides additional parameters for executing a sql wrapper, or filtering a sql wrapper/entity type
Declaration
protected override void InitCommands(IList<ViewCommand> commands)
Parameters
Type | Name | Description |
---|---|---|
IList<ViewCommand> | commands | The current list of controls for this parameter controller |
Overrides
OnItemChanged(object, PropertyChangedEventArgs)
Occurs whenever a change in the ExportCSVParameter properties being displayed is detected
Used to update the commands for this parameter, and to ensure labels are correctly updated on item selections
Declaration
protected override void OnItemChanged(object sender, PropertyChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
object | sender | The object raising the property changed |
PropertyChangedEventArgs | e | The property that has been changed |