diff --git a/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs b/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs index 7a785d7be..097891d95 100644 --- a/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs +++ b/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs @@ -154,7 +154,7 @@ namespace IRaCIS.Core.Application.Contracts { isVirtual = await _trialRepository.Where(x => x.Id == inDto.TrialId).Select(x => x.TrialType != TrialType.OfficialTrial).FirstNotNullAsync(); - await _doctorRepository.UpdatePartialFromQueryAsync(x => x.Id == dockerInfo.Id, y => new Doctor() + await _doctorRepository.BatchUpdateNoTrackingAsync(x => x.Id == dockerInfo.Id, y => new Doctor() { IsVirtual = isVirtual, AcceptingNewTrial = inDto.TrialId == null ? false : true, @@ -245,6 +245,17 @@ namespace IRaCIS.Core.Application.Contracts { result.DoctorId = dockerInfo.Id; result.ReviewStatus = dockerInfo.ReviewStatus; + + if(inDto.TrialId != null) + { + var isVirtual = await _trialRepository.Where(x => x.Id == inDto.TrialId).Select(x => x.TrialType != TrialType.OfficialTrial).FirstNotNullAsync(); + await _doctorRepository.BatchUpdateNoTrackingAsync(x => x.Id == dockerInfo.Id, y => new Doctor() + { + IsVirtual = isVirtual, + AcceptingNewTrial = inDto.TrialId == null ? false : true, + CooperateStatus = inDto.TrialId == null ? ContractorStatusEnum.Noncooperation : ContractorStatusEnum.Cooperation, + }); + } } else {