Ver código fonte

选修课课程异动功能

临城职教中职
zhangli 2 anos atrás
committed by ndbs
pai
commit
499bcd8cb2
3 arquivos alterados com 63 adições e 6 exclusões
  1. +45
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/OpenLessonPlanOfElectiveController.cs
  2. +12
    -6
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/OpenLessonPlanOfElective/OpenLessonPlanOfElectiveService.cs
  3. +6
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/OpenLessonPlanOfElectiveChange/OpenLessonPlanOfElectiveChangeEntity.cs

+ 45
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/OpenLessonPlanOfElectiveController.cs Ver arquivo

@@ -5,6 +5,7 @@ using System.Web.Mvc;
using System.Collections.Generic;
using System;
using System.Linq;
using Learun.Application.Base.SystemModule;

namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
{
@@ -25,6 +26,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
CdMajorIBLL CdMajorIBLL = new CdMajorBLL();
private StuSelectLessonListOfElectivePreIBLL stuSelectLessonListOfElectivePreIBLL = new StuSelectLessonListOfElectivePreBLL();
private OpenLessonPlanOfElectiveChangeIBLL openLessonPlanOfElectiveChangeIBLL = new OpenLessonPlanOfElectiveChangeBLL();
private DataSourceIBLL dataSourceIBLL = new DataSourceBLL();

#region 视图功能

@@ -224,14 +226,57 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
if (!string.IsNullOrEmpty(entity.AfterLessonNo))
{
model.AfterLessonNo = entity.AfterLessonNo;
var lesson = dataSourceIBLL.GetDataTable("LessonInfo", "t.lessonno='" + entity.AfterLessonNo + "'");
if (lesson != null && lesson.Rows.Count > 0)
{
model.AfterLessonName = lesson.Rows[0]["lessonname"].ToString();
}
}
else
{
var lesson = dataSourceIBLL.GetDataTable("LessonInfo", "t.lessonno='" + entity.LessonNo + "'");
if (lesson != null && lesson.Rows.Count > 0)
{
model.AfterLessonName = lesson.Rows[0]["lessonname"].ToString();
}
}

if (!string.IsNullOrEmpty(entity.AfterEmpNo))
{
model.AfterEmpNo = entity.AfterEmpNo;

var emp = dataSourceIBLL.GetDataTable("EmpInfo", "t.empno='" + entity.AfterEmpNo + "'");
if (emp != null && emp.Rows.Count > 0)
{
model.AfterEmpName = emp.Rows[0]["empname"].ToString();
}
}
else
{
var emp = dataSourceIBLL.GetDataTable("EmpInfo", "t.empno='" + entity.EmpNo + "'");
if (emp != null && emp.Rows.Count > 0)
{
model.AfterEmpName = emp.Rows[0]["empname"].ToString();
}
}

if (!string.IsNullOrEmpty(entity.AfterClassRoomNo))
{
model.AfterClassRoomNo = entity.AfterClassRoomNo;

var classRoom = dataSourceIBLL.GetDataTable("ClassRoomInfo", "t.classroomno='" + entity.AfterClassRoomNo + "'");
if (classRoom != null && classRoom.Rows.Count > 0)
{
model.AfterClassRoomName = classRoom.Rows[0]["classroomname"].ToString();
}
}
else
{
var classRoom = dataSourceIBLL.GetDataTable("ClassRoomInfo", "t.classroomno='" + entity.ClassRoomNo + "'");
if (classRoom != null && classRoom.Rows.Count > 0)
{
model.AfterClassRoomName = classRoom.Rows[0]["classroomname"].ToString();
}
}

openLessonPlanOfElectiveChangeIBLL.SaveEntity("", model);


+ 12
- 6
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/OpenLessonPlanOfElective/OpenLessonPlanOfElectiveService.cs Ver arquivo

@@ -420,14 +420,20 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
var EmId = db.FindEntity<ElectiveMergeItemEntity>(x => x.OLPOEId == OLPEIdOne)?.EmId;
var OLPEIdTwo = db.FindEntity<ElectiveMergeItemEntity>(x => x.EmId == EmId && x.OLPOEId != OLPEIdOne).OLPOEId;
var lessonInfoEntity = db.FindEntity<LessonInfoEntity>(x => x.LessonNo == entity.AfterLessonNo);
//选修课开课计划
db.ExecuteBySql($"update OpenLessonPlanOfElective set LessonNo='{entity.AfterLessonNo}',LessonName='{entity.AfterLessonName}',EmpNo='{entity.AfterEmpNo}',EmpName='{entity.AfterEmpName}',ClassRoomNo='{entity.AfterClassRoomNo}',ClassRoomName='{entity.AfterClassRoomName}' where Id='{OLPEIdOne}' ");

db.ExecuteBySql($"update OpenLessonPlanOfElective set LessonNo='{entity.AfterLessonNo}',EmpNo='{entity.AfterEmpNo}',ClassRoomNo='{entity.AfterClassRoomNo}' where Id='{OLPEIdOne}' ");
db.ExecuteBySql($"update StuSelectLessonListOfElective set LessonNo='{entity.AfterLessonNo}',EmpNo='{entity.AfterEmpNo}',ClassRoomNo='{entity.AfterClassRoomNo}' where OLPEId='{OLPEIdOne}' ");
//学生选课表
db.ExecuteBySql($"update StuSelectLessonListOfElective set LessonNo='{entity.AfterLessonNo}',LessonName='{entity.AfterLessonName}',EmpNo='{entity.AfterEmpNo}',EmpName='{entity.AfterEmpName}',ClassRoomNo='{entity.AfterClassRoomNo}',ClassRoomName='{entity.AfterClassRoomName}' where OLPEId='{OLPEIdOne}' ");
db.ExecuteBySql($"update StuSelectLessonListOfElectivePre set LessonNo='{entity.AfterLessonNo}',EmpNo='{entity.AfterEmpNo}',ClassRoomNo='{entity.AfterClassRoomNo}' where OLPEId='{OLPEIdOne}' ");
db.ExecuteBySql($"update ElectiveMergeItem set EmpNo='{entity.AfterEmpNo}',ClassRoomNo='{entity.AfterClassRoomNo}' where EmId='{EmId}' ");
db.ExecuteBySql($"update ElectiveMerge set LessonId='{lessonInfoEntity?.LessonId}',LessonNo='{entity.AfterLessonNo}' where EMId='{EmId}' ");
db.ExecuteBySql($"update OpenLessonPlanOfElectiveDel set LessonNo='{entity.AfterLessonNo}',EmpNo='{entity.AfterEmpNo}',ClassRoomNo='{entity.AfterClassRoomNo}' where Id='{OLPEIdTwo}' ");
db.ExecuteBySql($"update ArrangeLessonTermOfElective set LessonNo='{entity.AfterLessonNo}',EmpNo='{entity.AfterEmpNo}',ClassRoomNo='{entity.AfterClassRoomNo}' where PaiKeId='{OLPEIdOne}' or PaiKeId='{OLPEIdTwo}' ");
//选修合班明细
db.ExecuteBySql($"update ElectiveMergeItem set EmpNo='{entity.AfterEmpNo}',EmpName='{entity.AfterEmpName}',ClassRoomNo='{entity.AfterClassRoomNo}',ClassRoomName='{entity.AfterClassRoomName}' where EmId='{EmId}' ");
//合班合并结果
db.ExecuteBySql($"update ElectiveMerge set LessonId='{lessonInfoEntity?.LessonId}',LessonNo='{entity.AfterLessonNo}',LessonName='{entity.AfterLessonName}' where EMId='{EmId}' ");
//合班异动数据记录
db.ExecuteBySql($"update OpenLessonPlanOfElectiveDel set LessonNo='{entity.AfterLessonNo}',LessonName='{entity.AfterLessonName}',EmpNo='{entity.AfterEmpNo}',EmpName='{entity.AfterEmpName}',ClassRoomNo='{entity.AfterClassRoomNo}',ClassRoomName='{entity.AfterClassRoomName}' where Id='{OLPEIdTwo}' ");
//选修课程表
db.ExecuteBySql($"update ArrangeLessonTermOfElective set LessonNo='{entity.AfterLessonNo}',LessonName='{entity.AfterLessonName}',EmpNo='{entity.AfterEmpNo}',EmpName='{entity.AfterEmpName}',ClassRoomNo='{entity.AfterClassRoomNo}',ClassRoomName='{entity.AfterClassRoomName}' where PaiKeId='{OLPEIdOne}' or PaiKeId='{OLPEIdTwo}' ");


db.Commit();


+ 6
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/OpenLessonPlanOfElectiveChange/OpenLessonPlanOfElectiveChangeEntity.cs Ver arquivo

@@ -107,6 +107,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
public string EmpNo { get; set; }
[NotMapped]
public string ClassRoomNo { get; set; }
[NotMapped]
public string AfterLessonName { get; set; }
[NotMapped]
public string AfterEmpName { get; set; }
[NotMapped]
public string AfterClassRoomName { get; set; }

#endregion
}


Carregando…
Cancelar
Salvar