string liushuihao = string.Empty;
string liushuihao1 = string.Empty;
//判断是否为某什么,如果是,则修改他的流水号规则,变成新的流水号,改最后三位数
if (app.SplitBoxInfoData.Name == \”TX\”)
{
int length = app.SplitInfoData.OldLiushuihao.Length;
int maxnum = 46655;
//ZZZ开始直到001结束
for (long i = 46655; i >= 1; i–)
{
//36进制,返回的数不够就左边补0
string num= DBcode.ConvertTo36(i).PadLeft(3, \’0\’);
//如果包含A/E/I/O/U,就continue
if (num.Contains(\”A\”) || num.Contains(\”E\”) || num.Contains(\”I\”) || num.Contains(\”O\”) || num.Contains(\”U\”))
{
continue;
}
liushuihao1 = app.SplitInfoData.OldLiushuihao.Substring(0, 11) + num; //选择前11位数+三位新的数
LiuShuihao b = comm.Get_Liushuihao(app.SplitInfoData.POID, liushuihao1);
LiuShuihao L = comm.GetLiushuihao(liushuihao1);
//判断流水号有没有被使用,没被使用就赋值,然后break;如果有继续循环
if (b == null && L == null)
{
liushuihao= liushuihao1;
break;
}
}
pulic class DBcode()
{
public static string ConvertTo36(long i)
{
string s = \”\”;
long j = 0;
while (i >= 36)
{
j = i % 36;
if (j < 10)
s += j.ToString();
else
s += Convert.ToChar(j + 87);
i = i / 36;
}
if (i < 10)
s += i.ToString();
else
s += Convert.ToChar(i + 87);
Char[] c = s.ToCharArray();
Array.Reverse(c);
return Convert.ToString(new string(c)).ToUpper();
}
}