C# business serial number rule generation component

For many business systems, it is necessary to generate business serial numbers, such as order numbers, purchase order numbers, etc.; and these business serial numbers are not simply an increasing value, they are often defined by some different rules, such as different types letters or regional pinyin abbreviations, etc. In order to generate these regular business serial numbers more flexibly, BeetleX provides corresponding components. Next, we briefly introduce the use of components.

        First, you need to reference the BeetleX.BNR component through Nuget, and then use the following method to generate a business serial number

for (int i = 0; i < 10; i++)
{
    var number = await BNRFactory.Default.Create("[CN:广州][D:yyyyMMdd][N:[D:yyyyMMdd]/000000]");
    Console.WriteLine(number);
}

Generate serial number:

GZ20220520000008
GZ20220520000009
GZ20220520000010
GZ20220520000011
GZ20220520000012
GZ20220520000013
GZ20220520000014
GZ20220520000015
GZ20220520000016
GZ20220520000017

Business serial number rule generation component_dotNET cross-platform blog-CSDN blog

Guess you like

Origin blog.csdn.net/beautifull001/article/details/125219159