修改退出改为加入
parent
8c5cca7ba5
commit
b6403580de
|
@ -868,18 +868,17 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
await _mailVerificationService.SiteSurveyUserJoinEmail(trialId, userId, joinCommand.BaseUrl, joinCommand.RouteUrl);
|
await _mailVerificationService.SiteSurveyUserJoinEmail(trialId, userId, joinCommand.BaseUrl, joinCommand.RouteUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!await _repository.AnyAsync<TrialSiteUser>(t => t.TrialId == trialId && t.UserId == userId && t.SiteId == siteId, true))
|
var findTrialSiteUser = await _trialSiteUserRepository.FirstOrDefaultAsync(t => t.TrialId == trialId && t.UserId == userId && t.SiteId == siteId, true);
|
||||||
|
|
||||||
|
if (findTrialSiteUser == null)
|
||||||
{
|
{
|
||||||
await _repository.AddAsync(new TrialSiteUser() { TrialId = trialId, SiteId = siteId, UserId = userId });
|
await _repository.AddAsync(new TrialSiteUser() { TrialId = trialId, SiteId = siteId, UserId = userId });
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
await _trialSiteUserRepository.UpdatePartialFromQueryAsync(t => t.TrialId == trialId && t.UserId == userId && t.SiteId == siteId, c => new TrialSiteUser()
|
findTrialSiteUser.IsDeleted = false;
|
||||||
{
|
findTrialSiteUser.DeletedTime = null;
|
||||||
IsDeleted = false,
|
|
||||||
DeletedTime = null,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
await _userRepository.BatchUpdateNoTrackingAsync(t => t.Id == userId, u => new User() { Status = UserStateEnum.Enable });
|
await _userRepository.BatchUpdateNoTrackingAsync(t => t.Id == userId, u => new User() { Status = UserStateEnum.Enable });
|
||||||
|
@ -1017,18 +1016,17 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!await _repository.AnyAsync<TrialSiteUser>(t => t.TrialId == trialId && t.UserId == userId && t.SiteId == siteId, true))
|
var findTrialSiteUser = await _trialSiteUserRepository.FirstOrDefaultAsync(t => t.TrialId == trialId && t.UserId == userId && t.SiteId == siteId, true);
|
||||||
|
|
||||||
|
if (findTrialSiteUser == null)
|
||||||
{
|
{
|
||||||
await _repository.AddAsync(new TrialSiteUser() { TrialId = trialId, SiteId = siteId, UserId = userId });
|
await _repository.AddAsync(new TrialSiteUser() { TrialId = trialId, SiteId = siteId, UserId = userId });
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
await _trialSiteUserRepository.UpdatePartialFromQueryAsync(t => t.TrialId == trialId && t.UserId == userId && t.SiteId == siteId, c => new TrialSiteUser()
|
findTrialSiteUser.IsDeleted = false;
|
||||||
{
|
findTrialSiteUser.DeletedTime = null;
|
||||||
IsDeleted = false,
|
|
||||||
DeletedTime = null,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
await _userRepository.BatchUpdateNoTrackingAsync(t => t.Id == userId, u => new User() { Status = UserStateEnum.Enable });
|
await _userRepository.BatchUpdateNoTrackingAsync(t => t.Id == userId, u => new User() { Status = UserStateEnum.Enable });
|
||||||
|
|
Loading…
Reference in New Issue