@@ -216,32 +216,32 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
{
var weektime = Convert.ToInt32(weekTime);
var lessonDate = GetLessonDate(weektime, Convert.ToInt32(entity.LessonTime.Split('-')[0]));
//2024-2-23修改删除
//var model =
// db.FindEntity<ArrangeLessonTermEntity>(x =>
// x.LessonDate == lessonDate && x.LessonTime == entity.LessonTime && x.ALTId == keyValue);
var model =
db.FindEntity<ArrangeLessonTermEntity>(x =>
x.LessonDate == lessonDate && x.LessonTime == entity.LessonTime);
if (model != null)
{
//更改课程表标记
model.CheckMark = "0";
model.Modify(keyValue);
db.Update(model);
//if (model != null)
//{
//新增修改记录表
ArgLessonTermUpdRecordEntity record = new ArgLessonTermUpdRecordEntity();
record.Create();
record.ALTId = model.ALTId;
record.LessonNoOld = model.LessonNo;
record.LessonNoNew = "";
record.EmpNoOld = model.EmpNo;
record.EmpNoNew = "";
record.ClassroomNoOld = model.ClassroomNo;
record.ClassroomNoNew = "";
record.Remark = "删除";
db.Insert(record);
}
//更改课程表标记
entity.CheckMark = "0";
entity.Modify(keyValue);
db.Update(entity);
//新增修改记录表
ArgLessonTermUpdRecordEntity record = new ArgLessonTermUpdRecordEntity();
record.Create();
record.ALTId = entity.ALTId;
record.LessonNoOld = entity.LessonNo;
record.LessonNoNew = "";
record.EmpNoOld = entity.EmpNo;
record.EmpNoNew = "";
record.ClassroomNoOld = entity.ClassroomNo;
record.ClassroomNoNew = "";
record.Remark = "删除";
db.Insert(record);
//}
}
db.Commit();
@@ -358,10 +358,10 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
// db.Update(entity);
//}
#endregion
var entity =
db.FindEntity<ArrangeLessonTermEntity>(x =>
x.LessonDate == lessonDate && x.LessonTime == LessonTimeOld);
//24-2-23 武鑫修改 entity 注释改为ArrangeLessonTerm
// var entity =
// db.FindEntity<ArrangeLessonTermEntity>(x =>
// x.LessonDate == lessonDate && x.LessonTime == LessonTimeOld);
//当前星期-节次
var lessiontimeNow = model.WeekSelect + "-" + model.NodeSelect;
if (LessonTimeOld_week == 0)
@@ -374,30 +374,30 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
var semesterAndYear = Common.GetSemesterAndYear(startDate);
var classInfo = db.FindEntity<ClassInfoEntity>(x => x.ClassNo == model.TeachClassNo);
entity = new ArrangeLessonTermEntity();
entity .Create();
entity .LessonDate = lessonDateNew;
entity .AcademicYearNo = semesterAndYear.AcademicYearShort;
entity .Semester = semesterAndYear.Semester;
entity .DeptNo = classInfo?.DeptNo;
entity .MajorNo = classInfo?.MajorNo;
entity .LessonNo = model.LessonNo;
entity .LessonName = model.LessonName;
entity .EmpNo = model.EmpNo;
entity .EmpName = model.EmpName;
entity .TeachClassNo = model.TeachClassNo;
entity .ClassroomNo = model.ClassroomNo;
entity .LessonTime = lessiontimeNow;
entity .CheckMark = "1";
entity .F_SchoolId = LoginUserInfo.Get().companyId;
db.Insert(entity );
ArrangeLessonTerm = new ArrangeLessonTermEntity();
ArrangeLessonTerm .Create();
ArrangeLessonTerm .LessonDate = lessonDateNew;
ArrangeLessonTerm .AcademicYearNo = semesterAndYear.AcademicYearShort;
ArrangeLessonTerm .Semester = semesterAndYear.Semester;
ArrangeLessonTerm .DeptNo = classInfo?.DeptNo;
ArrangeLessonTerm .MajorNo = classInfo?.MajorNo;
ArrangeLessonTerm .LessonNo = model.LessonNo;
ArrangeLessonTerm .LessonName = model.LessonName;
ArrangeLessonTerm .EmpNo = model.EmpNo;
ArrangeLessonTerm .EmpName = model.EmpName;
ArrangeLessonTerm .TeachClassNo = model.TeachClassNo;
ArrangeLessonTerm .ClassroomNo = model.ClassroomNo;
ArrangeLessonTerm .LessonTime = lessiontimeNow;
ArrangeLessonTerm .CheckMark = "1";
ArrangeLessonTerm .F_SchoolId = LoginUserInfo.Get().companyId;
db.Insert(ArrangeLessonTerm );
//新增修改记录表
ArgLessonTermUpdRecordEntity record = new ArgLessonTermUpdRecordEntity();
record.Create();
record.ALTId = entity .ALTId;
record.ALTId = ArrangeLessonTerm .ALTId;
record.LessonDateNew = lessonDateNew;
record.LessonNoOld = "";
record.LessonNoNew = model.LessonNo;
@@ -418,34 +418,33 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
{
return "第" + weektime + "周当前课程冲突!";
}
//新增修改记录表
ArgLessonTermUpdRecordEntity record = new ArgLessonTermUpdRecordEntity();
record.Create();
record.ALTId = entity.ALTId ;
record.LessonDateOld = entity .LessonDate;
record.ALTId = keyValue ;
record.LessonDateOld = ArrangeLessonTerm .LessonDate;
record.LessonDateNew = lessonDateNew;
record.LessonNoOld = entity .LessonNo;
record.LessonNoOld = ArrangeLessonTerm .LessonNo;
record.LessonNoNew = model.LessonNo;
record.EmpNoOld = entity .EmpNo;
record.EmpNoOld = ArrangeLessonTerm .EmpNo;
record.EmpNoNew = model.EmpNo;
record.ClassroomNoOld = entity .ClassroomNo;
record.ClassroomNoOld = ArrangeLessonTerm .ClassroomNo;
record.ClassroomNoNew = model.ClassroomNo;
record.LessonTimeOld = entity .LessonTime;
record.LessonTimeOld = ArrangeLessonTerm .LessonTime;
record.LessonTimeNew = lessiontimeNow;
record.Remark = "修改";
db.Insert(record);
//存在 修改
entity .LessonDate = lessonDateNew;
entity .TeachClassNo = model.TeachClassNo;
entity .LessonNo = model.LessonNo;
entity .LessonName = model.LessonName;
entity .EmpNo = model.EmpNo;
entity .EmpName = model.EmpName;
entity .ClassroomNo = model.ClassroomNo;
entity .LessonTime = lessiontimeNow;
db.Update(entity );
ArrangeLessonTerm .LessonDate = lessonDateNew;
ArrangeLessonTerm .TeachClassNo = model.TeachClassNo;
ArrangeLessonTerm .LessonNo = model.LessonNo;
ArrangeLessonTerm .LessonName = model.LessonName;
ArrangeLessonTerm .EmpNo = model.EmpNo;
ArrangeLessonTerm .EmpName = model.EmpName;
ArrangeLessonTerm .ClassroomNo = model.ClassroomNo;
ArrangeLessonTerm .LessonTime = lessiontimeNow;
db.Update(ArrangeLessonTerm );
}
}
@@ -491,7 +490,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
else
{
var start = Common.CalculateFirstDateOfWeek(schoolCalendar.StartTime.Value).AddDays((weektime - 1) * 14 );
var start = Common.CalculateFirstDateOfWeek(schoolCalendar.StartTime.Value).AddDays((weektime - 1) * 7 );
lessonDate = start.AddDays(WeekSelect - 1);
}