コード例 #1
0
        public static string CreateConsumerCardNo(int num, int index)
        {
            var    result   = TimeStampFactory.Create("", "yyMMddHHmmssff");
            string strIndex = index.ToString();

            if (result.Length + strIndex.Length == num)
            {
                return(string.Concat(result, strIndex));
            }
            else if (result.Length + strIndex.Length < num)
            {
                strIndex = strIndex.PadLeft(num - result.Length, '0');
                return(string.Concat(result, strIndex));
            }
            return(string.Concat(result, strIndex).Substring(0, num));
        }
コード例 #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 CreateWithoutPrefix(SerialNoType type, string format = "yyMMddHHmmssffff")
        {
            var key = type.ToDescription();

            return(SLBId + TimeStampFactory.Create(key, format));
        }
コード例 #4
0
        public static string Create(SerialNoType type, string format = "yyMMddHHmmssffff", string suffix = "")
        {
            var key = type.ToDescription();

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