Browse Source

选修课程删除

新疆影视学院高职
zhangli 2 years ago
parent
commit
212cefc326
2 changed files with 27 additions and 4 deletions
  1. +0
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/MergeIndex.js
  2. +27
    -3
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/OpenLessonPlanOfElective/OpenLessonPlanOfElectiveService.cs

+ 0
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/MergeIndex.js View File

@@ -263,7 +263,6 @@ var bootstrap = function ($, learun) {
}
});
console.log(keyValue);
return;
learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/DeleteElective', { keyValue: keyValue },
function () {
refreshGirdData();


+ 27
- 3
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/OpenLessonPlanOfElective/OpenLessonPlanOfElectiveService.cs View File

@@ -407,8 +407,10 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// <param name="keyValue"></param>
public void DeleteElective(string keyValue)
{
var db = this.BaseRepository("CollegeMIS");
try
{
db.BeginTrans();
/*
* ElectiveMajor
[dbo].[OpenLessonPlanOfElective]
@@ -421,16 +423,38 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
keyValue = string.Join("','", keyValue.Split(','));
}

var list = this.BaseRepository("CollegeMIS").FindList<OpenLessonPlanOfElectiveEntity>($"select * from OpenLessonPlanOfElective where Id in ('{keyValue}')");
var list = db.FindList<OpenLessonPlanOfElectiveEntity>($"select * from OpenLessonPlanOfElective where Id in ('{keyValue}')");
foreach (var entity in list)
{

var lessonSectionArr = entity.LessonSection.Split(',');
var lessonTimeArr = entity.LessonTime.Split(',');
//选修课课程异动
db.ExecuteBySql($"delete from OpenLessonPlanOfElectiveChange where OLPEId='{entity.Id}'");
for (int i = 0; i < lessonSectionArr.Length; i++)
{
//合班历史记录
db.ExecuteBySql(
$@"delete from OpenLessonPlanOfElectiveDel where AcademicYearNo='{entity.AcademicYearNo}' and Semester='{entity.Semester}' and LessonNo='{entity.LessonNo}'
and empno = '{entity.EmpNo}' and ClassRoomNo = '{entity.ClassRoomNo}'
and LessonTime = '{lessonTimeArr[i]}' and LessonSection = '{lessonSectionArr[i]}'");
//选修课排课
db.ExecuteBySql(
$@"delete from ArrangeLessonTermOfElective where AcademicYearNo='{entity.AcademicYearNo}' and Semester='{entity.Semester}' and LessonNo='{entity.LessonNo}'
and empno = '{entity.EmpNo}' and ClassRoomNo = '{entity.ClassRoomNo}'
and LessonTime = '{lessonTimeArr[i]}' and LessonSection = '{lessonSectionArr[i]}'");
}
//选课专业
db.ExecuteBySql($"delete from ElectiveMajor where OLPEId='{entity.Id}'");
//删除选修课课程表
db.ExecuteBySql($"delete from OpenLessonPlanOfElective where Id='{entity.Id}'");
}

db.Commit();

}
catch (Exception ex)
{
db.Rollback();
if (ex is ExceptionEx)
{
throw;


Loading…
Cancel
Save