Table of Contents

Class CodeProviderEntry

Namespace
Tripous.Data
Assembly
Tripous.Data.dll

Represents a code provider entry, usually loaded from the NumberSeries table.

public class CodeProviderEntry
Inheritance
CodeProviderEntry
Inherited Members
Extension Methods

Constructors

CodeProviderEntry()

Constructor

public CodeProviderEntry()

CodeProviderEntry(DataRow)

Constructor

public CodeProviderEntry(DataRow Row)

Parameters

Row DataRow

Properties

Code

The unique provider code. Usually maps to NumberSeries.Code and is used as the lookup key. Example: SALES_ORDER, CUSTOMER, SUPPLIER.

public string Code { get; }

Property Value

string

IsActive

Indicates whether this provider is active.

public bool IsActive { get; }

Property Value

bool

LastResetValue

Stores the last reset marker value. Example: 2026, 2026-05, 2026-Q2. Used to determine whether sequence reset is required.

public string LastResetValue { get; }

Property Value

string

MaxNumber

Maximum numeric value supported by the pattern. Calculated from the total X token count. Example: XXXX -> 9999 XXX-XXX -> 999999

public int MaxNumber { get; }

Property Value

int

Name

The display name of this provider.

public string Name { get; }

Property Value

string

NextNumber

The next numeric value to be generated.

public int NextNumber { get; }

Property Value

int

NumericDigits

Total number of numeric digits defined by X tokens. All X tokens participate regardless of separators. Example: XXX-XXX -> 6

public int NumericDigits { get; }

Property Value

int

Pattern

The code generation pattern. Example: SO-YYYY-XXXXXX

public string Pattern { get; }

Property Value

string

ResetPeriod

Defines the reset period of the generated sequence. Example: Year, Month, Week.

public ResetPeriod ResetPeriod { get; }

Property Value

ResetPeriod

Methods

Format(DateTime, int)

Formats and returns the final generated code. Replaces date tokens and numeric X positions. Example: Pattern: SO-YYYY-XXXXXX Result : SO-2026-000123

public string Format(DateTime Date, int Number)

Parameters

Date DateTime
Number int

Returns

string

GetResetValue(DateTime)

Returns the current reset value according to the configured reset period. Examples: Year -> 2026 Semester -> 2026-S1 Quarter -> 2026-Q2 Month -> 2026-05 Week -> 2026-W20 Day -> 2026-05-18

public string GetResetValue(DateTime Date)

Parameters

Date DateTime

Returns

string

LoadForm(DataRow)

Loads this instance from a data row

public virtual void LoadForm(DataRow Row)

Parameters

Row DataRow