@@ -12,15 +12,15 @@ | |||
<div class="lr-query-formcontent"> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">学年</div> | |||
<input id="AcademicYearNo" type="text" class="form-control" /> | |||
<div id="AcademicYearNo" type="lrselect" class="lr-select"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">学期</div> | |||
<input id="Semester" type="text" class="form-control" /> | |||
<div id="Semester" type="lrselect" class="lr-select"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">课程名称</div> | |||
<input id="LessonName" type="text" class="form-control" /> | |||
<div id="LessonName" type="lrselect" class="lr-select"></div> | |||
</div> | |||
</div> | |||
</div> | |||
@@ -29,6 +29,22 @@ var bootstrap = function ($, learun) { | |||
$('#lr_refresh').on('click', function () { | |||
location.reload(); | |||
}); | |||
$('#AcademicYearNo').lrselect({ | |||
placeholder: "学年", | |||
allowSearch: false, | |||
url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetAcademicYearNo', | |||
value: 'value', | |||
text: 'text' | |||
}); | |||
//学期 | |||
$('#Semester').lrselect({ | |||
placeholder: "学期", | |||
allowSearch: false, | |||
url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetSemester', | |||
value: 'value', | |||
text: 'text' | |||
}); | |||
$('#LessonName').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' }); | |||
// 管理合班 | |||
$('#lr_add').on('click', function () { | |||
//选课开始后无法进行编辑 | |||
@@ -12,19 +12,20 @@ | |||
<div class="lr-query-formcontent"> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">学年</div> | |||
<input id="AcademicYearNo" type="text" class="form-control" /> | |||
<div id="AcademicYearNo" type="lrselect" class="lr-select"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">学期</div> | |||
<input id="Semester" type="text" class="form-control" /> | |||
<div id="Semester" type="lrselect" class="lr-select"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">课程号</div> | |||
<input id="LessonNo" type="text" class="form-control" /> | |||
<div class="lr-form-item-title">课程名称</div> | |||
@*<input id="LessonName" type="text" class="form-control" />*@ | |||
<div id="LessonName" type="lrselect" class="lr-select"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">课程名称</div> | |||
<input id="LessonName" type="text" class="form-control" /> | |||
<div class="lr-form-item-title">课程号</div> | |||
<input id="LessonNo" type="text" class="form-control" /> | |||
</div> | |||
</div> | |||
</div> | |||
@@ -30,6 +30,22 @@ var bootstrap = function ($, learun) { | |||
$('#lr_refresh').on('click', function () { | |||
location.reload(); | |||
}); | |||
$('#AcademicYearNo').lrselect({ | |||
placeholder: "学年", | |||
allowSearch: false, | |||
url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetAcademicYearNo', | |||
value: 'value', | |||
text: 'text' | |||
}); | |||
//学期 | |||
$('#Semester').lrselect({ | |||
placeholder: "学期", | |||
allowSearch: false, | |||
url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetSemester', | |||
value: 'value', | |||
text: 'text' | |||
}); | |||
$('#LessonName').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' }); | |||
//设置选课专业 | |||
$('#lr_editMajor').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('Id'); | |||
@@ -198,7 +214,7 @@ var bootstrap = function ($, learun) { | |||
headData: [ | |||
{ label: "学年", name: "AcademicYearNo", width: 45, align: "left" }, | |||
{ label: "学期", name: "Semester", width: 35, align: "left" }, | |||
{ label: "课程号", name: "LessonNo", width: 70, align: "left" }, | |||
{ label: "课程号", name: "LessonNo", width: 100, align: "left" }, | |||
//{ | |||
// label: "课程名称", name: "LessonNo2", width: 170, align: "left", | |||
// formatterAsync: function (callback, value, row, op, $cell) { | |||
@@ -24,7 +24,8 @@ | |||
</div> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">推荐教师</div> | |||
<div id="EmpNo"></div> | |||
<div id="EmpNo" type="lrselect" class="lr-select"></div> | |||
@*<div id="EmpNo"></div>*@ | |||
</div> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">姓名</div> | |||
@@ -85,6 +85,7 @@ var bootstrap = function ($, learun) { | |||
//老师 | |||
$('#EmpNo').lrselect({ | |||
//type: 'multiple', | |||
allowSearch: true, | |||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=EmpInfo', | |||
param: { strWhere: "1=1 " }, | |||
value: "empno", | |||
@@ -267,7 +267,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
foreach (var item in dataList) | |||
{ | |||
//判断是否已选 | |||
if (list.Where(x => x.MajorId == item.ID).Count() <= 0) | |||
if (list.Where(x => x.MajorId == item.ID && x.Grade == item.Grade).Count() <= 0) | |||
{ | |||
var entity = new ElectiveMajorEntity(); | |||
entity.Create(); | |||
@@ -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; | |||
@@ -645,8 +645,10 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
} | |||
if (!queryParam["LessonName"].IsEmpty()) | |||
{ | |||
dp.Add("LessonName", "%" + queryParam["LessonName"].ToString() + "%", DbType.String); | |||
strSql.Append(" AND t.LessonName Like @LessonName "); | |||
dp.Add("LessonName", queryParam["LessonName"].ToString(), DbType.String); | |||
strSql.Append(" AND t.LessonNo = @LessonName "); | |||
//dp.Add("LessonName", "%" + queryParam["LessonName"].ToString() + "%", DbType.String); | |||
//strSql.Append(" AND t.LessonName Like @LessonName "); | |||
} | |||
var list = new List<OpenLessonPlanOfElectiveEntity>(); | |||