标签:
服务器端实现:
//或得最新采购单号
protected void GetNewNumber()
{
int NewNumber = PurchaseplanBll.GetPurchaseplanNewNumber();
int NewNumber1 = NewNumber + 1;
string PurchaserplanNumber = NewNumber1.ToString().PadLeft(8, ‘0‘);
hfPurchaseplanNumber.Value = PurchaserplanNumber;
}
在数据库中实现:
SELECT @NewPurchaseplanNumber=(SELECT Top 1 PurchaseplanNumber from tblPurchaseplan Order by ID Desc)+1
SELECT @NewPurchaseNumber=RIGHT(REPLICATE(‘0‘,8)+CAST(@NewPurchaseplanNumber AS varchar(10)),8)
标签:
原文地址:http://www.cnblogs.com/zxk3113/p/4271549.html