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)); }
public static string CreateWithInfix(SerialNoType type, string format = "yyMMddHHmmssffff", string infix = "") { var key = type.ToDescription(); return(key + infix + TimeStampFactory.Create(key, format)); }
public static string CreateWithoutPrefix(SerialNoType type, string format = "yyMMddHHmmssffff") { var key = type.ToDescription(); return(SLBId + TimeStampFactory.Create(key, format)); }
public static string Create(SerialNoType type, string format = "yyMMddHHmmssffff", string suffix = "") { var key = type.ToDescription(); return(key + SLBId + TimeStampFactory.Create(key, format) + suffix); }