@@ -118,6 +118,8 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
} | |||
entity.State = 0; | |||
entity.IsAllowEdit = true; | |||
entity.LessonSortNo = "1"; | |||
entity.CheckMark = "1"; | |||
entity.MakeDate = DateTime.Now; | |||
var model = classPlanIBLL.GetRepetitions(entity.F_SchoolId, entity.AcademicYearNo, entity.Semester, entity.MajorNo, entity.Grade, entity.LessonNo); | |||
if (model != null) | |||
@@ -144,27 +146,29 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
public ActionResult CourseArranging(string keyValue) | |||
{ | |||
var entity = classPlanIBLL.GetListById(keyValue); | |||
List<TeachClassEntity> TeachList = new List<TeachClassEntity>(); | |||
for (int i = 0; i < entity.Count; i++) | |||
{ | |||
var lessonList = classInfoIBLL.GetAllClass(). | |||
var classList = classInfoIBLL.GetAllClass(). | |||
Where(x => x.MajorNo == entity[i].MajorNo && x.Grade == entity[i].Grade) | |||
.OrderBy(x => x.ClassNo).Select(x => x.ClassNo).ToList(); | |||
if (lessonList.Count > 0) | |||
.OrderBy(x => x.ClassNo).Select(stringClass => new { stringClass.ClassNo, stringClass.ClassName }).ToList(); | |||
if (classList.Count > 0) | |||
{ | |||
for (int j = 0; j < lessonList.Count; j++) | |||
for (int j = 0; j < classList.Count; j++) | |||
{ | |||
TeachClassEntity TeachEntity = new TeachClassEntity(); | |||
TeachEntity.TeachClassNo = lessonList[j]; | |||
TeachEntity.AcademicYearNo = entity[i].AcademicYearNo; | |||
TeachEntity.MajorNo = entity[i].MajorNo; | |||
TeachEntity.Grade = entity[i].Grade; | |||
TeachEntity.Semester = entity[i].Semester; | |||
TeachEntity.LessonNo = entity[i].LessonNo; | |||
TeachEntity.StuNum = entity[i].StuNum; | |||
TeachEntity.LessonSortNo = entity[i].LessonSortNo; | |||
TeachEntity.F_SchoolId = entity[i].F_SchoolId; | |||
TeachClassEntity TeachEntity = new TeachClassEntity | |||
{ | |||
TeachClassNo = classList[j].ClassNo, | |||
AcademicYearNo = entity[i].AcademicYearNo | |||
MajorNo = entity[i].MajorNo, | |||
Grade = entity[i].Grade, | |||
Semester = entity[i].Semester, | |||
LessonNo = entity[i].LessonNo, | |||
StuNum = entity[i].StuNum, | |||
LessonSortNo = entity[i].LessonSortNo, | |||
F_SchoolId = entity[i].F_SchoolId | |||
}; | |||
TeachList.Add(TeachEntity); | |||
} | |||
} | |||
@@ -22,6 +22,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
private TeachClassIBLL teachClassIBLL = new TeachClassBLL(); | |||
private StuSelectLessonListIBLL StuSelectLesson = new StuSelectLessonListBLL(); | |||
private StuInfoBasicIBLL stuInfoBasicIBLL = new StuInfoBasicBLL(); | |||
private LessonInfoIBLL lessonInfoIBLL = new LessonInfoBLL(); | |||
#region 视图功能 | |||
@@ -142,48 +143,50 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
public ActionResult SetTeach(string keyValue, string EmpNo) | |||
{ | |||
var entityList = teachClassIBLL.GetTeachListById(keyValue); | |||
var lessonData = lessonInfoIBLL.GetAllLesson(); | |||
List<StuSelectLessonListEntity> TeachList = new List<StuSelectLessonListEntity>(); | |||
for (int i = 0; i < entityList.Count; i++) | |||
{ | |||
var stuDataList = stuInfoBasicIBLL.GetAllList().Where(s => | |||
s.MajorNo == entityList[i].MajorNo | |||
&& s.F_SchoolId == entityList[i].F_SchoolId | |||
&& s.ClassNo == entityList[i].TeachClassNo | |||
var stuDataList = stuInfoBasicIBLL.GetAllList().Where( | |||
s => s.DeptNo == entityList[i].DeptNo && s.MajorNo == entityList[i].MajorNo | |||
&& s.F_SchoolId == entityList[i].F_SchoolId && s.ClassNo == entityList[i].TeachClassNo | |||
).ToList(); | |||
if (stuDataList.Count > 0) | |||
{ | |||
for (int j = 0; j < stuDataList.Count; j++) | |||
{ | |||
StuSelectLessonListEntity TeachEntity = new StuSelectLessonListEntity(); | |||
TeachEntity.NoticeBookNo = stuDataList[j].StuNo; | |||
TeachEntity.StuNo = stuDataList[j].StuNo; | |||
TeachEntity.DeptNo = entityList[i].DeptNo; | |||
TeachEntity.MajorNo = entityList[i].MajorNo; | |||
TeachEntity.ClassNo = stuDataList[j].ClassNo; | |||
TeachEntity.GenderNo = stuDataList[j].GenderNo == true ? "0" : "1"; | |||
TeachEntity.MajorDetailNo = entityList[i].MajorDetailNo; | |||
TeachEntity.MajorDetailName = entityList[i].MajorDetailName; | |||
TeachEntity.StuName = stuDataList[j].StuName; | |||
TeachEntity.GenderNo = Convert.ToInt32(stuDataList[j].GenderNo).ToString(); | |||
TeachEntity.AcademicYearNo = entityList[i].AcademicYearNo; | |||
TeachEntity.Semester = entityList[i].Semester; | |||
TeachEntity.OpenLessonDeptNo = entityList[i].DeptNo; | |||
TeachEntity.OpenLessonMajorNo = entityList[i].MajorNo; | |||
TeachEntity.LessonNo = entityList[i].LessonNo; | |||
TeachEntity.PartCode = entityList[i].PartCode; | |||
TeachEntity.LessonName = lessonData.FirstOrDefault(m => m.LessonNo == TeachEntity.LessonNo)?.LessonName; | |||
TeachEntity.PartCode = ""; | |||
TeachEntity.OrdinaryScoreScale = 0; | |||
TeachEntity.TermInScoreScale = 0; | |||
TeachEntity.TermEndScoreScale = 0; | |||
TeachEntity.OtherScoreScale = 0; | |||
TeachEntity.TeachClassNo = entityList[i].TeachClassNo; | |||
TeachEntity.LessonSortNo = entityList[i].LessonSortNo; | |||
TeachEntity.StuSortNo = entityList[i].LessonSortNo; | |||
TeachEntity.StuSortNo = "02"; | |||
TeachEntity.Grade = entityList[i].Grade; | |||
TeachEntity.StudyScore = 2; | |||
TeachEntity.TotalStudyHour = 2; | |||
TeachEntity.StudyScore = 0; | |||
TeachEntity.TotalStudyHour = 0; | |||
TeachEntity.IsInEffect = "1"; | |||
TeachEntity.IsPitchOn = "1"; | |||
TeachEntity.EmpNo = EmpNo; | |||
TeachEntity.F_SchoolId = entityList[i].F_SchoolId; | |||
TeachEntity.CheckMark = "1"; | |||
TeachEntity.InsertTime = DateTime.Now; | |||
TeachList.Add(TeachEntity); | |||
} | |||
} | |||
else | |||
@@ -211,7 +214,6 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
&& y.F_SchoolId == entityList[i].F_SchoolId | |||
&& y.ClassNo == entityList[i].TeachClassNo | |||
&& y.LessonNo == entityList[i].LessonNo | |||
&& y.CheckMark == "1" | |||
).Select(x => x.SelectId.ToString()).ToList(); | |||
Nid += string.Join(",", ssList) + ","; | |||
} | |||
@@ -266,18 +266,28 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
foreach (var item in List) | |||
{ | |||
TeachClassEntity Teach = new TeachClassEntity(); | |||
Teach.TeachClassNo = item.TeachClassNo; | |||
Teach.AcademicYearNo = item.AcademicYearNo; | |||
Teach.DeptNo = item.DeptNo; | |||
Teach.MajorNo = item.MajorNo; | |||
Teach.Grade = item.Grade; | |||
Teach.Semester = item.Semester; | |||
Teach.LessonNo = item.LessonNo; | |||
Teach.StuNum = item.StuNum; | |||
Teach.LessonSortNo = item.LessonSortNo; | |||
Teach.F_SchoolId = item.F_SchoolId; | |||
db.Insert(Teach); | |||
TeachClassEntity Teach = new TeachClassEntity | |||
{ | |||
TeachClassNo = item.TeachClassNo, | |||
AcademicYearNo = item.AcademicYearNo, | |||
DeptNo = item.DeptNo, | |||
MajorNo = item.MajorNo, | |||
Grade = item.Grade, | |||
EmpNo = item.EmpNo, | |||
Semester = item.Semester, | |||
LessonNo = item.LessonNo, | |||
StuNum = item.StuNum, | |||
LessonSortNo = item.LessonSortNo, | |||
F_SchoolId = item.F_SchoolId | |||
}; | |||
if (db.FindEntity<TeachClassEntity>( | |||
x => x.F_SchoolId == Teach.F_SchoolId && x.AcademicYearNo == Teach.AcademicYearNo | |||
&& x.Semester == Teach.Semester && x.DeptNo == Teach.DeptNo | |||
&& x.MajorNo == Teach.MajorNo && x.TeachClassNo == Teach.TeachClassNo | |||
&& x.Grade == Teach.Grade && x.LessonNo == Teach.LessonNo) == null) | |||
{ | |||
db.Insert(Teach); | |||
} | |||
} | |||
db.Commit(); | |||
} | |||