This commit is contained in:
杨红卫 2023-06-27 23:06:59 +08:00
parent 225bc98fcd
commit da7bf97960
3 changed files with 25 additions and 31 deletions

View File

@ -638,7 +638,7 @@ namespace BLL
var getSitePerson = GetSitePersonByProjectIdPersonId(projectId, personId);
if (getSitePerson != null && string.IsNullOrEmpty(getSitePerson.CardNo))
{
cardNo= SendCarNobySiteperson(getSitePerson);
cardNo= SendCarNobySiteperson(getSitePerson.SitePersonId);
}
return cardNo;
@ -649,11 +649,14 @@ namespace BLL
/// </summary>
/// <param name="item"></param>
/// <returns></returns>
public static string SendCarNobySiteperson(Model.SitePerson_Person item)
public static string SendCarNobySiteperson(string sitePersonId)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
string carNo = string.Empty;
var item = db.SitePerson_Person.FirstOrDefault(x => x.SitePersonId == sitePersonId);
if (item != null)
{
var isNull = db.EduTrain_TrainRecordDetail.FirstOrDefault(x => x.PersonId == item.PersonId && x.CheckResult == true);
if (isNull != null) ////参加过培训的人员
{
@ -678,7 +681,7 @@ namespace BLL
db.SubmitChanges();
}
}
}
return carNo;
}
}

View File

@ -522,7 +522,7 @@ namespace BLL
select x;
foreach (var item in getPersons)
{
if (!string.IsNullOrEmpty(SitePerson_PersonService.SendCarNobySiteperson(item)))
if (!string.IsNullOrEmpty(SitePerson_PersonService.SendCarNobySiteperson(item.SitePersonId)))
{
count++;
}

View File

@ -57,18 +57,9 @@ namespace FineUIPro.Web.HSSE.SitePerson
{
try
{
var getSitePerson = SitePerson_PersonService.GetSitePersonById(this.StiePersonId);
if (getSitePerson != null)
{
SitePerson_PersonService.SendCarNobySiteperson(getSitePerson);
SitePerson_PersonService.SendCarNobySiteperson(this.StiePersonId);
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
}
else
{
ShowNotify("发卡未成功!", MessageBoxIcon.Warning);
return;
}
}
catch
{
ShowNotify("发卡未成功!", MessageBoxIcon.Warning);