Table of Contents

Class DataExportationWriterBase

Namespace
JJMasterData.Core.DataManager.Exportation.Abstractions
Assembly
JJMasterData.Core.dll
public abstract class DataExportationWriterBase : IBackgroundTaskWorker, IExportationWriter
Inheritance
DataExportationWriterBase
Implements
Derived
Inherited Members

Constructors

DataExportationWriterBase(IEncryptionService, ExpressionsService, IStringLocalizer<MasterDataResources>, IOptionsSnapshot<MasterDataCoreOptions>, ILogger<DataExportationWriterBase>)

protected DataExportationWriterBase(IEncryptionService encryptionService, ExpressionsService expressionsService, IStringLocalizer<MasterDataResources> stringLocalizer, IOptionsSnapshot<MasterDataCoreOptions> options, ILogger<DataExportationWriterBase> logger)

Parameters

encryptionService IEncryptionService
expressionsService ExpressionsService
stringLocalizer IStringLocalizer<MasterDataResources>
options IOptionsSnapshot<MasterDataCoreOptions>
logger ILogger<DataExportationWriterBase>

Fields

RecordsPerPage

protected const int RecordsPerPage = 100000

Field Value

int

Properties

AbsoluteUri

public string AbsoluteUri { get; }

Property Value

string

Configuration

public ExportOptions Configuration { get; set; }

Property Value

ExportOptions

CurrentFilter

Get = Recupera o filtro atual

public Dictionary<string, object> CurrentFilter { get; set; }

Property Value

Dictionary<string, object>

CurrentOrder

Recupera a ordenação da tabela, por padrão utiliza o primeiro campo da chave primária

public OrderByData CurrentOrder { get; set; }

Property Value

OrderByData

Ordem atual da tabela

Remarks

Para mais de um campo utilize virgula ex: "Campo1 ASC, Campo2 DESC, Campo3 ASC"

DataSource

Tabela com os dados

public IList<Dictionary<string, object>> DataSource { get; set; }

Property Value

IList<Dictionary<string, object>>

Remarks

Datasource é propriedade responsável por controlar a origem de dados. O componente utiliza seguinte regra para recuperar os dados da grid:

1) Utiliza a propriedade DataSource;

2) Se a propriedade DataSource for nula, tenta executar a ação OnDataLoad;

3) Se a ação OnDataLoad não for implementada, tenta recuperar utilizando a proc informada no FormElement;

FolderPath

Path where the files are generated.

public string FolderPath { get; }

Property Value

string

FormElement

Configurações pré-definidas do formulário

public FormElement FormElement { get; set; }

Property Value

FormElement

ProcessOptions

public ProcessOptions ProcessOptions { get; set; }

Property Value

ProcessOptions

ProcessReporter

public DataExportationReporter ProcessReporter { get; }

Property Value

DataExportationReporter

StringLocalizer

protected IStringLocalizer<MasterDataResources> StringLocalizer { get; }

Property Value

IStringLocalizer<MasterDataResources>

TotalOfRecords

public int TotalOfRecords { get; set; }

Property Value

int

UserId

public string UserId { get; set; }

Property Value

string

VisibleFields

protected List<FormElementField> VisibleFields { get; }

Property Value

List<FormElementField>

Methods

GenerateDocument(Stream, CancellationToken)

public abstract Task GenerateDocument(Stream ms, CancellationToken token)

Parameters

ms Stream
token CancellationToken

Returns

Task
protected string GetFileLink(FormElementField field, Dictionary<string, object> row, string value)

Parameters

field FormElementField
row Dictionary<string, object>
value string

Returns

string

Reporter(DataExportationReporter)

protected void Reporter(DataExportationReporter processReporter)

Parameters

processReporter DataExportationReporter

RunWorkerAsync(CancellationToken)

public Task RunWorkerAsync(CancellationToken token)

Parameters

token CancellationToken

Returns

Task

Events

OnProgressChanged

public event EventHandler<IProgressReporter> OnProgressChanged

Event Type

EventHandler<IProgressReporter>