@@ -0,0 +1,179 @@ | |||
using Learun.Util; | |||
using System.Data; | |||
using Learun.Application.TwoDevelopment.EducationalAdministration; | |||
using System.Web.Mvc; | |||
using System.Collections.Generic; | |||
namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2022-04-12 15:47 | |||
/// 描 述:考场表 | |||
/// </summary> | |||
public class Exam_ExamRoomController : MvcControllerBase | |||
{ | |||
private Exam_ExamRoomIBLL exam_ExamRoomIBLL = new Exam_ExamRoomBLL(); | |||
#region 视图功能 | |||
/// <summary> | |||
/// 主页面 | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult Index() | |||
{ | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 表单页 | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult Form() | |||
{ | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 导入/清空数据 | |||
/// </summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult FormYearSemester() | |||
{ | |||
return View(); | |||
} | |||
#endregion | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetPageList(string pagination, string queryJson) | |||
{ | |||
Pagination paginationobj = pagination.ToObject<Pagination>(); | |||
var data = exam_ExamRoomIBLL.GetPageList(paginationobj, queryJson); | |||
var jsonData = new | |||
{ | |||
rows = data, | |||
total = paginationobj.total, | |||
page = paginationobj.page, | |||
records = paginationobj.records | |||
}; | |||
return Success(jsonData); | |||
} | |||
/// <summary> | |||
/// 获取表单数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetFormData(string keyValue) | |||
{ | |||
var Exam_ExamRoomData = exam_ExamRoomIBLL.GetExam_ExamRoomEntity(keyValue); | |||
var jsonData = new | |||
{ | |||
Exam_ExamRoom = Exam_ExamRoomData, | |||
}; | |||
return Success(jsonData); | |||
} | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[AjaxOnly] | |||
public ActionResult DeleteForm(string keyValue) | |||
{ | |||
exam_ExamRoomIBLL.DeleteEntity(keyValue); | |||
return Success("删除成功!"); | |||
} | |||
/// <summary> | |||
/// 导入教室 | |||
/// </summary> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[AjaxOnly] | |||
public ActionResult Import(string AcademicYearNo, string Semester, int SeatRows, int SeatColumns) | |||
{ | |||
int res = exam_ExamRoomIBLL.Import(AcademicYearNo, Semester,SeatRows,SeatColumns); | |||
return Success("导入" + res + "条数据!"); | |||
} | |||
/// <summary> | |||
/// 按条件清空数据 | |||
/// </summary> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[AjaxOnly] | |||
public ActionResult DeleteWhere(string AcademicYearNo, string Semester) | |||
{ | |||
int res = exam_ExamRoomIBLL.DeleteWhere(AcademicYearNo, Semester); | |||
return Success("清空" + res + "条数据!"); | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="strEntity">实体</param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[ValidateAntiForgeryToken] | |||
[AjaxOnly] | |||
public ActionResult SaveForm(string keyValue, string strEntity) | |||
{ | |||
Exam_ExamRoomEntity entity = strEntity.ToObject<Exam_ExamRoomEntity>(); | |||
//判断考场编号有无重复 | |||
var model = exam_ExamRoomIBLL.GetEntityByClassroomNo(entity.ClassroomNo,entity.AcademicYearNo,entity.Semester); | |||
if (model != null && string.IsNullOrEmpty(keyValue)) | |||
{ | |||
return Fail("考场编号重复!"); | |||
} | |||
else if (model != null && !string.IsNullOrEmpty(keyValue) && keyValue != model.ERId) | |||
{ | |||
return Fail("考场编号重复!"); | |||
} | |||
//计算考场座位数 | |||
entity.SeatCount = entity.SeatRows * entity.SeatColumns; | |||
exam_ExamRoomIBLL.SaveEntity(keyValue, entity); | |||
if (string.IsNullOrEmpty(keyValue)) | |||
{ | |||
} | |||
return Success("保存成功!"); | |||
} | |||
/// <summary> | |||
/// 启用/停用 | |||
/// </summary> | |||
/// <param name="keyValue"></param> | |||
/// <param name="EREnabled"></param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[AjaxOnly] | |||
public ActionResult Lock(string keyValue, int EREnabled) | |||
{ | |||
exam_ExamRoomIBLL.Lock(keyValue, EREnabled); | |||
return Success("操作成功!"); | |||
} | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,39 @@ | |||
@{ | |||
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_ExamRoom"> | |||
<div class="lr-form-item-title">学年<font face="宋体">*</font></div> | |||
<div id="AcademicYearNo" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Exam_ExamRoom"> | |||
<div class="lr-form-item-title">学期<font face="宋体">*</font></div> | |||
<div id="Semester" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Exam_ExamRoom"> | |||
<div class="lr-form-item-title">考场编号<font face="宋体">*</font></div> | |||
<input id="ClassroomNo" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Exam_ExamRoom"> | |||
<div class="lr-form-item-title">考场名称<font face="宋体">*</font></div> | |||
<input id="ClassroomName" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Exam_ExamRoom"> | |||
<div class="lr-form-item-title">座位行数<font face="宋体">*</font></div> | |||
<input id="SeatRows" type="text" class="form-control" isvalid="yes" checkexpession="PositiveInteger" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Exam_ExamRoom"> | |||
<div class="lr-form-item-title">座位列数<font face="宋体">*</font></div> | |||
<input id="SeatColumns" type="text" class="form-control" isvalid="yes" checkexpession="PositiveInteger" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Exam_ExamRoom"> | |||
<div class="lr-form-item-title">排序号</div> | |||
<input id="EROrder" type="text" class="form-control" isvalid="yes" checkexpession="NumOrNull" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Exam_ExamRoom"> | |||
<div class="lr-form-item-title">是否启用<font face="宋体">*</font></div> | |||
<div id="EREnabled" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/Exam_ExamRoom/Form.js") |
@@ -0,0 +1,70 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2022-04-12 15:47 | |||
* 描 述:考场表 | |||
*/ | |||
var acceptClick; | |||
var keyValue = request('keyValue'); | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var page = { | |||
init: function () { | |||
$('.lr-form-wrap').lrscroll(); | |||
page.bind(); | |||
page.initData(); | |||
}, | |||
bind: function () { | |||
$('#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' | |||
}); | |||
$('#EREnabled').lrRadioCheckbox({ | |||
type: 'radio', | |||
code: 'YesOrNoBit', | |||
}); | |||
}, | |||
initData: function () { | |||
if (!!keyValue) { | |||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamRoom/GetFormData?keyValue=' + keyValue, function (data) { | |||
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]); | |||
} | |||
} | |||
}); | |||
} | |||
} | |||
}; | |||
// 保存数据 | |||
acceptClick = function (callBack) { | |||
if (!$('body').lrValidform()) { | |||
return false; | |||
} | |||
var postData = { | |||
strEntity: JSON.stringify($('body').lrGetFormData()) | |||
}; | |||
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamRoom/SaveForm?keyValue=' + keyValue, postData, function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(); | |||
} | |||
}); | |||
}; | |||
page.init(); | |||
} |
@@ -0,0 +1,23 @@ | |||
@{ | |||
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_ExamRoom"> | |||
<div class="lr-form-item-title">学年<font face="宋体">*</font></div> | |||
<div id="AcademicYearNo" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Exam_ExamRoom"> | |||
<div class="lr-form-item-title">学期<font face="宋体">*</font></div> | |||
<div id="Semester" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item SeatClass" data-table="Exam_ExamRoom"> | |||
<div class="lr-form-item-title">座位行数<font face="宋体">*</font></div> | |||
<input id="SeatRows" type="text" class="form-control" isvalid="yes" checkexpession="PositiveInteger" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item SeatClass" data-table="Exam_ExamRoom"> | |||
<div class="lr-form-item-title">座位列数<font face="宋体">*</font></div> | |||
<input id="SeatColumns" type="text" class="form-control" isvalid="yes" checkexpession="PositiveInteger" /> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/Exam_ExamRoom/FormYearSemester.js") |
@@ -0,0 +1,86 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2022-04-12 15:47 | |||
* 描 述:考场表 | |||
*/ | |||
var acceptClick; | |||
var type = request('type'); | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var page = { | |||
init: function () { | |||
$('.lr-form-wrap').lrscroll(); | |||
page.bind(); | |||
page.initData(); | |||
}, | |||
bind: function () { | |||
$('#AcademicYearNo').lrselect({ | |||
placeholder: "学年", | |||
allowSearch: false, | |||
url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetAcademicYearNo', | |||
value: 'value', | |||
text: 'text', | |||
maxHeight: 200, | |||
}); | |||
//学期 | |||
$('#Semester').lrselect({ | |||
placeholder: "学期", | |||
allowSearch: false, | |||
url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetSemester', | |||
value: 'value', | |||
text: 'text' | |||
}); | |||
}, | |||
initData: function () { | |||
//从教室导入 | |||
if (type == 1) { | |||
$('body').find('.SeatClass').attr('display', 'block'); | |||
$('body').find('.SeatClass input').attr('isvalid', 'yes'); | |||
$('body').find('.SeatClass input').attr('checkexpession', 'PositiveInteger'); | |||
} else if (type == 2) {//按条件清空 | |||
$('body').find('.SeatClass input').removeAttr('isvalid'); | |||
$('body').find('.SeatClass input').removeAttr('checkexpession'); | |||
$('body').find('.SeatClass').attr('display', 'none'); | |||
} | |||
} | |||
}; | |||
// 保存数据 | |||
acceptClick = function (callBack) { | |||
if (!$('body').lrValidform()) { | |||
return false; | |||
} | |||
//var postData = { | |||
// AcademicYearNo: $('#AcademicYearNo').lrselectGet(), | |||
// Semester: $('#Semester').lrselectGet() | |||
//}; | |||
var postData = $('body').lrGetFormData(); | |||
console.log(postData); | |||
//TODO: | |||
return false; | |||
//从教室导入 | |||
if (type == 1) { | |||
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamRoom/Import', postData, function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(); | |||
} | |||
}); | |||
} else if (type == 2) { | |||
//按条件清空数据 | |||
learun.layerConfirm('是否确认清空!', function (res) { | |||
if (res) { | |||
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamRoom/DeleteWhere', postData, function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(); | |||
} | |||
}); | |||
} | |||
}); | |||
} | |||
}; | |||
page.init(); | |||
} |
@@ -0,0 +1,56 @@ | |||
@{ | |||
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-6 lr-form-item"> | |||
<div class="lr-form-item-title">学年</div> | |||
<div id="AcademicYearNo"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">学期</div> | |||
<div id="Semester"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">考场编号</div> | |||
<input id="ClassroomNo" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">考场名称</div> | |||
<input id="ClassroomName" 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 class=" btn-group btn-group-sm"> | |||
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i> 新增</a> | |||
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 编辑</a> | |||
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i> 删除</a> | |||
<a id="lr_lock" class="btn btn-default"><i class="fa fa-lock"></i> 启用</a> | |||
<a id="lr_unlock" class="btn btn-default"><i class="fa fa-unlock"></i> 停用</a> | |||
<a id="lr_print" class="btn btn-default"><i class="fa fa-print"></i> 打印</a> | |||
</div> | |||
<div class=" btn-group btn-group-sm"> | |||
<a id="lr_importByBasic" class="btn btn-default"><i class="fa fa-plus"></i> 从教室导入</a> | |||
<a id="lr_emptyWhere" class="btn btn-default"><i class="fa fa-trash-o"></i> 按条件清空数据</a> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-body" id="gridtable"></div> | |||
</div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/Exam_ExamRoom/Index.js") |
@@ -0,0 +1,194 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2022-04-12 15:47 | |||
* 描 述:考场表 | |||
*/ | |||
var refreshGirdData; | |||
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(); | |||
}); | |||
// 新增 | |||
$('#lr_add').on('click', function () { | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '新增', | |||
url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamRoom/Form', | |||
width: 600, | |||
height: 400, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
}); | |||
// 编辑 | |||
$('#lr_edit').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('ERId'); | |||
if (keyValue.indexOf(',') != -1) { | |||
learun.alert.warning("只能选择一条记录进行编辑!"); | |||
return false; | |||
} | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '编辑', | |||
url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamRoom/Form?keyValue=' + keyValue, | |||
width: 600, | |||
height: 400, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
} | |||
}); | |||
// 导入 | |||
$('#lr_importByBasic').on('click', function () { | |||
learun.layerForm({ | |||
id: 'form_import', | |||
title: '导入', | |||
url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamRoom/FormYearSemester?type=1', | |||
width: 500, | |||
height: 300, | |||
btn: ['一键导入', '关闭'], | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
}); | |||
// 按条件清空数据 | |||
$('#lr_emptyWhere').on('click', function () { | |||
learun.layerForm({ | |||
id: 'form_empty', | |||
title: '清空数据', | |||
url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamRoom/FormYearSemester?type=2', | |||
width: 500, | |||
height: 300, | |||
btn: ['清空', '关闭'], | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
}); | |||
// 删除 | |||
$('#lr_delete').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('ERId'); | |||
if (learun.checkrow(keyValue)) { | |||
var EREnabled = $('#gridtable').jfGridValue('EREnabled'); | |||
if (EREnabled.indexOf('true') != -1) { | |||
learun.alert.warning("选中记录中包含已启用项目!"); | |||
return; | |||
} | |||
learun.layerConfirm('是否确认删除该项!', function (res) { | |||
if (res) { | |||
learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamRoom/DeleteForm', { keyValue: keyValue }, function () { | |||
refreshGirdData(); | |||
}); | |||
} | |||
}); | |||
} | |||
}); | |||
//启用 | |||
$('#lr_lock').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('ERId'); | |||
if (learun.checkrow(keyValue)) { | |||
var EREnabled = $('#gridtable').jfGridValue('EREnabled'); | |||
if (EREnabled.indexOf('true') != -1) { | |||
learun.alert.warning("选中记录中包含已启用项目!"); | |||
return; | |||
} | |||
learun.layerConfirm('是否确认启用选中记录!', function (res) { | |||
if (res) { | |||
learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamRoom/Lock', { keyValue: keyValue, EREnabled: 1 }, function () { | |||
refreshGirdData(); | |||
}); | |||
} | |||
}); | |||
} | |||
}); | |||
//禁用 | |||
$('#lr_unlock').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('ERId'); | |||
if (learun.checkrow(keyValue)) { | |||
var EREnabled = $('#gridtable').jfGridValue('EREnabled'); | |||
if (EREnabled.indexOf('false') != -1) { | |||
learun.alert.warning("选中记录中包含已停用项目!"); | |||
return; | |||
} | |||
learun.layerConfirm('是否确认停用选中记录!', function (res) { | |||
if (res) { | |||
learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamRoom/Lock', { keyValue: keyValue, EREnabled: 0 }, function () { | |||
refreshGirdData(); | |||
}); | |||
} | |||
}); | |||
} | |||
}); | |||
// 打印 | |||
$('#lr_print').on('click', function () { | |||
$('#gridtable').jqprintTable(); | |||
}); | |||
}, | |||
// 初始化列表 | |||
initGird: function () { | |||
$('#gridtable').lrAuthorizeJfGridLei({ | |||
url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamRoom/GetPageList', | |||
headData: [ | |||
{ label: "学年", name: "AcademicYearNo", width: 100, align: "left" }, | |||
{ label: "学期", name: "Semester", width: 100, align: "left" }, | |||
{ label: "考场编号", name: "ClassroomNo", width: 100, align: "left" }, | |||
{ label: "考场名称", name: "ClassroomName", width: 200, align: "left" }, | |||
{ label: "座位行数", name: "SeatRows", width: 100, align: "left" }, | |||
{ label: "座位列数", name: "SeatColumns", width: 100, align: "left" }, | |||
{ label: "考场座位数", name: "SeatCount", width: 100, align: "left" }, | |||
{ | |||
label: "是否启用", name: "EREnabled", 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: 'ERId', | |||
isMultiselect: true, | |||
isPage: true, | |||
sidx: 'AcademicYearNo desc,Semester desc,EROrder asc' | |||
}); | |||
page.search(); | |||
}, | |||
search: function (param) { | |||
param = param || {}; | |||
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | |||
} | |||
}; | |||
refreshGirdData = function () { | |||
$('#gridtable').jfGridSet('reload'); | |||
}; | |||
page.init(); | |||
} |
@@ -326,6 +326,7 @@ | |||
<Compile Include="Areas\EducationalAdministration\Controllers\EvaDormitoryInteriorController.cs" /> | |||
<Compile Include="Areas\EducationalAdministration\Controllers\EvaHygieveController.cs" /> | |||
<Compile Include="Areas\EducationalAdministration\Controllers\EvaViolationOfDisciplineController.cs" /> | |||
<Compile Include="Areas\EducationalAdministration\Controllers\Exam_ExamRoomController.cs" /> | |||
<Compile Include="Areas\EducationalAdministration\Controllers\FillinFromController.cs" /> | |||
<Compile Include="Areas\EducationalAdministration\Controllers\HomeStatisticsController.cs" /> | |||
<Compile Include="Areas\EducationalAdministration\Controllers\LeaveSchoolAController.cs" /> | |||
@@ -991,6 +992,9 @@ | |||
<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_ExamRoom\Form.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\Exam_ExamRoom\FormYearSemester.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\Exam_ExamRoom\Index.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\Exam_ExamLesson\FormYearSemester.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\FillinFrom\Form.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\FillinFrom\FormIndex.js" /> | |||
@@ -7614,6 +7618,9 @@ | |||
<Content Include="Areas\EducationalAdministration\Views\StuScore\AllStuScoreQueryIndex.cshtml" /> | |||
<Content Include="Areas\PersonnelManagement\Views\TimeTable\ClassIndexInEducation.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\Exam_ExamLesson\FormYearSemester.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\Exam_ExamRoom\Form.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\Exam_ExamRoom\FormYearSemester.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\Exam_ExamRoom\Index.cshtml" /> | |||
<None Include="Properties\PublishProfiles\CustomProfile.pubxml" /> | |||
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" /> | |||
<Content Include="Views\Login\Default-beifen.cshtml" /> | |||
@@ -0,0 +1,29 @@ | |||
using Learun.Application.TwoDevelopment.EducationalAdministration; | |||
using System.Data.Entity.ModelConfiguration; | |||
namespace Learun.Application.Mapping | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2022-04-12 15:47 | |||
/// 描 述:考场表 | |||
/// </summary> | |||
public class Exam_ExamRoomMap : EntityTypeConfiguration<Exam_ExamRoomEntity> | |||
{ | |||
public Exam_ExamRoomMap() | |||
{ | |||
#region 表、主键 | |||
//表 | |||
this.ToTable("EXAM_EXAMROOM"); | |||
//主键 | |||
this.HasKey(t => t.ERId); | |||
#endregion | |||
#region 配置关系 | |||
#endregion | |||
} | |||
} | |||
} | |||
@@ -82,6 +82,7 @@ | |||
<Compile Include="EducationalAdministration\DispatchAuditMap.cs" /> | |||
<Compile Include="EducationalAdministration\DispatchMap.cs" /> | |||
<Compile Include="EducationalAdministration\EADateArrangeMap.cs" /> | |||
<Compile Include="EducationalAdministration\Exam_ExamRoomMap.cs" /> | |||
<Compile Include="EducationalAdministration\LeaveSchoolMap.cs" /> | |||
<Compile Include="EducationalAdministration\PracticeBaseMap.cs" /> | |||
<Compile Include="EducationalAdministration\R_EnterBuildingMap.cs" /> | |||
@@ -0,0 +1,206 @@ | |||
using Learun.Util; | |||
using System; | |||
using System.Data; | |||
using System.Collections.Generic; | |||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2022-04-12 15:47 | |||
/// 描 述:考场表 | |||
/// </summary> | |||
public class Exam_ExamRoomBLL : Exam_ExamRoomIBLL | |||
{ | |||
private Exam_ExamRoomService exam_ExamRoomService = new Exam_ExamRoomService(); | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<Exam_ExamRoomEntity> GetPageList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
return exam_ExamRoomService.GetPageList(pagination, queryJson); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取Exam_ExamLesson表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
public Exam_ExamRoomEntity GetExam_ExamRoomEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
return exam_ExamRoomService.GetExam_ExamRoomEntity(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
public Exam_ExamRoomEntity GetEntityByClassroomNo(string classroomNo, string AcademicYearNo, int? Semester) | |||
{ | |||
try | |||
{ | |||
return exam_ExamRoomService.GetEntityByClassroomNo(classroomNo, AcademicYearNo, Semester); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
public void DeleteEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
exam_ExamRoomService.DeleteEntity(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 启用/停用 | |||
/// </summary> | |||
/// <param name="keyValue"></param> | |||
/// <param name="EREnabled"></param> | |||
public void Lock(string keyValue, int EREnabled) | |||
{ | |||
try | |||
{ | |||
exam_ExamRoomService.Lock(keyValue, EREnabled); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
/// <returns></returns> | |||
public void SaveEntity(string keyValue, Exam_ExamRoomEntity entity) | |||
{ | |||
try | |||
{ | |||
exam_ExamRoomService.SaveEntity(keyValue, entity); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
public int Import(string AcademicYearNo, string Semester, int SeatRows, int SeatColumns) | |||
{ | |||
try | |||
{ | |||
return exam_ExamRoomService.Import(AcademicYearNo, Semester,SeatRows,SeatColumns); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
public int DeleteWhere(string AcademicYearNo, string Semester) | |||
{ | |||
try | |||
{ | |||
return exam_ExamRoomService.DeleteWhere(AcademicYearNo, Semester); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,90 @@ | |||
using Learun.Util; | |||
using System; | |||
using System.ComponentModel.DataAnnotations.Schema; | |||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2022-04-12 15:47 | |||
/// 描 述:考场表 | |||
/// </summary> | |||
public class Exam_ExamRoomEntity | |||
{ | |||
#region 实体成员 | |||
/// <summary> | |||
/// 主键 | |||
/// </summary> | |||
[Column("ERID")] | |||
public string ERId { get; set; } | |||
/// <summary> | |||
/// 学年 | |||
/// </summary> | |||
[Column("ACADEMICYEARNO")] | |||
public string AcademicYearNo { get; set; } | |||
/// <summary> | |||
/// 学期 | |||
/// </summary> | |||
[Column("SEMESTER")] | |||
public int? Semester { get; set; } | |||
/// <summary> | |||
/// 考场名称 | |||
/// </summary> | |||
[Column("CLASSROOMNAME")] | |||
public string ClassroomName { get; set; } | |||
/// <summary> | |||
/// 考场编号 | |||
/// </summary> | |||
[Column("CLASSROOMNO")] | |||
public string ClassroomNo { get; set; } | |||
/// <summary> | |||
/// 座位行数 | |||
/// </summary> | |||
[Column("SEATROWS")] | |||
public int? SeatRows { get; set; } | |||
/// <summary> | |||
/// 座位列数 | |||
/// </summary> | |||
[Column("SEATCOLUMNS")] | |||
public int? SeatColumns { get; set; } | |||
/// <summary> | |||
/// 考场座位数 | |||
/// </summary> | |||
[Column("SEATCOUNT")] | |||
public int? SeatCount { get; set; } | |||
/// <summary> | |||
/// 排序号 | |||
/// </summary> | |||
[Column("ERORDER")] | |||
public int? EROrder { get; set; } | |||
/// <summary> | |||
/// 是否启用 | |||
/// </summary> | |||
[Column("ERENABLED")] | |||
public bool? EREnabled { get; set; } | |||
#endregion | |||
#region 扩展操作 | |||
/// <summary> | |||
/// 新增调用 | |||
/// </summary> | |||
public void Create() | |||
{ | |||
this.ERId = Guid.NewGuid().ToString(); | |||
} | |||
/// <summary> | |||
/// 编辑调用 | |||
/// </summary> | |||
/// <param name="keyValue"></param> | |||
public void Modify(string keyValue) | |||
{ | |||
this.ERId = keyValue; | |||
} | |||
#endregion | |||
#region 扩展字段 | |||
#endregion | |||
} | |||
} | |||
@@ -0,0 +1,59 @@ | |||
using Learun.Util; | |||
using System.Data; | |||
using System.Collections.Generic; | |||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2022-04-12 15:47 | |||
/// 描 述:考场表 | |||
/// </summary> | |||
public interface Exam_ExamRoomIBLL | |||
{ | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
IEnumerable<Exam_ExamRoomEntity> GetPageList(Pagination pagination, string queryJson); | |||
/// <summary> | |||
/// 获取Exam_ExamLesson表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
Exam_ExamRoomEntity GetExam_ExamRoomEntity(string keyValue); | |||
Exam_ExamRoomEntity GetEntityByClassroomNo(string classroomNo, string AcademicYearNo, int? Semester); | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
void DeleteEntity(string keyValue); | |||
/// <summary> | |||
/// 启用/停用 | |||
/// </summary> | |||
/// <param name="keyValue"></param> | |||
/// <param name="EREnabled"></param> | |||
void Lock(string keyValue, int EREnabled); | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
void SaveEntity(string keyValue, Exam_ExamRoomEntity entity); | |||
int Import(string AcademicYearNo, string Semester, int SeatRows, int SeatColumns); | |||
int DeleteWhere(string AcademicYearNo, string Semester); | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,285 @@ | |||
using Dapper; | |||
using Learun.DataBase.Repository; | |||
using Learun.Util; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Data; | |||
using System.Text; | |||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2022-04-12 15:47 | |||
/// 描 述:考场表 | |||
/// </summary> | |||
public class Exam_ExamRoomService : RepositoryFactory | |||
{ | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">查询参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<Exam_ExamRoomEntity> GetPageList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
var strSql = new StringBuilder(); | |||
strSql.Append("SELECT t.* "); | |||
strSql.Append(" FROM Exam_ExamRoom t "); | |||
strSql.Append(" WHERE 1=1 "); | |||
var queryParam = queryJson.ToJObject(); | |||
// 虚拟参数 | |||
var dp = new DynamicParameters(new { }); | |||
if (!queryParam["AcademicYearNo"].IsEmpty()) | |||
{ | |||
dp.Add("AcademicYearNo", queryParam["AcademicYearNo"].ToString(), DbType.String); | |||
strSql.Append(" AND t.AcademicYearNo = @AcademicYearNo "); | |||
} | |||
if (!queryParam["Semester"].IsEmpty()) | |||
{ | |||
dp.Add("Semester", queryParam["Semester"].ToString(), DbType.String); | |||
strSql.Append(" AND t.Semester = @Semester "); | |||
} | |||
if (!queryParam["ClassroomNo"].IsEmpty()) | |||
{ | |||
dp.Add("ClassroomNo", "%" + queryParam["ClassroomNo"].ToString() + "%", DbType.String); | |||
strSql.Append(" AND t.ClassroomNo Like @ClassroomNo "); | |||
} | |||
if (!queryParam["ClassroomName"].IsEmpty()) | |||
{ | |||
dp.Add("ClassroomName", "%" + queryParam["ClassroomName"].ToString() + "%", DbType.String); | |||
strSql.Append(" AND t.ClassroomName Like @ClassroomName "); | |||
} | |||
return this.BaseRepository("CollegeMIS").FindList<Exam_ExamRoomEntity>(strSql.ToString(), dp, pagination); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取Exam_ExamRoom表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
public Exam_ExamRoomEntity GetExam_ExamRoomEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
return this.BaseRepository("CollegeMIS").FindEntity<Exam_ExamRoomEntity>(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取Exam_ExamRoom表实体数据 | |||
/// </summary> | |||
/// <param name="classroomNo"></param> | |||
/// <returns></returns> | |||
public Exam_ExamRoomEntity GetEntityByClassroomNo(string classroomNo, string AcademicYearNo, int? Semester) | |||
{ | |||
try | |||
{ | |||
return this.BaseRepository("CollegeMIS").FindEntity<Exam_ExamRoomEntity>(x => x.ClassroomNo == classroomNo && x.AcademicYearNo == AcademicYearNo && x.Semester == Semester); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
public void DeleteEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
if (keyValue.Contains(",")) | |||
{ | |||
keyValue = string.Join("','", keyValue.Split(',')); | |||
} | |||
string sql = $"delete Exam_ExamRoom where ERId in ('{keyValue}')"; | |||
this.BaseRepository("CollegeMIS").ExecuteBySql(sql); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 启用/停用 | |||
/// </summary> | |||
/// <param name="keyValue"></param> | |||
/// <param name="EREnabled"></param> | |||
public void Lock(string keyValue, int EREnabled) | |||
{ | |||
try | |||
{ | |||
if (keyValue.Contains(",")) | |||
{ | |||
keyValue = string.Join("','", keyValue.Split(',')); | |||
} | |||
string sql = $"update Exam_ExamRoom set EREnabled='{EREnabled}' where ERId in ('{keyValue}')"; | |||
this.BaseRepository("CollegeMIS").ExecuteBySql(sql); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
public void SaveEntity(string keyValue, Exam_ExamRoomEntity entity) | |||
{ | |||
try | |||
{ | |||
if (!string.IsNullOrEmpty(keyValue)) | |||
{ | |||
entity.Modify(keyValue); | |||
this.BaseRepository("CollegeMIS").Update(entity); | |||
} | |||
else | |||
{ | |||
entity.Create(); | |||
this.BaseRepository("CollegeMIS").Insert(entity); | |||
} | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 导入 | |||
/// </summary> | |||
/// <param name="AcademicYearNo"></param> | |||
/// <param name="Semester"></param> | |||
/// <param name="SeatRows">座位行数</param> | |||
/// <param name="SeatColumns">座位列数</param> | |||
/// <returns></returns> | |||
public int Import(string AcademicYearNo, string Semester,int SeatRows,int SeatColumns) | |||
{ | |||
try | |||
{ | |||
string sql = $@"insert into Exam_ExamRoom([ERId] | |||
,[AcademicYearNo] | |||
,[Semester] | |||
,[ClassroomName] | |||
,[ClassroomNo] | |||
,[SeatRows] | |||
,[SeatColumns] | |||
,[SeatCount] | |||
,[EROrder] | |||
,[EREnabled]) | |||
select NEWID(),'{AcademicYearNo}','{Semester}',ClassroomName,[ClassroomNo],{SeatRows},{SeatColumns},{SeatRows}*{SeatColumns},0,1 from ClassroomInfo where CheckMark=1 | |||
and [ClassroomNo] not in (select [ClassroomNo] from Exam_ExamRoom where AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}' ) | |||
"; | |||
return this.BaseRepository("CollegeMIS").ExecuteBySql(sql); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 清空数据 | |||
/// </summary> | |||
/// <param name="AcademicYearNo"></param> | |||
/// <param name="Semester"></param> | |||
/// <returns></returns> | |||
public int DeleteWhere(string AcademicYearNo, string Semester) | |||
{ | |||
try | |||
{ | |||
string sql = $"delete Exam_ExamRoom where AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}'"; | |||
return this.BaseRepository("CollegeMIS").ExecuteBySql(sql); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
} | |||
} |
@@ -156,6 +156,10 @@ | |||
<Compile Include="EducationalAdministration\EADateArrange\EADateArrangeEntity.cs" /> | |||
<Compile Include="EducationalAdministration\EADateArrange\EADateArrangeIBLL.cs" /> | |||
<Compile Include="EducationalAdministration\EADateArrange\EADateArrangeService.cs" /> | |||
<Compile Include="EducationalAdministration\Exam_ExamRoom\Exam_ExamRoomBLL.cs" /> | |||
<Compile Include="EducationalAdministration\Exam_ExamRoom\Exam_ExamRoomEntity.cs" /> | |||
<Compile Include="EducationalAdministration\Exam_ExamRoom\Exam_ExamRoomIBLL.cs" /> | |||
<Compile Include="EducationalAdministration\Exam_ExamRoom\Exam_ExamRoomService.cs" /> | |||
<Compile Include="EducationalAdministration\LeaveSchoolA\LeaveSchoolABLL.cs" /> | |||
<Compile Include="EducationalAdministration\LeaveSchoolA\LeaveSchoolAIBLL.cs" /> | |||
<Compile Include="EducationalAdministration\LeaveSchoolA\LeaveSchoolAService.cs" /> | |||