|
@@ -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; |
|
|