From 1a860d5ef1946e8c9f6ffbf4681b8c934a294247 Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Wed, 25 May 2022 16:25:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=B2=97=E4=BD=8D=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E4=BF=AE=E6=94=B9=E6=97=B6=E7=BC=96=E5=8F=B7=E6=B2=A1?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E7=BC=BA=E6=8F=90=E7=A4=BA=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LR_OrganizationModule/Controllers/PostController.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Controllers/PostController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Controllers/PostController.cs index 840e39df2..59101844a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Controllers/PostController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Controllers/PostController.cs @@ -133,10 +133,15 @@ namespace Learun.Application.Web.Areas.LR_OrganizationModule.Controllers public ActionResult SaveForm(string keyValue, PostEntity entity) { var list = postIBLL.GetList(entity.F_CompanyId); - if (list.Any(a => a.F_EnCode == entity.F_EnCode)) + if (string.IsNullOrEmpty(keyValue) && list.Any(a => a.F_EnCode == entity.F_EnCode)) { - return Fail("岗位编号重复"); + return Fail("岗位编号重复!"); } + else if (!string.IsNullOrEmpty(keyValue) && list.Any(a => a.F_EnCode == entity.F_EnCode && a.F_PostId != keyValue)) + { + return Fail("岗位编号重复!"); + } + postIBLL.SaveEntity(keyValue, entity); return Success("保存成功!"); }