Table of Contents

Class SeriennummernManager

Namespace
BpNexT.NET.Models.Lager
Assembly
BpNexT.NET.dll

Provides a managed wrapper around the microtech ERP IAutoSeriennummern interface for handling serial numbers in warehouse operations.

public class SeriennummernManager : ISeriennummernManager, IEnumerable<string>, IEnumerable
Inheritance
object
SeriennummernManager
Implements

Remarks

Since this wraps a COM interface, be cautious about performance implications when dealing with large collections.

Properties

Count

Gets the number of serial numbers currently in the collection.

public int Count { get; }

Property Value

int

this[int]

Gets the serial number at the specified index.

public string this[int index] { get; }

Parameters

index int

The zero-based index of the serial number to retrieve.

Property Value

string

The serial number at the specified index.

Exceptions

ArgumentOutOfRangeException

Thrown when index is out of range.

Methods

Add(string)

Adds a serial number to the collection.

public int Add(string serialNumber)

Parameters

serialNumber string

The serial number to add. Supports range syntax (e.g., "SN100..10" creates SN100 through SN109).

Returns

int

The zero-based index at which the first number was inserted.

Exceptions

ArgumentNullException

Thrown when serialNumber is null or empty.

AddRange(IEnumerable<string>)

Adds multiple serial numbers to the collection.

public void AddRange(IEnumerable<string> serialNumbers)

Parameters

serialNumbers IEnumerable<string>

The serial numbers to add.

Exceptions

ArgumentNullException

Thrown when serialNumbers is null.

Clear()

Removes all serial numbers from the collection.

public void Clear()

Contains(string)

Determines whether the collection contains the specified serial number.

public bool Contains(string serialNumber)

Parameters

serialNumber string

The serial number to search for.

Returns

bool

true if the serial number is found; otherwise, false.

GetEnumerator()

Returns an enumerator that iterates through the collection.

public IEnumerator<string> GetEnumerator()

Returns

IEnumerator<string>

An enumerator that can be used to iterate through the collection.

HasDuplicates()

Checks whether there are duplicate serial numbers in the collection.

public bool HasDuplicates()

Returns

bool

true if duplicates exist; otherwise, false.

IndexOf(string)

Returns the index of the specified serial number.

public int IndexOf(string serialNumber)

Parameters

serialNumber string

The serial number to search for.

Returns

int

The zero-based index of the serial number, or -1 if not found.

Pack(bool, bool)

Sorts and/or packs the serial numbers in the collection.

public void Pack(bool sort = true, bool pack = false)

Parameters

sort bool

If true, the serial numbers will be sorted.

pack bool

If true, creates a compact representation of the serial numbers. Note: This parameter should not be used in COM context according to microtech ERP documentation.

Remove(string)

Removes the first occurrence of the specified serial number.

public bool Remove(string serialNumber)

Parameters

serialNumber string

The serial number to remove.

Returns

bool

true if the serial number was found and removed; otherwise, false.

RemoveAt(int)

Removes the serial number at the specified index.

public void RemoveAt(int index)

Parameters

index int

The zero-based index of the serial number to remove.

Exceptions

ArgumentOutOfRangeException

Thrown when index is out of range.

RemoveDuplicates()

Removes duplicate serial numbers from the collection.

public bool RemoveDuplicates()

Returns

bool

true if duplicates were found and removed; otherwise, false.

Sort()

Sorts the serial numbers in the collection.

public void Sort()

ToList()

Gets all serial numbers as a list.

public List<string> ToList()

Returns

List<string>

A list containing all serial numbers in the collection.