Пример #1
0
 /// <summary> 获取编码方式
 /// </summary>
 /// <param name="enumBillCodeMethod">枚举:编码方式</param>
 /// <returns>返回编码方式串</returns>
 private static string GetStrByCodeMethod(SYSModel.DataSources.EnumBillCodeMethod enumBillCodeMethod)
 {
     if (enumBillCodeMethod == SYSModel.DataSources.EnumBillCodeMethod.NONE)
     {
         return("");
     }
     if (enumBillCodeMethod == SYSModel.DataSources.EnumBillCodeMethod.MMDDHH)
     {
         return(GlobalStaticObj_Server.Instance.CurrentDateTime.ToString("MMddhh"));
     }
     if (enumBillCodeMethod == SYSModel.DataSources.EnumBillCodeMethod.YYYYMMDD)
     {
         return(GlobalStaticObj_Server.Instance.CurrentDateTime.ToString("yyyyMMdd"));
     }
     return("");
 }
Пример #2
0
 /// <summary> 获取前缀
 /// </summary>
 /// <param name="billCode">项目编码</param>
 /// <param name="codeMethod">编码方式</param>
 /// <param name="delimiter">分隔符</param>
 /// <returns>返回前缀</returns>
 public static string GetPrefix(string billCode, string codeMethod, string delimiter)
 {
     if (!string.IsNullOrEmpty(codeMethod))
     {
         SYSModel.DataSources.EnumBillCodeMethod enumBillCodeMethod = (SYSModel.DataSources.EnumBillCodeMethod)Convert.ToInt16(codeMethod);
         codeMethod = GetStrByCodeMethod(enumBillCodeMethod);
     }
     if (!string.IsNullOrEmpty(delimiter) && !delimiter.Equals("0"))
     {
         SYSModel.DataSources.EnumDelimiter enumDelimiter = (SYSModel.DataSources.EnumDelimiter)Convert.ToInt16(delimiter);
         delimiter = SYSModel.DataSources.GetDescription(enumDelimiter, true);
     }
     else
     {
         delimiter = "";
     }
     return(billCode + delimiter + codeMethod + delimiter);
 }