using WIDESEA_Common.DBHelper;
namespace WIDESEA_Common.Tools
{
///
/// 序号管理帮助类
///
public class IdenxManager
{
static FreeDB freeDB = new FreeDB();
private static object lock_obj = new object();
///
/// 获取任务编号
///
///
public static int GetTaskNo(string numType = "tasknum")
{
lock (lock_obj)
{
var oldNo = freeDB.DataBase.Ado.QuerySingle("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;
}
}
}
}