From 4c351c207825ac822d3530d4e965efd11c4ba98a Mon Sep 17 00:00:00 2001 From: ndbs Date: Thu, 3 Nov 2022 18:01:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=99=E5=B8=88=E7=94=A8=E6=88=B7=E7=AE=A1?= =?UTF-8?q?=E7=90=86,=E5=90=AF=E7=94=A8=E7=A6=81=E7=94=A8=E5=85=B3?= =?UTF-8?q?=E8=81=94=E7=94=A8=E6=88=B7=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EmpInfo/EmpInfoService.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/EmpInfo/EmpInfoService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/EmpInfo/EmpInfoService.cs index d6bb386f9..73dfa3077 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/EmpInfo/EmpInfoService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/EmpInfo/EmpInfoService.cs @@ -556,6 +556,7 @@ sum(case when DATEDIFF(YYYY, t.Birthday, GETDATE()) > 20 and DATEDIFF(YYYY, t.Bi public void Lock(string keyValue) { var db = this.BaseRepository("CollegeMIS").BeginTrans(); + var db1 = this.BaseRepository().BeginTrans(); try { //单个启用 @@ -566,12 +567,19 @@ sum(case when DATEDIFF(YYYY, t.Birthday, GETDATE()) > 20 and DATEDIFF(YYYY, t.Bi foreach (var item in keyValueArr) { db.ExecuteBySql("update EmpInfo set CheckMark=1 where EmpId='" + item + "'"); + var code = db.FindEntity(item).EmpNo; + if (!code.IsEmpty()) + { + db1.ExecuteBySql("update LR_Base_User set F_EnabledMark=1 where F_EnCode='" + code + "'"); + } } db.Commit(); + db1.Commit(); } catch (Exception ex) { db.Rollback(); + db1.Rollback(); if (ex is ExceptionEx) { throw; @@ -586,6 +594,7 @@ sum(case when DATEDIFF(YYYY, t.Birthday, GETDATE()) > 20 and DATEDIFF(YYYY, t.Bi public void UnLock(string keyValue) { var db = this.BaseRepository("CollegeMIS").BeginTrans(); + var db1 = this.BaseRepository().BeginTrans(); try { //单个停用 @@ -596,12 +605,19 @@ sum(case when DATEDIFF(YYYY, t.Birthday, GETDATE()) > 20 and DATEDIFF(YYYY, t.Bi foreach (var item in keyValueArr) { db.ExecuteBySql("update EmpInfo set CheckMark=0 where EmpId='" + item + "'"); + var code = db.FindEntity(item).EmpNo; + if (!code.IsEmpty()) + { + db1.ExecuteBySql("update LR_Base_User set F_EnabledMark=0 where F_EnCode='" + code + "'"); + } } db.Commit(); + db1.Commit(); } catch (Exception ex) { db.Rollback(); + db1.Rollback(); if (ex is ExceptionEx) { throw;