Search Results for

    Show / Hide Table of Contents

    Class SequenceNumberCounter

    Represents a simple number sequence counter, which generated new numbers

    Inheritance
    System.Object
    SequenceNumberCounter
    Namespace: Simplic.Framework.Core
    Assembly: Simplic.Framework.Base.dll
    Syntax
    public class SequenceNumberCounter : UI.MVC.ViewModelBase

    Constructors

    | Improve this Doc View Source

    SequenceNumberCounter(SequenceNumber)

    Create sequence

    Declaration
    public SequenceNumberCounter(SequenceNumber sequence)
    Parameters
    Type Name Description
    SequenceNumber sequence

    Sequence instance

    Properties

    | Improve this Doc View Source

    CurrentPosition

    Current position. The setter should only be used for serialization and deserialization.

    Declaration
    public long CurrentPosition { get; set; }
    Property Value
    Type Description
    System.Int64
    | Improve this Doc View Source

    DbSequenceName

    Name of the sequence in the database

    Declaration
    public string DbSequenceName { get; set; }
    Property Value
    Type Description
    System.String
    | Improve this Doc View Source

    FixedLength

    Fixed length, 0 = no length

    Declaration
    public int FixedLength { get; set; }
    Property Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    Format

    Optional format

    Declaration
    public string Format { get; set; }
    Property Value
    Type Description
    System.String
    | Improve this Doc View Source

    Header

    Header / Title of the tab

    Declaration
    public string Header { get; }
    Property Value
    Type Description
    System.String
    | Improve this Doc View Source

    Id

    Unique id of the counter

    Declaration
    public Guid Id { get; set; }
    Property Value
    Type Description
    System.Guid
    | Improve this Doc View Source

    Maximum

    End value of the counter

    Declaration
    public long Maximum { get; set; }
    Property Value
    Type Description
    System.Int64
    | Improve this Doc View Source

    Minimum

    Start value of the counter

    Declaration
    public long Minimum { get; set; }
    Property Value
    Type Description
    System.Int64
    | Improve this Doc View Source

    RestartOnEnd

    If set to true, the counter will restart when reaching the end

    Declaration
    public bool RestartOnEnd { get; set; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Sequence

    Instance of the sequence, to which the counter belongs

    Declaration
    public SequenceNumber Sequence { get; }
    Property Value
    Type Description
    SequenceNumber
    | Improve this Doc View Source

    Step

    Step size

    Declaration
    public int Step { get; set; }
    Property Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    TenantId

    Gets or sets the current tenant id

    Declaration
    public Guid? TenantId { get; set; }
    Property Value
    Type Description
    System.Nullable<System.Guid>
    | Improve this Doc View Source

    Tenants

    Gets or sets all tenants

    Declaration
    public ObservableCollection<OrganizationTenant> Tenants { get; set; }
    Property Value
    Type Description
    System.Collections.ObjectModel.ObservableCollection<OrganizationTenant>
    | Improve this Doc View Source

    ValidFrom

    Start date of the counter

    Declaration
    public DateTime? ValidFrom { get; set; }
    Property Value
    Type Description
    System.Nullable<System.DateTime>
    | Improve this Doc View Source

    ValidTo

    End date of the counter

    Declaration
    public DateTime? ValidTo { get; set; }
    Property Value
    Type Description
    System.Nullable<System.DateTime>

    Methods

    | Improve this Doc View Source

    Commit(String)

    Commit number so it can't be reused

    Declaration
    public void Commit(string number)
    Parameters
    Type Name Description
    System.String number

    Number to commit

    | Improve this Doc View Source

    DeleteDbSequence()

    Delete sequence from database

    Declaration
    public void DeleteDbSequence()
    | Improve this Doc View Source

    Generate(DateTime, Boolean)

    Generate a new unique number with the current sequence

    Declaration
    public string Generate(DateTime date, bool useReservation = false)
    Parameters
    Type Name Description
    System.DateTime date

    Date for generating the number

    System.Boolean useReservation

    Use reservation

    Returns
    Type Description
    System.String

    New number, or throws an exception if this fails at some point

    | Improve this Doc View Source

    GenerateSequenceName()

    Generate unique sequence name

    Declaration
    public string GenerateSequenceName()
    Returns
    Type Description
    System.String

    Sequence name if not already existing

    | Improve this Doc View Source

    IsDbSequenceExisting()

    Proof whether the sequence exists in the db or not

    Declaration
    public bool IsDbSequenceExisting()
    Returns
    Type Description
    System.Boolean

    True if it exists, else none

    | Improve this Doc View Source

    IsValid(DateTime, Nullable<Guid>)

    Check whether the counter is valid on a specific date

    Declaration
    public bool IsValid(DateTime date, Guid? tenantId = null)
    Parameters
    Type Name Description
    System.DateTime date

    Dat time to proof whether the counter is valid

    System.Nullable<System.Guid> tenantId

    Tenant id of the data to generate the number for

    Returns
    Type Description
    System.Boolean

    True if the counter is valid

    | Improve this Doc View Source

    LoadSequenceInformation()

    Load information from the database sequence

    Declaration
    public void LoadSequenceInformation()
    | Improve this Doc View Source

    SaveDbSequence()

    Save sequence information

    Declaration
    public void SaveDbSequence()
    | Improve this Doc View Source

    SetPosition(Int64)

    Set sequence position

    Declaration
    public void SetPosition(long position)
    Parameters
    Type Name Description
    System.Int64 position

    Position

    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © 2018 SIMPLIC GmbH
    Generated by DocFx