예제 #1
0
        /// <summary>
        /// 创建下一单序列号(序列号固定5位数):
        /// 订单类型+前缀+当前时间戳+(序列号+1)
        /// </summary>
        /// <param name="type">订单类型</param>
        /// <param name="infix">前缀</param>
        /// <param name="num">序列号</param>
        /// <param name="format">时间戳格式</param>
        /// <returns></returns>
        public static string CreateNextSeriesNum(SerialNoType type, string infix, int num = 0, string format = "yyMMdd")
        {
            var key    = type.ToDescription();
            var date   = DateTime.Now.Date.ToString(format);
            var prefix = key + infix + date;

            return(prefix + (num + 1).ToString("00000"));
        }
예제 #2
0
        public static string CreateWithInfix(SerialNoType type, string format = "yyMMddHHmmssffff", string infix = "")
        {
            var key = type.ToDescription();

            return(key + infix + TimeStampFactory.Create(key, format));
        }
예제 #3
0
        public static string CreateIncrease(SerialNoType type, int max, int minLenth = 2)
        {
            var result = (max + 1).ToString();

            return(type.ToDescription() + result.PadLeft(minLenth, '0'));
        }
예제 #4
0
        public static string CreateWithoutPrefix(SerialNoType type, string format = "yyMMddHHmmssffff")
        {
            var key = type.ToDescription();

            return(SLBId + TimeStampFactory.Create(key, format));
        }
예제 #5
0
        public static string Create(SerialNoType type, string format = "yyMMddHHmmssffff", string suffix = "")
        {
            var key = type.ToDescription();

            return(key + SLBId + TimeStampFactory.Create(key, format) + suffix);
        }