20220908 人员培训记录保存错误修改。

This commit is contained in:
2022-09-08 14:15:28 +08:00
parent 2b07be5792
commit f38675c06a
7 changed files with 24 additions and 16 deletions
@@ -634,9 +634,18 @@ namespace BLL
var getSitePerson = GetSitePersonByProjectIdPersonId(projectId, personId);
if (getSitePerson != null && string.IsNullOrEmpty(getSitePerson.CardNo))
{
cardNo = SQLHelper.RunProcNewId("SpGetNewNumber", "SitePerson_Person", "CardNo", getSitePerson.ProjectId, UnitService.GetUnitCodeByUnitId(getSitePerson.UnitId));
getSitePerson.CardNo = cardNo;
Funs.DB.SubmitChanges();
string prefix = UnitService.GetUnitCodeByUnitId(getSitePerson.UnitId);
var getMaxCarNo = Funs.DB.SitePerson_Person.Where(x => x.ProjectId == projectId && x.CardNo.Contains(prefix)).Max(x => x.CardNo);
if (!string.IsNullOrEmpty(getMaxCarNo) && getMaxCarNo.Length > 5)
{
var getInt = Funs.GetNewInt(Funs.GetSubStr(getMaxCarNo, 5));
if (getInt.HasValue)
{
cardNo = SQLHelper.RunProcNewId("SpGetNewNumber", "SitePerson_Person", "CardNo", getSitePerson.ProjectId, prefix);
getSitePerson.CardNo = cardNo;
Funs.DB.SubmitChanges();
}
}
}
return cardNo;