Преглед изворни кода

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

长阳分支推送专用
ndbs пре 2 година
родитељ
комит
4c351c2078
1 измењених фајлова са 16 додато и 0 уклоњено
  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 Прегледај датотеку

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


Loading…
Откажи
Сачувај