@@ -886,6 +886,8 @@ where AcademicYearNo='" + strAcademicYear + "' and Semester='" + strSemester + "
this.BaseRepository("CollegeMIS").ExecuteBySql("delete from StuSelectLessonList where AcademicYearNo='" + academicYearNo + "' and Semester='" + semester + "' and ClassNo='" + classNo + "' ");
this.BaseRepository("CollegeMIS").ExecuteBySql("delete from StuSelectLessonList where AcademicYearNo='" + academicYearNo + "' and Semester='" + semester + "' and ClassNo='" + classNo + "' ");
//清空StuScore
//清空StuScore
this.BaseRepository("CollegeMIS").ExecuteBySql("delete from StuScore where AcademicYearNo='" + academicYearNo + "' and Semester='" + semester + "' and ClassNo='" + classNo + "' and LessonSortNo='1' ");
this.BaseRepository("CollegeMIS").ExecuteBySql("delete from StuScore where AcademicYearNo='" + academicYearNo + "' and Semester='" + semester + "' and ClassNo='" + classNo + "' and LessonSortNo='1' ");
//清空成绩单
this.BaseRepository("CollegeMIS").ExecuteBySql("delete from EmpReportCard where AcademicYearNo='" + academicYearNo + "' and Semester='" + semester + "' and ClassNo='" + classNo + "' and LessonSortNo='1' ");
//重置StuSelectLessonList
//重置StuSelectLessonList
var lessonData = this.BaseRepository("CollegeMIS").FindList<LessonInfoEntity>();
var lessonData = this.BaseRepository("CollegeMIS").FindList<LessonInfoEntity>();
strSql.Append(@"insert into stuscore(NoticeBookNo,StuNo,DeptNo,MajorNo,ClassNo,StuName,GenderNo,AcademicYearNo,Semester,OpenLessonDeptNo,OpenLessonMajorNo,LessonNo,LessonName,LessonNameEn,TeachClassNo,LessonSortNo,StuSortNo,Grade,StudyScore,TotalStudyHour,OrdinaryScore,TermInScore,TermEndScore,OtherScore,IsInEffect,Remark,ConflictLessonNo,IsPitchOn,CheckMark,TechPlanNo,EmpNo,PartCode,ScoreRecordStyleNo,TestModeNo,zysx,TestKindNo,IsEditable)
select NoticeBookNo,StuNo,DeptNo,MajorNo,ClassNo,StuName,GenderNo,AcademicYearNo,Semester,OpenLessonDeptNo,OpenLessonMajorNo,LessonNo,LessonName,LessonNameEng as LessionNameEn,TeachClassNo,LessonSortNo,StuSortNo,Grade,StudyScore,TotalStudyHour,'0','0','0','0',IsInEffect,Remark,ConflictLessonNo,IsPitchOn,CheckMark,TeachPlanNo as TechPlanNo,EmpNo,PartCode,ScoreRecordStyleNo,TestModeNo,zysx=1,TestKindNo=1,IsEditable=1 from
string sql = @"insert into stuscore(NoticeBookNo,StuNo,DeptNo,MajorNo,ClassNo,StuName,GenderNo,AcademicYearNo,Semester,OpenLessonDeptNo,OpenLessonMajorNo,LessonNo,LessonName,LessonNameEn,TeachClassNo,LessonSortNo,StuSortNo,Grade,StudyScore,TotalStudyHour,OrdinaryScore,TermInScore,TermEndScore,OtherScore,IsInEffect,Remark,ConflictLessonNo,IsPitchOn,CheckMark,TechPlanNo,EmpNo,PartCode,ScoreRecordStyleNo,TestModeNo,zysx,TestKindNo,IsEditable,F_SchoolId)
select NoticeBookNo,StuNo,DeptNo,MajorNo,ClassNo,StuName,GenderNo,AcademicYearNo,Semester,OpenLessonDeptNo,OpenLessonMajorNo,LessonNo,LessonName,LessonNameEng as LessionNameEn,TeachClassNo,LessonSortNo,StuSortNo,Grade,StudyScore,TotalStudyHour,'0','0','0','0',IsInEffect,Remark,ConflictLessonNo,IsPitchOn,0,TeachPlanNo as TechPlanNo,EmpNo,PartCode,ScoreRecordStyleNo,TestModeNo,zysx=1,TestKindNo=1,IsEditable=1,F_SchoolId from
left join OpenLessonPlan o on s.AcademicYearNo=o.AcademicYearNo and s.Semester=o.Semester and s.LessonNo=o.LessonNo
and s.PartCode=o.PartCode and s.OpenLessonMajorNo=o.MajorNo
left join OpenLessonPlan o on s.AcademicYearNo=o.AcademicYearNo and s.Semester=o.Semester and s.LessonNo=o.LessonNo and s.PartCode=o.PartCode and s.OpenLessonMajorNo=o.MajorNo and s.Grade=o.Grade
left join CdScoreRecordStyle cs on o.ScoreRecordStyleNo=cs.ScoreRecordStyleNo
left join CdScoreRecordStyle cs on o.ScoreRecordStyleNo=cs.ScoreRecordStyleNo
left join BCdTestMode bc on o.CheckStyleNo=bc.TestModeNo
where s.AcademicYearNo='" + academicYearNo + "' and s.Semester='" + semester + "' and s.TeachClassNo='" + classNo + @"' and s.LessonSortNo='1'
left join BCdTestMode bc on o.CheckStyleNo=bc.TestModeNo
where s.CheckMark='1'
) as sl
) as sl
where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Academicyearno
and s.Semester = sl.Semester and s.lessonno = sl.lessonno and s.teachclassno = sl.teachclassno and s.LessonSortNo = '1') ");
select NEWID(),LessonNo,LessonName,ClassNo,ClassName,EmpNo,EmpName,AcademicYearNo,Semester,LessonSortNo,GETDATE(),0,null,0,null from
(
select distinct s.LessonNo,s.LessonName,s.TeachClassNo as ClassNo,c.ClassName,s.EmpNo,e.EmpName,s.AcademicYearNo,s.Semester,s.LessonSortNo
from stuscore s
left join classinfo c on s.teachclassno=c.classno
left join empinfo e on s.empno=e.empno
where s.lessonsortno='1'
) as bb
where bb.EmpNo not in
(select a.EmpNo from EmpReportCard a where a.AcademicYearNo=bb.AcademicYearNo and a.Semester=bb.Semester and a.LessonNo=bb.LessonNo and a.ClassNo=bb.ClassNo and a.LessonSortNo=bb.LessonSortNo and a.LessonSortNo='1'
and a.Academicyearno='" + academicYearNo + "' and a.Semester='" + semester + "') and bb.AcademicYearNo='" + academicYearNo + "' and bb.Semester='" + semester + "' order by bb.EmpNo";