1
This commit is contained in:
@@ -120,7 +120,32 @@ namespace BLL
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取最大编号
|
||||
/// </summary>
|
||||
/// <param name="SysTemType"></param>
|
||||
/// <param name="type"></param>
|
||||
/// <returns></returns>
|
||||
public static string getCode(string SysTemType, string type)
|
||||
{
|
||||
var maxCode = Funs.DB.Check_RewardAndPunish
|
||||
.Where(x => x.SysTemType == SysTemType && x.RewardAndPunishCode.Contains(type))
|
||||
.Max(x => x.RewardAndPunishCode);
|
||||
if (maxCode != null)
|
||||
{
|
||||
//取最后5 位
|
||||
var code = maxCode.Substring(maxCode.Length - 5);
|
||||
var codeNum = int.Parse(code);
|
||||
codeNum++;
|
||||
return $"{type}{codeNum:D5}";
|
||||
}
|
||||
else
|
||||
{
|
||||
return $"{type}00001";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user