|
@@ -198,18 +198,19 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
/// <summary> |
|
|
/// <summary> |
|
|
/// 保存实体数据(新增、修改) |
|
|
|
|
|
/// </summary> |
|
|
|
|
|
/// <param name="keyValue">主键</param> |
|
|
|
|
|
/// <param name="entity">实体</param> |
|
|
|
|
|
public void SaveSaveDetailEntity(string ClassroomNo , string AcademicYearNo,int Semester,List<Exam_ExamRoomDetailEntity> entity) |
|
|
|
|
|
|
|
|
/// 保存实体数据(新增、修改) |
|
|
|
|
|
/// </summary> |
|
|
|
|
|
/// <param name="keyValue">主键</param> |
|
|
|
|
|
/// <param name="entity">实体</param> |
|
|
|
|
|
public void SaveSaveDetailEntity(string ClassroomNo, string AcademicYearNo, int Semester, List<Exam_ExamRoomDetailEntity> entity) |
|
|
{ |
|
|
{ |
|
|
var db = this.BaseRepository("CollegeMIS").BeginTrans(); |
|
|
var db = this.BaseRepository("CollegeMIS").BeginTrans(); |
|
|
try |
|
|
try |
|
|
{ |
|
|
{ |
|
|
var del = db.FindList<Exam_ExamRoomDetailEntity>(x=>x.ClassRoomNo== ClassroomNo&& x.AcademicYearNo== AcademicYearNo&& x.Semester== Semester); |
|
|
|
|
|
|
|
|
var del = db.FindList<Exam_ExamRoomDetailEntity>(x => x.ClassRoomNo == ClassroomNo && x.AcademicYearNo == AcademicYearNo && x.Semester == Semester); |
|
|
db.Delete(del); |
|
|
db.Delete(del); |
|
|
if (entity.Count()>0) |
|
|
|
|
|
|
|
|
List<Exam_ExamRoomDetailEntity> enList = new List<Exam_ExamRoomDetailEntity>(); |
|
|
|
|
|
if (entity.Count() > 0) |
|
|
{ |
|
|
{ |
|
|
entity.OrderBy(x => x.ECOrder); |
|
|
entity.OrderBy(x => x.ECOrder); |
|
|
for (int i = 0; i < entity.Count(); i++) |
|
|
for (int i = 0; i < entity.Count(); i++) |
|
@@ -218,9 +219,16 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration |
|
|
insertEntity.ClassRoomNo = entity[i].ClassRoomNo; |
|
|
insertEntity.ClassRoomNo = entity[i].ClassRoomNo; |
|
|
insertEntity.ClassRoomName = entity[i].ClassRoomName; |
|
|
insertEntity.ClassRoomName = entity[i].ClassRoomName; |
|
|
insertEntity.ECEnabled = entity[i].ECEnabled; |
|
|
insertEntity.ECEnabled = entity[i].ECEnabled; |
|
|
insertEntity.ECOrder = i+1; |
|
|
|
|
|
|
|
|
insertEntity.ECOrder = i + 1; |
|
|
|
|
|
insertEntity.Create(); |
|
|
|
|
|
enList.Add(insertEntity); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
db.Insert(enList); |
|
|
|
|
|
//修改实际考试人数 |
|
|
|
|
|
var Update = db.FindEntity<Exam_ExamRoomEntity>(x => x.ClassroomNo == ClassroomNo && x.AcademicYearNo == AcademicYearNo && x.Semester == Semester); |
|
|
|
|
|
Update.ActualNum = enList.Where(x => x.ECEnabled == true).Count(); |
|
|
|
|
|
db.Update(Update); |
|
|
db.Commit(); |
|
|
db.Commit(); |
|
|
} |
|
|
} |
|
|
catch (Exception ex) |
|
|
catch (Exception ex) |
|
|