|
|
@@ -50,10 +50,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration |
|
|
|
} |
|
|
|
if (!queryParam["LessonName"].IsEmpty()) |
|
|
|
{ |
|
|
|
dp.Add("LessonName", "%" + queryParam["LessonName"].ToString() + "%", DbType.String); |
|
|
|
strSql.Append(" AND a.LessonName Like @LessonName "); |
|
|
|
dp.Add("LessonName", "" + queryParam["LessonName"].ToString() + "", DbType.String); |
|
|
|
strSql.Append(" AND a.LessonNo = @LessonName "); |
|
|
|
|
|
|
|
} |
|
|
|
return this.BaseRepository("CollegeMIS").FindList<ElectiveMergeEntity>(strSql.ToString(), dp); |
|
|
|
return this.BaseRepository("CollegeMIS").FindList<ElectiveMergeEntity>(strSql.ToString(), dp, pagination); |
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
|
{ |
|
|
@@ -81,7 +82,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration |
|
|
|
var stumax = this.BaseRepository("CollegeMIS").FindObject(@"select distinct isnull(c.StuNumMax,0) from ElectiveMerge a left join |
|
|
|
ElectiveMergeItem b |
|
|
|
on a.EMId = b.EmId left join OpenLessonPlanOfElective c |
|
|
|
on b.OLPOEId = c.Id where a.EMId = '"+keyValue+"'"); |
|
|
|
on b.OLPOEId = c.Id where a.EMId = '" + keyValue + "'"); |
|
|
|
ementity.StuNumMax = Convert.ToInt32(stumax); |
|
|
|
return ementity; |
|
|
|
} |
|
|
@@ -113,9 +114,9 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration |
|
|
|
try |
|
|
|
{ |
|
|
|
db.BeginTrans(); |
|
|
|
var deldatalist = db.FindList<ElectiveMergeItemEntity>(m => m.EmId == keyValue).OrderBy(m=>Convert.ToInt32(m.LessonSection)); |
|
|
|
var deldatalist = db.FindList<ElectiveMergeItemEntity>(m => m.EmId == keyValue).OrderBy(m => Convert.ToInt32(m.LessonSection)); |
|
|
|
var deldatafirst = deldatalist.First(); |
|
|
|
var deldatalast= deldatalist.Last(); |
|
|
|
var deldatalast = deldatalist.Last(); |
|
|
|
var opfirst = db.FindEntity<OpenLessonPlanOfElectiveEntity>(m => m.Id == deldatafirst.OLPOEId); |
|
|
|
opfirst.LessonSection = deldatafirst.LessonSection; |
|
|
|
opfirst.LessonTime = deldatafirst.LessonTime; |
|
|
@@ -160,17 +161,17 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration |
|
|
|
db.BeginTrans(); |
|
|
|
db.Insert(entity); |
|
|
|
db.Insert(electiveMergeItemEntity); |
|
|
|
var ids =string.Join(",",electiveMergeItemEntity.Select(n => n.OLPOEId)); |
|
|
|
var ids = string.Join(",", electiveMergeItemEntity.Select(n => n.OLPOEId)); |
|
|
|
var olplist = db.FindList<OpenLessonPlanOfElectiveEntity>(m => |
|
|
|
ids.Contains(m.Id)).OrderBy(c=>Convert.ToInt32(c.LessonSection)); |
|
|
|
ids.Contains(m.Id)).OrderBy(c => Convert.ToInt32(c.LessonSection)); |
|
|
|
var opfirst = olplist.First(); |
|
|
|
var oplast = olplist.Last(); |
|
|
|
opfirst.LessonSection +=","+ oplast.LessonSection; |
|
|
|
opfirst.LessonSection += "," + oplast.LessonSection; |
|
|
|
opfirst.LessonTime += "," + oplast.LessonTime; |
|
|
|
db.Update(opfirst); |
|
|
|
db.ExecuteBySql($@"insert into OpenLessonPlanOfElectiveDel(Id, MakeDate, AcademicYearNo, Semester, LessonNo, PartCode, LessonName, LessonSortNo, LessonSortDetailNo, LessonSection, LessonTime, StudyScore, StartWeek, EndWeek, StartDate, EndDate, CheckStyleNo, ScoreRecordStyleNo, EmpNo, EmpName, ClassRoomNo, ClassRoomName, CheckMark, StuNumMax, StuNum, ModifyTime, ModifyUserId, ModifyUserName, F_SchoolId ) |
|
|
|
select Id, MakeDate, AcademicYearNo, Semester, LessonNo, PartCode, LessonName, LessonSortNo, LessonSortDetailNo, LessonSection, LessonTime, StudyScore, StartWeek, EndWeek, StartDate, EndDate, CheckStyleNo, ScoreRecordStyleNo, EmpNo, EmpName, ClassRoomNo, ClassRoomName, CheckMark, StuNumMax, StuNum, ModifyTime, ModifyUserId, ModifyUserName, F_SchoolId from OpenLessonPlanOfElective |
|
|
|
where id ='"+ oplast.Id+ "'"); |
|
|
|
where id ='" + oplast.Id + "'"); |
|
|
|
db.Delete(oplast); |
|
|
|
db.Commit(); |
|
|
|
} |
|
|
@@ -202,7 +203,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration |
|
|
|
var olpl = db.FindList<OpenLessonPlanOfElectiveEntity>(@"select c.id from ElectiveMerge a left join |
|
|
|
ElectiveMergeItem b |
|
|
|
on a.EMId = b.EmId left join OpenLessonPlanOfElective c |
|
|
|
on b.OLPOEId = c.Id where a.EMId = '"+ keyValue + "'"); |
|
|
|
on b.OLPOEId = c.Id where a.EMId = '" + keyValue + "'"); |
|
|
|
foreach (var opitem in olpl) |
|
|
|
{ |
|
|
|
opitem.StuNumMax = entityStuNumMax; |
|
|
|