From 013b9720b3ec510873b158e5a569d19a7ca72e35 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Mon, 20 Jan 2025 11:33:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=B8=AD=E5=BF=83=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/TrialSiteUser/TrialSiteService.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialSiteService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialSiteService.cs index f131d5625..8ca70d2cb 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialSiteService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialSiteService.cs @@ -169,6 +169,12 @@ namespace IRaCIS.Core.Application.Services { item.EnabledTime = DateTime.Now; } + + if (await _trialSiteRepository.AnyAsync(t => t.TrialSiteCode == item.TrialSiteCode && t.TrialId == item.TrialId)) + { + //---Code is not allowed to be repeated + return ResponseOutput.NotOk(_localizer["TrialSite_CodeDuplicate"]); + } } await _trialSiteRepository.AddRangeAsync(addArray);