|
|
@ -649,6 +649,14 @@ public class Ghre_ExamServices : BaseServices<Ghre_Exam, Ghre_ExamDto, InsertGhr |
|
|
|
|
|
|
|
|
|
|
|
sql = string.Format(sql, filter.menuName, App.User.ID, filter.langId); |
|
|
|
sql = string.Format(sql, filter.menuName, App.User.ID, filter.langId); |
|
|
|
var toolbars = DbAccess.QueryList<Toolbar>(sql); |
|
|
|
var toolbars = DbAccess.QueryList<Toolbar>(sql); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sql = $@"SELECT A.RoleId, B.RoleNo, B.RoleName
|
|
|
|
|
|
|
|
FROM Ghrs_UserRole A LEFT JOIN Ghrs_Role B ON A.RoleId = B.RoleId |
|
|
|
|
|
|
|
WHERE A.UserID = {App.User.ID} |
|
|
|
|
|
|
|
AND A.IsEnable = 1 |
|
|
|
|
|
|
|
AND B.IsEnable = 1 |
|
|
|
|
|
|
|
AND B.RoleNo LIKE 'TrainingExam%'";
|
|
|
|
|
|
|
|
var toolbarRoles = DbAccess.QueryList<ToolbarRole>(sql); |
|
|
|
#endregion |
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
|
|
data.ForEach(x => |
|
|
|
data.ForEach(x => |
|
|
@ -686,6 +694,17 @@ public class Ghre_ExamServices : BaseServices<Ghre_Exam, Ghre_ExamDto, InsertGhr |
|
|
|
x.canDelete = 0; |
|
|
|
x.canDelete = 0; |
|
|
|
if (!toolbars.Any(x => x.fnKey == "DetailYN")) |
|
|
|
if (!toolbars.Any(x => x.fnKey == "DetailYN")) |
|
|
|
x.canDetail = 0; |
|
|
|
x.canDetail = 0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!toolbarRoles.Any(x => x.RoleNo == "TrainingExamCopy")) |
|
|
|
|
|
|
|
x.canCopy = 0; |
|
|
|
|
|
|
|
if (!toolbarRoles.Any(x => x.RoleNo == "TrainingExamPreview")) |
|
|
|
|
|
|
|
x.canPreview = 0; |
|
|
|
|
|
|
|
if (!toolbarRoles.Any(x => x.RoleNo == "TrainingExamLink")) |
|
|
|
|
|
|
|
x.showLink = 0; |
|
|
|
|
|
|
|
if (!toolbarRoles.Any(x => x.RoleNo == "TrainingExamGrade")) |
|
|
|
|
|
|
|
x.showResult = 0; |
|
|
|
|
|
|
|
if (!toolbarRoles.Any(x => x.RoleNo == "TrainingExamArchive")) |
|
|
|
|
|
|
|
x.canClose = 0; |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
return new ServicePageResult<Ghre_ExamDto>(filter.pageNum, totalCount, filter.pageSize, data); |
|
|
|
return new ServicePageResult<Ghre_ExamDto>(filter.pageNum, totalCount, filter.pageSize, data); |
|
|
@ -1040,6 +1059,16 @@ public class Ghre_ExamServices : BaseServices<Ghre_Exam, Ghre_ExamDto, InsertGhr |
|
|
|
|
|
|
|
|
|
|
|
public async Task<ServiceResult> GetStatus(long id) |
|
|
|
public async Task<ServiceResult> GetStatus(long id) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
string sql = $@"SELECT A.RoleId, B.RoleNo, B.RoleName
|
|
|
|
|
|
|
|
FROM Ghrs_UserRole A LEFT JOIN Ghrs_Role B ON A.RoleId = B.RoleId |
|
|
|
|
|
|
|
WHERE A.UserID = {App.User.ID} |
|
|
|
|
|
|
|
AND A.IsEnable = 1 |
|
|
|
|
|
|
|
AND B.IsEnable = 1 |
|
|
|
|
|
|
|
AND B.RoleNo ='TrainingExamCancelRelease'";
|
|
|
|
|
|
|
|
var toolbarRoles = DbAccess.QueryList<ToolbarRole>(sql); |
|
|
|
|
|
|
|
if (!toolbarRoles.Any()) |
|
|
|
|
|
|
|
return ServiceResult.OprateFailed("暂无取消发布权限!"); |
|
|
|
|
|
|
|
|
|
|
|
if (await _ghre_ExamRecordServices.AnyAsync(x => x.ExamId == id)) |
|
|
|
if (await _ghre_ExamRecordServices.AnyAsync(x => x.ExamId == id)) |
|
|
|
return ServiceResult.OprateFailed("已有学员参与考试,不可取消发布!"); |
|
|
|
return ServiceResult.OprateFailed("已有学员参与考试,不可取消发布!"); |
|
|
|
|
|
|
|
|
|
|
|