Search Results for

    Show / Hide Table of Contents

    Class ExportData

    A controller for displaying the ExportCSVParameter parameters to the user for choosing the data they would like to export

    Inheritance
    object
    PopupWindowController
    PopupWindowController<ExportCSVParameter>
    ParamViewerController<ExportCSVParameter>
    ParamSingleViewerController<ExportCSVParameter>
    ExportData
    Implements
    IPopupWindowController<ExportCSVParameter>
    IParamViewerController
    IPopupWindowController
    IController
    Inherited Members
    ParamSingleViewerController<ExportCSVParameter>.InitFromWindow(IPopupWindow<ExportCSVParameter>)
    ParamSingleViewerController<ExportCSVParameter>.Display()
    ParamSingleViewerController<ExportCSVParameter>.Controls()
    ParamSingleViewerController<ExportCSVParameter>.Host
    ParamSingleViewerController<ExportCSVParameter>.SingleWindow
    ParamSingleViewerController<ExportCSVParameter>.UIContext
    ParamSingleViewerController<ExportCSVParameter>.ServiceContext
    ParamViewerController<ExportCSVParameter>.SetParam(ExportCSVParameter)
    ParamViewerController<ExportCSVParameter>.OriginalParam
    PopupWindowController<ExportCSVParameter>.OnOk(object)
    PopupWindowController<ExportCSVParameter>.OnOk(ExportCSVParameter)
    PopupWindowController<ExportCSVParameter>.Validate(ExportCSVParameter)
    PopupWindowController<ExportCSVParameter>.OnCancel()
    PopupWindowController<ExportCSVParameter>.OwningWindow
    PopupWindowController<ExportCSVParameter>.Commands
    PopupWindowController<ExportCSVParameter>.GetResult
    PopupWindowController.RootController
    object.GetType()
    object.MemberwiseClone()
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    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
    LemonEdge.Client.UI.API.Controllers.ParamSingleViewerController<LemonEdge.API.Core.Tasks.Parameters.ExportCSVParameter>.AlterControlInfo(LemonEdge.Client.UI.API.Controls.ControlDisplayInfo)

    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
    LemonEdge.Client.UI.API.Controllers.ParamSingleViewerController<LemonEdge.API.Core.Tasks.Parameters.ExportCSVParameter>.ControlNames()

    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 visibleColumns in the grid displaying sql wrapper results

    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 param

    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 p is not valid.

    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:

    • Valid: Indicates the returned SerializedParam is valid for the required parameters
    • Accepted: Indicates the user accepted the parameters and did not cancel out of any popup parameters
    • SerializedParams: A serialized dictionary of parameters and their values to use
    • Params: The changed SQLWrapperResultViewParams parameters

    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.

    Else they come from the definition of the provided 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 controller is of type ICollectionExportable then the controller is used to return the visible columns for exporting

    ModelViewController controller

    If ignoreCollectionExportableInterfaceOfController is false and this controller is of type ICollectionExportable then it is used to return the visible columns for exporting

    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
    PopupWindowController<ExportCSVParameter>.InitCommands(IList<ViewCommand>)

    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

    Overrides
    ParamSingleViewerController<ExportCSVParameter>.OnItemChanged(object, PropertyChangedEventArgs)

    Implements

    IPopupWindowController<TResult>
    IParamViewerController
    IPopupWindowController
    IController

    Extension Methods

    LinqExtensions.AsArray<T>(T)
    LinqExtensions.ToArrayOfOne<T>(T)
    LinqExtensions.ToListOfOne<T>(T)
    MiscExtensions.SetIfNotEqual<T, TP>(T, Expression<Func<T, TP>>, TP)
    WeakReferenceExtensions.WeakReference(object)
    SQLExtensions.ToSQLValue(object, bool)
    ReflectionExtensions.ClearEventInvocations(object, string)
    StringExtensions.ToCSVFormatString(object, Type)
    In this article
    Back to top © LemonEdge Technologies. All rights reserved.