Pārlūkot izejas kodu

教师用户管理,启用禁用关联用户表

长阳分支推送专用
ndbs pirms 2 gadiem
vecāks
revīzija
4c351c2078
1 mainītis faili ar 16 papildinājumiem un 0 dzēšanām
  1. +16
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/EmpInfo/EmpInfoService.cs

+ 16
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/EmpInfo/EmpInfoService.cs Parādīt failu

@@ -556,6 +556,7 @@ sum(case when DATEDIFF(YYYY, t.Birthday, GETDATE()) > 20 and DATEDIFF(YYYY, t.Bi
public void Lock(string keyValue) public void Lock(string keyValue)
{ {
var db = this.BaseRepository("CollegeMIS").BeginTrans(); var db = this.BaseRepository("CollegeMIS").BeginTrans();
var db1 = this.BaseRepository().BeginTrans();
try try
{ {
//单个启用 //单个启用
@@ -566,12 +567,19 @@ sum(case when DATEDIFF(YYYY, t.Birthday, GETDATE()) > 20 and DATEDIFF(YYYY, t.Bi
foreach (var item in keyValueArr) foreach (var item in keyValueArr)
{ {
db.ExecuteBySql("update EmpInfo set CheckMark=1 where EmpId='" + item + "'"); db.ExecuteBySql("update EmpInfo set CheckMark=1 where EmpId='" + item + "'");
var code = db.FindEntity<EmpInfoEntity>(item).EmpNo;
if (!code.IsEmpty())
{
db1.ExecuteBySql("update LR_Base_User set F_EnabledMark=1 where F_EnCode='" + code + "'");
}
} }
db.Commit(); db.Commit();
db1.Commit();
} }
catch (Exception ex) catch (Exception ex)
{ {
db.Rollback(); db.Rollback();
db1.Rollback();
if (ex is ExceptionEx) if (ex is ExceptionEx)
{ {
throw; throw;
@@ -586,6 +594,7 @@ sum(case when DATEDIFF(YYYY, t.Birthday, GETDATE()) > 20 and DATEDIFF(YYYY, t.Bi
public void UnLock(string keyValue) public void UnLock(string keyValue)
{ {
var db = this.BaseRepository("CollegeMIS").BeginTrans(); var db = this.BaseRepository("CollegeMIS").BeginTrans();
var db1 = this.BaseRepository().BeginTrans();
try try
{ {
//单个停用 //单个停用
@@ -596,12 +605,19 @@ sum(case when DATEDIFF(YYYY, t.Birthday, GETDATE()) > 20 and DATEDIFF(YYYY, t.Bi
foreach (var item in keyValueArr) foreach (var item in keyValueArr)
{ {
db.ExecuteBySql("update EmpInfo set CheckMark=0 where EmpId='" + item + "'"); db.ExecuteBySql("update EmpInfo set CheckMark=0 where EmpId='" + item + "'");
var code = db.FindEntity<EmpInfoEntity>(item).EmpNo;
if (!code.IsEmpty())
{
db1.ExecuteBySql("update LR_Base_User set F_EnabledMark=0 where F_EnCode='" + code + "'");
}
} }
db.Commit(); db.Commit();
db1.Commit();
} }
catch (Exception ex) catch (Exception ex)
{ {
db.Rollback(); db.Rollback();
db1.Rollback();
if (ex is ExceptionEx) if (ex is ExceptionEx)
{ {
throw; throw;


Notiek ielāde…
Atcelt
Saglabāt