xiaochanghai 4 months ago
parent e892c1d126
commit fbf5447558
  1. 31
      Tiobon.Core.Services/Ghre/Ghre_ExamServices.cs

@ -1227,17 +1227,20 @@ public class Ghre_ExamServices : BaseServices<Ghre_Exam, Ghre_ExamDto, InsertGhr
{
#region 判断相关联课件是否存在
var sql = $@"SELECT count(0)
if (entity.IsRequireStudy == true)
{
var sql = $@"SELECT count(0)
FROM Ghre_CourseWare A
WHERE A.Id IN
(SELECT CourseWareId
FROM Ghre_Course
WHERE (Id = '{entity.CourseId}' OR CourseSceneId = '{entity.CourseSceneId}' OR CourseSceneIds like '%{entity.CourseSceneId}%') AND IsEnable = 1)";
var count = await Db.Ado.GetIntAsync(sql);
if (count == 0)
{
if (entity.LinkType == "CourseId")
return ServiceResult.OprateFailed("该考试关联的课程未维护课件,暂不可取消归档!");
var count = await Db.Ado.GetIntAsync(sql);
if (count == 0)
{
if (entity.LinkType == "CourseId")
return ServiceResult.OprateFailed("该考试关联的课程未维护课件,暂不可取消归档!");
}
}
#endregion
@ -1262,19 +1265,23 @@ public class Ghre_ExamServices : BaseServices<Ghre_Exam, Ghre_ExamDto, InsertGhr
{
#region 判断相关联课件是否存在
var sql = $@"SELECT count(0)
if (entity.IsRequireStudy == true)
{
var sql = $@"SELECT count(0)
FROM Ghre_CourseWare A
WHERE A.Id IN
(SELECT CourseWareId
FROM Ghre_Course
WHERE (Id = '{entity.CourseId}' OR CourseSceneId = '{entity.CourseSceneId}' OR CourseSceneIds like '%{entity.CourseSceneId}%') AND IsEnable = 1)";
var count = await Db.Ado.GetIntAsync(sql);
if (count == 0)
{
if (entity.LinkType == "CourseId")
return ServiceResult.OprateFailed("该考试关联的课程未维护课件,暂不可发布!");
var count = await Db.Ado.GetIntAsync(sql);
if (count == 0)
{
if (entity.LinkType == "CourseId")
return ServiceResult.OprateFailed("该考试关联的课程未维护课件,暂不可取消归档!");
}
}
#endregion
var ids1 = ids.Where(x => id != x).ToList();
if (entity.LinkType == DIC_EXAM_LINK_TYPE_COURSE)
{

Loading…
Cancel
Save