From 42a3647a106afcaee2f074d243a2680f8b5af132 Mon Sep 17 00:00:00 2001 From: gwbvipvip Date: Mon, 15 Jul 2024 11:48:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=93=81=E5=88=86=E7=B1=BB=E6=9B=B4?= =?UTF-8?q?=E6=96=B0bug=E4=BF=AE=E5=A4=8D20240715?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DataBase/Services/GoodsTypeService.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/BPA.SAAS.Manage.Application/DataBase/Services/GoodsTypeService.cs b/BPA.SAAS.Manage.Application/DataBase/Services/GoodsTypeService.cs index d587611..a89237a 100644 --- a/BPA.SAAS.Manage.Application/DataBase/Services/GoodsTypeService.cs +++ b/BPA.SAAS.Manage.Application/DataBase/Services/GoodsTypeService.cs @@ -93,13 +93,13 @@ namespace BPA.SAAS.Manage.Application.DataBase.Services { try { - var old = await _db.Queryable().FirstAsync(t => t.Name == dto.Name); - if (old != null) - throw Oops.Oh($"已存在{dto.Name},添加失败!"); var res = 0; if (string.IsNullOrWhiteSpace(dto.Id)) { _db.Ado.BeginTran(); + var old = await _db.Queryable().FirstAsync(t => t.Name == dto.Name); + if (old != null) + throw Oops.Oh($"已存在{dto.Name},添加失败!"); var newType = new BPA_GoodsType { Pid = dto.Pid ?? "0",