You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
467 B

namespace Swapping.Business.Common;
public class SwapOrderNoGenerator
{
private static UInt16 Seq = 0;
private static Object Locker = new object();
public static string GenerateOrderNo(string stationNo)
{
lock (Locker)
{
if (Seq > 9999)
{
Seq = 0;
}
return $"{stationNo}{DateTime.Now.ToString("yyyyMMddHHmmss")}{Seq++.ToString().PadLeft(6, '0')}";
}
}
}