@@ -4,6 +4,7 @@ using Learun.Application.TwoDevelopment.EducationalAdministration; | |||
using System.Web.Mvc; | |||
using System.Collections.Generic; | |||
using System; | |||
using System.Linq; | |||
namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
{ | |||
@@ -53,6 +54,18 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
{ | |||
return View(); | |||
} | |||
[HttpGet] | |||
public ActionResult FormTeacher() | |||
{ | |||
return View(); | |||
} | |||
[HttpGet] | |||
public ActionResult FormRoomTeacher() | |||
{ | |||
return View(); | |||
} | |||
#endregion | |||
#region 获取数据 | |||
@@ -106,6 +119,19 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
}; | |||
return Success(jsonData); | |||
} | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetFormRoom(string keyValue) | |||
{ | |||
var data = exam_ExamPlanRoomIBLL.GetEntity(keyValue); | |||
var jsonData = new | |||
{ | |||
Exam_ExamPlanRoom = data, | |||
}; | |||
return Success(jsonData); | |||
} | |||
/// <summary> | |||
/// 获取表单数据 | |||
/// </summary> | |||
@@ -140,6 +166,14 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
var data = exam_ExamPlanLessonIBLL.GetTree(); | |||
return Success(data); | |||
} | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult ValidateRoom(string EPLId, string ClassroomNo) | |||
{ | |||
var data = exam_ExamPlanRoomIBLL.ValidateRoom(EPLId, ClassroomNo); | |||
return Success(data); | |||
} | |||
#endregion | |||
#region 提交数据 | |||
@@ -246,16 +280,28 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
return Success("保存成功!"); | |||
} | |||
[HttpPost] | |||
[ValidateAntiForgeryToken] | |||
[AjaxOnly] | |||
public ActionResult SaveRoom(List<Exam_ExamPlanRoomEntity> list) | |||
public ActionResult SaveRoomAndTeacher(string keyValue, string strEntity, string Exam_ExamPlanTeacherList) | |||
{ | |||
exam_ExamPlanRoomIBLL.SaveList(list); | |||
var entity = strEntity.ToObject<Exam_ExamPlanRoomEntity>(); | |||
var teacherList = Exam_ExamPlanTeacherList.ToObject<List<Exam_InvigilateTeacherEntity>>(); | |||
entity.EmpNo = string.Join(",", teacherList.Select(x => x.EmpNo).ToList()); | |||
entity.EmpName = string.Join(",", teacherList.Select(x => x.EmpName).ToList()); | |||
exam_ExamPlanRoomIBLL.SaveEntity(keyValue, entity); | |||
return Success("保存成功!"); | |||
} | |||
//[HttpPost] | |||
//[ValidateAntiForgeryToken] | |||
//[AjaxOnly] | |||
//public ActionResult SaveRoom(List<Exam_ExamPlanRoomEntity> list) | |||
//{ | |||
// exam_ExamPlanRoomIBLL.SaveList(list); | |||
// return Success("保存成功!"); | |||
//} | |||
#endregion | |||
} | |||
@@ -54,10 +54,10 @@ var bootstrap = function ($, learun) { | |||
// } | |||
//}, | |||
], | |||
mainId: 'ClassId', | |||
mainId: 'ERId', | |||
isPage: true, | |||
isMultiselect: true, | |||
//isMultiselect: true, | |||
}); | |||
page.search(); | |||
}, | |||
@@ -75,30 +75,32 @@ var bootstrap = function ($, learun) { | |||
// 保存数据 | |||
acceptClick = function (callBack) { | |||
var selectedRow = $('#gridtable').jfGridGet('rowdata'); | |||
var list = []; | |||
$.each(selectedRow, | |||
function (i, item) { | |||
var entity = { | |||
ClassroomName: item.ClassroomName, | |||
ClassroomNo: item.ClassroomNo, | |||
SeatCount: item.SeatCount, | |||
EPRId: learun.newGuid(), | |||
EPLId: EPLId | |||
} | |||
list.push(entity); | |||
learun.layerClose(window.name); | |||
callBack(selectedRow); | |||
//var list = []; | |||
//$.each(selectedRow, | |||
// function (i, item) { | |||
// var entity = { | |||
// ClassroomName: item.ClassroomName, | |||
// ClassroomNo: item.ClassroomNo, | |||
// SeatCount: item.SeatCount, | |||
// EPRId: learun.newGuid(), | |||
// EPLId: EPLId | |||
// } | |||
// list.push(entity); | |||
}); | |||
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/SaveRoom?EPLId=' + EPLId, | |||
{ list: list }), function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(); | |||
} | |||
}; | |||
if (!!callBack) { | |||
callBack(); | |||
} | |||
// }); | |||
//$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/SaveRoom?EPLId=' + EPLId, | |||
// { list: list }), function (res) { | |||
// // 保存成功后才回调 | |||
// if (!!callBack) { | |||
// callBack(); | |||
// } | |||
// }; | |||
//if (!!callBack) { | |||
// callBack(); | |||
//} | |||
}; | |||
page.init(); | |||
} |
@@ -0,0 +1,28 @@ | |||
@{ | |||
ViewBag.Title = "添加排考考场"; | |||
Layout = "~/Views/Shared/_Form.cshtml"; | |||
} | |||
<div class="lr-form-wrap" id="form"> | |||
<div class="col-xs-12 lr-form-item" data-table="Exam_ExamPlanRoom"> | |||
<div class="lr-form-item-title">考场名称<font face="宋体">*</font></div> | |||
<input id="ClassroomName" type="text" readonly="readonly" class="form-control" isvalid="yes" checkexpession="NotNull" style="width: 85%;" /> | |||
<button class="btn btn-primary" id="selectRoom" style="float: right;margin-top: -28px;">选择考场</button> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Exam_ExamPlanRoom"> | |||
<div class="lr-form-item-title">考场编号</div> | |||
<input id="ClassroomNo" readonly="readonly" type="text" class="form-control"> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Exam_ExamPlanRoom"> | |||
<div class="lr-form-item-title">考场座位数</div> | |||
<input id="SeatCount" readonly="readonly" type="text" class="form-control"> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">监考老师</div> | |||
<input id="detailadd" type="button" class="btn btn-success" value="新增明细" /> | |||
<input id="detaildel" type="button" class="btn btn-danger" value="移除明细" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item lr-form-item-grid"> | |||
<div id="Exam_ExamPlanTeacher"></div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoomTeacher.js") |
@@ -0,0 +1,163 @@ | |||
| |||
//考试安排课程表Id | |||
var EPLId = request('EPLId'); | |||
var EPId = request('EPId'); | |||
var keyValue = request('keyValue'); | |||
var acceptClick; | |||
// 设置表单数据 | |||
var setFormData; | |||
// 验证数据是否填写完整 | |||
var validForm; | |||
// 保存数据 | |||
var save; | |||
var refreshGirdData; | |||
var refreshRoomData; | |||
var selectedRow; | |||
var tempdatra = new Array(); | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var page = { | |||
init: function () { | |||
$('.lr-form-wrap').lrscroll(); | |||
$("#detailadd").on('click', function () { | |||
selectedRow = null; | |||
learun.layerForm({ | |||
id: 'formitem', | |||
title: '新增明细', | |||
url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/FormTeacher?EPLId=' + EPLId + '&EPRId=' + keyValue, | |||
width: 860, | |||
height: 600, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
}); | |||
$("#detaildel").on('click', function () { | |||
var keyValue = $('#Exam_ExamPlanTeacher').jfGridValue('EmpNo'); | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerConfirm('是否确认删除该项!', function (res, index) { | |||
if (res) { | |||
$.each(tempdatra, function (key, val) { | |||
if (!!val && val.EmpNo === keyValue) { | |||
tempdatra.splice(key, 1); | |||
} | |||
}); | |||
$('#Exam_ExamPlanTeacher').jfGridSet('refreshdata', tempdatra); | |||
top.layer.close(index); | |||
} | |||
}); | |||
} | |||
}); | |||
page.bind(); | |||
page.initData(); | |||
}, | |||
bind: function () { | |||
$("#selectRoom").on('click', function () { | |||
selectedRow = null; | |||
learun.layerForm({ | |||
id: 'formroom1', | |||
title: '新增考场', | |||
url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/FormRoom?EPLId=' + EPLId, | |||
width: 850, | |||
height: 500, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshRoomData); | |||
} | |||
}); | |||
}); | |||
$('#Exam_ExamPlanTeacher').jfGrid({ | |||
headData: [ | |||
{ | |||
label: '编号', name: 'EmpNo', width: 150, align: 'left' | |||
}, | |||
{ | |||
label: '姓名', name: 'EmpName', width: 150, align: 'left' | |||
} | |||
], | |||
height: 400, | |||
mainId: 'AAIId', | |||
reloadSelected: false, | |||
}); | |||
}, | |||
initData: function () { | |||
if (!!keyValue) { | |||
$.lrSetForm( | |||
top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/GetFormRoom?keyValue=' + keyValue, | |||
function (data) { | |||
tempdatra = []; | |||
for (var id in data) { | |||
if (!!data[id].length && data[id].length > 0) { | |||
$('#' + id).jfGridSet('refreshdata', data[id]); | |||
} else { | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
var empnoArr = data[id].EmpNo.split(','); | |||
var empnameArr = data[id].EmpName.split(','); | |||
$.each(empnoArr, function (i, val) { | |||
tempdatra.push({ EmpNo: val, EmpName: empnameArr[i] }); | |||
}); | |||
$('#Exam_ExamPlanTeacher').jfGridSet('refreshdata', tempdatra); | |||
} | |||
} | |||
}); | |||
} | |||
} | |||
}; | |||
refreshGirdData = function (temprow) { | |||
//console.log('temprow', temprow); | |||
//求数组并集 | |||
//两数组连接(包括重复值) | |||
var arr3 = tempdatra.concat(temprow); | |||
//var result = []; | |||
var obj = []; | |||
//去重 | |||
tempdatra = arr3.reduce(function (prev, cur, index, arr) { | |||
//console.log(prev, cur); | |||
obj[cur.EmpNo] ? '' : obj[cur.EmpNo] = true && prev.push(cur); | |||
return prev; | |||
}, []); | |||
$('#Exam_ExamPlanTeacher').jfGridSet('refreshdata', tempdatra); | |||
}; | |||
refreshRoomData = function (temprow) { | |||
// console.log('teacherRow', temprow); | |||
learun.httpAsyncGet(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/ValidateRoom?EPLId=' + EPLId + '&ClassroomNo=' + temprow.ClassroomNo, function (res) { | |||
if (res.data == true) { | |||
return learun.alert.warning("考场不可重复选择!"); | |||
} else { | |||
$("#ClassroomName").val(temprow.ClassroomName); | |||
$('#ClassroomNo').val(temprow.ClassroomNo); | |||
$('#SeatCount').val(temprow.SeatCount); | |||
} | |||
}); | |||
}; | |||
// 验证数据是否填写完整 | |||
validForm = function () { | |||
if (!$('.lr-form-wrap').lrValidform()) { | |||
return false; | |||
} | |||
var datas = $('#Exam_ExamPlanTeacher').jfGridGet('rowdatas'); | |||
if (datas == null || datas.length == 0) { | |||
learun.alert.warning("请先新增监考老师!"); | |||
return false; | |||
} | |||
return true; | |||
}; | |||
// 保存数据 | |||
acceptClick = function (callBack, i) { | |||
var postData = {}; | |||
var formData = $('[data-table="Exam_ExamPlanRoom"]').lrGetFormData(); | |||
formData.EPLId = EPLId; | |||
postData.strEntity = JSON.stringify(formData); | |||
postData.Exam_ExamPlanTeacherList = JSON.stringify($('#Exam_ExamPlanTeacher').jfGridGet('rowdatas')); | |||
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/SaveRoomAndTeacher?keyValue=' + keyValue, postData, function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(res, formData, i); | |||
} | |||
}); | |||
}; | |||
page.init(); | |||
} |
@@ -0,0 +1,44 @@ | |||
@{ | |||
ViewBag.Title = "添加排考监考老师"; | |||
Layout = "~/Views/Shared/_Index.cshtml"; | |||
} | |||
<div class="lr-layout "> | |||
<div class="lr-layout-center"> | |||
<div class="lr-layout-wrap lr-layout-wrap-notitle "> | |||
<div class="lr-layout-tool"> | |||
<div class="lr-layout-tool-left"> | |||
<div class="lr-layout-tool-item"> | |||
<div id="multiple_condition_query"> | |||
<div class="lr-query-formcontent"> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">学年</div> | |||
<div id="AcademicYearNo"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">学期</div> | |||
<div id="Semester"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">教师编号</div> | |||
<input id="EmpNo" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">教师姓名</div> | |||
<input id="EmpName" type="text" class="form-control" /> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-tool-right"> | |||
<div class=" btn-group btn-group-sm"> | |||
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-body" id="gridtable"></div> | |||
</div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormTeacher.js") |
@@ -0,0 +1,105 @@ | |||
| |||
var refreshGirdData; | |||
var acceptClick; | |||
//考试安排课程表Id | |||
var EPLId = request('EPLId'); | |||
//安排考场表Id | |||
var EPRId = request('EPRId'); | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var page = { | |||
init: function () { | |||
page.initGird(); | |||
page.bind(); | |||
}, | |||
bind: function () { | |||
$('#multiple_condition_query').lrMultipleQuery(function (queryJson) { | |||
page.search(queryJson); | |||
}, 220, 400); | |||
$('#AcademicYearNo').lrselect({ | |||
placeholder: "学年", | |||
allowSearch: true, | |||
url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetAcademicYearNo', | |||
value: 'value', | |||
text: 'text' | |||
}); | |||
//学期 | |||
$('#Semester').lrselect({ | |||
placeholder: "学期", | |||
url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetSemester', | |||
value: 'value', | |||
text: 'text' | |||
}); | |||
// 刷新 | |||
$('#lr_refresh').on('click', function () { | |||
location.reload(); | |||
}); | |||
}, | |||
// 初始化列表 | |||
initGird: function () { | |||
$('#gridtable').jfGrid({ | |||
url: top.$.rootUrl + '/EducationalAdministration/Exam_InvigilateTeacher/GetPageList', | |||
headData: [ | |||
{ label: "学年", name: "AcademicYearNo", width: 100, align: "left" }, | |||
{ label: "学期", name: "Semester", width: 100, align: "left" }, | |||
{ label: "教师编号", name: "EmpNo", width: 100, align: "left" }, | |||
{ label: "教师姓名", name: "EmpName", width: 100, align: "left" }, | |||
{ | |||
label: "是否启用", name: "ITEnabled", width: 100, align: "left", | |||
formatter: function (cellvalue) { | |||
return cellvalue == 1 ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>"; | |||
} | |||
}, | |||
], | |||
mainId: 'ITId', | |||
isPage: true, | |||
isMultiselect: true, | |||
}); | |||
page.search(); | |||
}, | |||
search: function (param) { | |||
param = param || {}; | |||
//考试安排课程表Id | |||
param.EPLId = EPLId; | |||
//安排考场表Id | |||
param.EPRId = EPRId; | |||
param.SqlParameter = " and t.ITEnabled=1"; | |||
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | |||
} | |||
}; | |||
refreshGirdData = function () { | |||
page.search(); | |||
}; | |||
// 保存数据 | |||
acceptClick = function (callBack) { | |||
var selectedRow = $('#gridtable').jfGridGet('rowdata'); | |||
learun.layerClose(window.name); | |||
callBack(selectedRow); | |||
//var list = []; | |||
//$.each(selectedRow, | |||
// function (i, item) { | |||
// var entity = { | |||
// ClassroomName: item.ClassroomName, | |||
// ClassroomNo: item.ClassroomNo, | |||
// SeatCount: item.SeatCount, | |||
// EPRId: learun.newGuid(), | |||
// EPLId: EPLId | |||
// } | |||
// list.push(entity); | |||
// }); | |||
//$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/SaveRoom?EPLId=' + EPLId, | |||
// { list: list }), function (res) { | |||
// // 保存成功后才回调 | |||
// if (!!callBack) { | |||
// callBack(); | |||
// } | |||
// }; | |||
//if (!!callBack) { | |||
// callBack(); | |||
//} | |||
}; | |||
page.init(); | |||
} |
@@ -70,6 +70,7 @@ | |||
<div class="tbTitle"><span>考场信息</span></div> | |||
<div class=" btn-group btn-group-sm" style="float: right;" learun-authorize="yes"> | |||
<a id="lr_add_Room" class="btn btn-default"><i class="fa fa-plus"></i> 新增</a> | |||
<a id="lr_edit_Room" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 编辑</a> | |||
<a id="lr_delete_Room" class="btn btn-default"><i class="fa fa-trash-o"></i> 删除</a> | |||
</div> | |||
<div class="lr-layout-body" id="gridtable_Room"></div> | |||
@@ -127,13 +127,12 @@ var bootstrap = function ($, learun) { | |||
return learun.alert.warning("该项已审核!"); | |||
} | |||
learun.layerForm({ | |||
id: 'formroom', | |||
id: 'formteacherRoom', | |||
title: '新增考场', | |||
url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/FormRoom?EPLId=' + EPLId + '&EPId=' + EPId, | |||
url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/FormRoomTeacher?EPLId=' + EPLId + '&EPId=' + EPId, | |||
width: 850, | |||
height: 500, | |||
callBack: function (id) { | |||
console.log('新增考场back'); | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
@@ -141,6 +140,30 @@ var bootstrap = function ($, learun) { | |||
return learun.alert.warning("请选择考试课程!"); | |||
} | |||
}); | |||
//考场 编辑 | |||
$('#lr_edit_Room').on('click', function () { | |||
if (!!EPLId) { | |||
if (ELCheckMark == 1) { | |||
return learun.alert.warning("该项已审核!"); | |||
} | |||
var keyValue = $('#gridtable_Room').jfGridValue('EPRId'); | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerForm({ | |||
id: 'formteacherRoom', | |||
title: '编辑考场', | |||
url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/FormRoomTeacher?EPLId=' + EPLId + '&EPId=' + EPId + '&keyValue=' + keyValue, | |||
width: 850, | |||
height: 500, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
} | |||
} else { | |||
return learun.alert.warning("请选择考试课程!"); | |||
} | |||
}); | |||
// 考场删除 | |||
$('#lr_delete_Room').on('click', function () { | |||
var keyValue = $('#gridtable_Room').jfGridValue('EPRId'); | |||
@@ -996,6 +996,8 @@ | |||
<Content Include="Areas\EducationalAdministration\Views\EvaHygieve\Index.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\EvaViolationOfDiscipline\Form.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\EvaViolationOfDiscipline\Index.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\Exam_ExamPlanLesson\FormTeacher.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\Exam_ExamPlanLesson\FormRoomTeacher.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\Exam_ExamPlanLesson\FormRoom.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\Exam_ExamPlanLesson\FormClass.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\Exam_ExamPlan\ClearForm.js" /> | |||
@@ -7655,6 +7657,8 @@ | |||
<Content Include="Areas\EducationalAdministration\Views\Exam_ExamPlan\ClearForm.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\Exam_ExamPlan\GenerateForm.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\Exam_ExamPlanLesson\FormRoom.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\Exam_ExamPlanLesson\FormRoomTeacher.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\Exam_ExamPlanLesson\FormTeacher.cshtml" /> | |||
<None Include="Properties\PublishProfiles\CustomProfile.pubxml" /> | |||
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" /> | |||
<Content Include="Views\Login\Default-beifen.cshtml" /> | |||
@@ -85,8 +85,25 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
} | |||
} | |||
} | |||
public bool ValidateRoom(string EPLId, string ClassroomNo) | |||
{ | |||
try | |||
{ | |||
return exam_ExamPlanRoomService.ValidateRoom(EPLId, ClassroomNo); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
#region 提交数据 | |||
@@ -29,7 +29,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
Exam_ExamPlanRoomEntity GetEntity(string keyValue); | |||
bool ValidateRoom(string EPLId, string ClassroomNo); | |||
#endregion | |||
#region 提交数据 | |||
@@ -124,7 +124,24 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
} | |||
} | |||
public bool ValidateRoom(string EPLId, string ClassroomNo) | |||
{ | |||
try | |||
{ | |||
return this.BaseRepository("CollegeMIS").FindList<Exam_ExamPlanRoomEntity>(x => x.EPLId == EPLId && x.ClassroomNo == ClassroomNo).Count() > 0 ? true : false; | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
#region 提交数据 | |||
@@ -141,9 +158,9 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
if (keyValue.Contains(",")) | |||
{ | |||
entity = this.BaseRepository("CollegeMIS").FindEntity<Exam_ExamPlanRoomEntity>((keyValue.Split(','))[0]); | |||
keyValue = string.Join("','", keyValue.Split(',')); | |||
} | |||
} | |||
else | |||
{ | |||
entity = this.BaseRepository("CollegeMIS").FindEntity<Exam_ExamPlanRoomEntity>(keyValue); | |||
@@ -4,6 +4,7 @@ using Learun.Util; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Data; | |||
using System.Linq; | |||
using System.Text; | |||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
@@ -59,6 +60,34 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
dp.Add("EmpName", "%" + queryParam["EmpName"].ToString() + "%", DbType.String); | |||
strSql.Append(" AND t.EmpName Like @EmpName "); | |||
} | |||
if (!queryParam["EPLId"].IsEmpty()) | |||
{ | |||
//排考安排课程表Id | |||
var ELEntity = this.BaseRepository("CollegeMIS").FindList<Exam_ExamPlanEntity>($@"select * from Exam_ExamPlan where EPId=( | |||
select EPId from Exam_ExamPlanLesson where EPLId='{queryParam["EPLId"].ToString()}')").FirstOrDefault(); | |||
if (ELEntity != null) | |||
{ | |||
strSql.Append($" AND t.AcademicYearNo = '{ELEntity.AcademicYearNo}' "); | |||
strSql.Append($" AND t.Semester = '{ELEntity.Semester}' "); | |||
} | |||
var empSql = $"select EmpNo from Exam_ExamPlanRoom where EPLId='{queryParam["EPLId"].ToString()}'"; | |||
if (!queryParam["EPRId"].IsEmpty()) | |||
{ | |||
empSql += $" and EPRId<>'{queryParam["EPRId"].ToString()}'"; | |||
} | |||
var obj = this.BaseRepository("CollegeMIS").FindObject(empSql); | |||
if (obj != null) | |||
{ | |||
var empNo = string.Join("','", obj.ToString().Split(',')); | |||
strSql.Append($" AND t.EmpNo not in ('{empNo}')"); | |||
} | |||
} | |||
if (!queryParam["SqlParameter"].IsEmpty()) | |||
{ | |||
strSql.Append(queryParam["SqlParameter"].ToString()); | |||
} | |||
return this.BaseRepository("CollegeMIS").FindList<Exam_InvigilateTeacherEntity>(strSql.ToString(), dp, pagination); | |||
} | |||
catch (Exception ex) | |||