using WIDESEA_Common.DBHelper;
|
|
namespace WIDESEA_Common.Tools
|
{
|
/// <summary>
|
/// 序号管理帮助类
|
/// </summary>
|
public class IdenxManager
|
{
|
static FreeDB freeDB = new FreeDB();
|
private static object lock_obj = new object();
|
|
/// <summary>
|
/// 获取任务编号
|
/// </summary>
|
/// <returns></returns>
|
public static int GetTaskNo(string numType = "tasknum")
|
{
|
lock (lock_obj)
|
{
|
var oldNo = freeDB.DataBase.Ado.QuerySingle<int>("select taskno from dt_task_number where numtype=@numtype", new { numType });
|
freeDB.DataBase.Ado.ExecuteNonQuery("update dt_task_number set taskno=taskno+1 where numtype=@numtype", new { numType });
|
return oldNo + 1;
|
}
|
}
|
}
|
}
|