@@ -226,6 +226,24 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers | |||||
{ | { | ||||
return View(); | return View(); | ||||
} | } | ||||
/// <summary> | |||||
/// 床位管理 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult IndexBed() | |||||
{ | |||||
return View(); | |||||
} | |||||
/// <summary> | |||||
/// 床位管理 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult FormBed() | |||||
{ | |||||
return View(); | |||||
} | |||||
#endregion | #endregion | ||||
@@ -397,6 +415,18 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers | |||||
return Success("删除成功!"); | return Success("删除成功!"); | ||||
} | } | ||||
/// <summary> | /// <summary> | ||||
/// 删除 | |||||
/// <param name="keyValue">主键</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[AjaxOnly] | |||||
public ActionResult DeleteBed(string keyValue,string ParentID) | |||||
{ | |||||
accommodationIBLL.DeleteBed(keyValue, ParentID); | |||||
return Success("删除成功!"); | |||||
} | |||||
/// <summary> | |||||
/// 保存实体数据(新增、修改) | /// 保存实体数据(新增、修改) | ||||
/// <param name="keyValue">主键</param> | /// <param name="keyValue">主键</param> | ||||
/// <summary> | /// <summary> | ||||
@@ -410,7 +440,21 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers | |||||
accommodationIBLL.SaveEntity(keyValue, entity); | accommodationIBLL.SaveEntity(keyValue, entity); | ||||
return Success("保存成功!"); | return Success("保存成功!"); | ||||
} | } | ||||
/// <summary> | |||||
/// 保存实体数据(新增、修改) | |||||
/// <param name="keyValue">主键</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[ValidateAntiForgeryToken] | |||||
[AjaxOnly] | |||||
public ActionResult SaveBedForm(string keyValue,string ParentID, string strEntity) | |||||
{ | |||||
Acc_DormitoryBuildEntity entity = strEntity.ToObject<Acc_DormitoryBuildEntity>(); | |||||
accommodationIBLL.SaveBedEntity(keyValue, ParentID, entity); | |||||
return Success("保存成功!"); | |||||
} | |||||
/// <summary> | /// <summary> | ||||
/// 寝室分配系 | /// 寝室分配系 | ||||
/// <param name="keyValue">主键</param> | /// <param name="keyValue">主键</param> | ||||
@@ -439,6 +483,7 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers | |||||
accommodationIBLL.SaveRoom(RoomId, list); | accommodationIBLL.SaveRoom(RoomId, list); | ||||
return Success("保存成功!"); | return Success("保存成功!"); | ||||
} | } | ||||
/// <summary> | /// <summary> | ||||
/// 学生宿舍的单元、楼层、房间、床位添加 | /// 学生宿舍的单元、楼层、房间、床位添加 | ||||
/// </summary> | /// </summary> | ||||
@@ -450,11 +495,6 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers | |||||
[AjaxOnly] | [AjaxOnly] | ||||
public ActionResult DormitoryAdd(string keyValue, string strEntity) | public ActionResult DormitoryAdd(string keyValue, string strEntity) | ||||
{ | { | ||||
//dynamic entity = JsonConvert.DeserializeObject(strEntity); | |||||
//var ElementNum = entity.ElementNum; | |||||
//var FloorNum = entity.FloorNum; | |||||
//var RoomNum = entity.RoomNUm; | |||||
//var BedNum = entity.BedNum; | |||||
JObject jsonEntity = JObject.Parse(strEntity); | JObject jsonEntity = JObject.Parse(strEntity); | ||||
var elementNum = int.Parse(jsonEntity["ElementNum"].ToString()); | var elementNum = int.Parse(jsonEntity["ElementNum"].ToString()); | ||||
@@ -0,0 +1,12 @@ | |||||
@{ | |||||
ViewBag.Title = "学生宿舍管理"; | |||||
Layout = "~/Views/Shared/_Form.cshtml"; | |||||
} | |||||
<div class="lr-form-wrap"> | |||||
<div class="col-xs-12 lr-form-item" data-table="Acc_DormitoryBuild"> | |||||
<div class="lr-form-item-title">名称</div> | |||||
<input id="Name" type="text" class="form-control" /> | |||||
</div> | |||||
</div> | |||||
@Html.AppendJsFile("/Areas/LogisticsManagement/Views/Accommodation/FormBed.js") |
@@ -0,0 +1,52 @@ | |||||
/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) | |||||
* Copyright (c) 2013-2018 北京泉江科技有限公司 | |||||
* 创建人:超级管理员 | |||||
* 日 期:2019-04-26 15:02 | |||||
* 描 述:学生宿舍管理 | |||||
*/ | |||||
var acceptClick; | |||||
var keyValue = request('keyValue'); | |||||
var ParentID = request('ParentID'); | |||||
var bootstrap = function ($, learun) { | |||||
"use strict"; | |||||
var page = { | |||||
init: function () { | |||||
$('.lr-form-wrap').lrscroll(); | |||||
page.bind(); | |||||
page.initData(); | |||||
}, | |||||
bind: function () { | |||||
}, | |||||
initData: function () { | |||||
if (!!keyValue) { | |||||
$.lrSetForm(top.$.rootUrl + '/LogisticsManagement/Accommodation/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 + '/LogisticsManagement/Accommodation/SaveBedForm?keyValue=' + keyValue + '&ParentID=' + ParentID, postData, function (res) { | |||||
// 保存成功后才回调 | |||||
if (!!callBack) { | |||||
callBack(); | |||||
} | |||||
}); | |||||
}; | |||||
page.init(); | |||||
} |
@@ -17,23 +17,7 @@ var bootstrap = function ($, learun) { | |||||
page.initData(); | page.initData(); | ||||
}, | }, | ||||
bind: function () { | bind: function () { | ||||
//$('.Student').lrselect({ | |||||
// value: "stuid", | |||||
// text: "stuname", | |||||
// url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable', | |||||
// param: { code: "StuInfoBasic", strWhere: "ClassNo='" + Class + "'" }, | |||||
// select: function (item) { | |||||
// if (item) { | |||||
// console.log(item); | |||||
// $.each(arr, | |||||
// function(index, value) { | |||||
// console.log('arr_index',value); | |||||
// console.log('arr_index',value); | |||||
// }); | |||||
// } | |||||
// } | |||||
//}); | |||||
}, | }, | ||||
initData: function () { | initData: function () { | ||||
if (!!keyValue) { | if (!!keyValue) { | ||||
@@ -66,8 +66,9 @@ | |||||
<div class=" btn-group btn-group-sm"> | <div class=" btn-group btn-group-sm"> | ||||
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | <a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | ||||
<a id="lr_dormitoryAdd" class="btn btn-default"><i class="fa fa-pencil-square"></i> 批量添加宿舍</a> | <a id="lr_dormitoryAdd" class="btn btn-default"><i class="fa fa-pencil-square"></i> 批量添加宿舍</a> | ||||
<a id="lr_allocation" class="btn btn-default"><i class="fa fa-pencil-square"></i> 自动分配宿舍</a> | |||||
@*<a id="lr_syncdata" class="btn btn-default"><i class="fa fa-pencil-square"></i> 同步宿舍信息</a>*@ | |||||
<a id="lr_bedManage" class="btn btn-default"><i class="fa fa-pencil-square"></i> 床位管理</a> | |||||
@*<a id="lr_allocation" class="btn btn-default"><i class="fa fa-pencil-square"></i> 自动分配宿舍</a> | |||||
<a id="lr_syncdata" class="btn btn-default"><i class="fa fa-pencil-square"></i> 同步宿舍信息</a>*@ | |||||
</div> | </div> | ||||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | <div class=" btn-group btn-group-sm" learun-authorize="yes"> | ||||
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i> 新增宿舍</a> | <a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i> 新增宿舍</a> | ||||
@@ -247,7 +247,7 @@ var bootstrap = function ($, learun) { | |||||
var keyValue = $('#gridtable').jfGridValue('ID'); | var keyValue = $('#gridtable').jfGridValue('ID'); | ||||
if (learun.checkrow(keyValue)) { | if (learun.checkrow(keyValue)) { | ||||
if (keyValue.indexOf(',') != -1) { | if (keyValue.indexOf(',') != -1) { | ||||
learun.alert.warning("只能选择一条记录!"); | |||||
learun.alert.warning("只能选择一条记录进行编辑!"); | |||||
return false; | return false; | ||||
} | } | ||||
learun.layerForm({ | learun.layerForm({ | ||||
@@ -261,24 +261,10 @@ var bootstrap = function ($, learun) { | |||||
} | } | ||||
}); | }); | ||||
} | } | ||||
}); | }); | ||||
//分类管理 | |||||
$("#lr_Classify").on("click", function () { | |||||
learun.layerForm({ | |||||
id: 'indexBed', | |||||
title: '分类管理', | |||||
url: top.$.rootUrl + '/LogisticsManagement/Accommodation/IndexClassify', | |||||
width: 1200, | |||||
height: 780, | |||||
btn: null, | |||||
callBack: function (id) { | |||||
return top[id].acceptClick(refreshGirdData); | |||||
} | |||||
}); | |||||
}); | |||||
}, | }, | ||||
//初始化左侧树 | //初始化左侧树 | ||||
initTree: function () { | initTree: function () { | ||||
@@ -0,0 +1,61 @@ | |||||
@{ | |||||
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> | |||||
<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" learun-authorize="yes"> | |||||
<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> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
<div class="lr-layout-body" id="gridtable"></div> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
@*<div class="lr-layout lr-layout-left-center" id="lr_layout"> | |||||
<div class="lr-layout-left"> | |||||
<div class="lr-layout-wrap"> | |||||
<div class="lr-layout-title lrlt "> | |||||
树形列表 | |||||
<a id="tree_refresh" onmouseover="this.style.cursor='hand'">刷新</a> | |||||
</div> | |||||
<div id="dataTree" class="lr-layout-body"></div> | |||||
</div> | |||||
</div> | |||||
<div class="lr-layout-center"> | |||||
<div class="lr-layout-wrap "> | |||||
<div class="lr-layout-tool"> | |||||
<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" learun-authorize="yes"> | |||||
<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> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
<div class="lr-layout-body" id="gridtable"></div> | |||||
</div> | |||||
</div> | |||||
</div>*@ | |||||
@Html.AppendJsFile("/Areas/LogisticsManagement/Views/Accommodation/IndexBed.js") |
@@ -0,0 +1,110 @@ | |||||
/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) | |||||
* Copyright (c) 2013-2018 北京泉江科技有限公司 | |||||
* 创建人:超级管理员 | |||||
* 日 期:2019-04-26 15:02 | |||||
* 描 述:学生宿舍管理 | |||||
*/ | |||||
var refreshGirdData; | |||||
var acceptClick; | |||||
var selectedParent = {}; | |||||
var ParentID = request('ParentID'); | |||||
var bootstrap = function ($, learun) { | |||||
"use strict"; | |||||
var page = { | |||||
init: function () { | |||||
page.initGird(); | |||||
page.bind(); | |||||
}, | |||||
bind: function () { | |||||
// 刷新 | |||||
$('#lr_refresh').on('click', function () { | |||||
location.reload(); | |||||
}); | |||||
// 新增 | |||||
$('#lr_add').on('click', function () { | |||||
learun.layerForm({ | |||||
id: 'form', | |||||
title: '新增', | |||||
url: top.$.rootUrl + '/LogisticsManagement/Accommodation/FormBed?ParentID=' + ParentID, | |||||
width: 400, | |||||
height: 300, | |||||
callBack: function (id) { | |||||
return top[id].acceptClick(refreshGirdData); | |||||
} | |||||
}); | |||||
}); | |||||
// 编辑 | |||||
$('#lr_edit').on('click', function () { | |||||
var keyValue = $('#gridtable').jfGridValue('ID'); | |||||
if (learun.checkrow(keyValue)) { | |||||
if (keyValue.indexOf(',') != -1) { | |||||
learun.alert.warning("只能选择一条记录进行编辑!"); | |||||
return false; | |||||
} | |||||
learun.layerForm({ | |||||
id: 'form', | |||||
title: '编辑', | |||||
url: top.$.rootUrl + '/LogisticsManagement/Accommodation/FormBed?keyValue=' + keyValue + '&ParentID=' + ParentID, | |||||
width: 400, | |||||
height: 300, | |||||
callBack: function (id) { | |||||
return top[id].acceptClick(refreshGirdData); | |||||
} | |||||
}); | |||||
} | |||||
}); | |||||
// 删除 | |||||
$('#lr_delete').on('click', function () { | |||||
var keyValue = $('#gridtable').jfGridValue('ID'); | |||||
if (learun.checkrow(keyValue)) { | |||||
learun.layerConfirm('是否确认删除该项!', function (res) { | |||||
if (res) { | |||||
learun.deleteForm(top.$.rootUrl + '/LogisticsManagement/Accommodation/DeleteBed', { keyValue: keyValue, ParentID: ParentID }, function () { | |||||
refreshGirdData(); | |||||
}); | |||||
} | |||||
}); | |||||
} | |||||
}); | |||||
// 打印 | |||||
$('#lr_print').on('click', function () { | |||||
$('#gridtable').jqprintTable(); | |||||
}); | |||||
}, | |||||
// 初始化列表 | |||||
initGird: function () { | |||||
$('#gridtable').jfGrid({ | |||||
url: top.$.rootUrl + '/LogisticsManagement/Accommodation/GetBedListByRoomId?RoomId=' + ParentID, | |||||
headData: [ | |||||
{ label: "名称", name: "Name", width: 100, align: "left" }, | |||||
], | |||||
mainId: 'ID', | |||||
isPage: false, | |||||
//isMultiselect: true, | |||||
//sidx: 'ApartmentId asc,UnitId asc ,FloorId asc ', | |||||
//sord: 'ASC', | |||||
}); | |||||
page.search(); | |||||
}, | |||||
search: function (param) { | |||||
param = param || {}; | |||||
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | |||||
} | |||||
}; | |||||
refreshGirdData = function () { | |||||
page.search(); | |||||
}; | |||||
// 保存数据 | |||||
acceptClick = function (callBack) { | |||||
if (!!callBack) { | |||||
callBack(); | |||||
} | |||||
}; | |||||
page.init(); | |||||
} |
@@ -1300,6 +1300,7 @@ | |||||
<Content Include="Areas\EducationalAdministration\Views\TeachPlan\Index.js" /> | <Content Include="Areas\EducationalAdministration\Views\TeachPlan\Index.js" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\TeachSwitch\Form.js" /> | <Content Include="Areas\EducationalAdministration\Views\TeachSwitch\Form.js" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\TeachSwitch\Index.js" /> | <Content Include="Areas\EducationalAdministration\Views\TeachSwitch\Index.js" /> | ||||
<Content Include="Areas\LogisticsManagement\Views\Accommodation\FormBed.js" /> | |||||
<Content Include="Areas\LogisticsManagement\Views\Accommodation\FormRoom.js" /> | <Content Include="Areas\LogisticsManagement\Views\Accommodation\FormRoom.js" /> | ||||
<Content Include="Areas\LogisticsManagement\Views\Accommodation\FormClass.js" /> | <Content Include="Areas\LogisticsManagement\Views\Accommodation\FormClass.js" /> | ||||
<Content Include="Areas\LogisticsManagement\Views\Accommodation\FormDept.js" /> | <Content Include="Areas\LogisticsManagement\Views\Accommodation\FormDept.js" /> | ||||
@@ -1310,6 +1311,7 @@ | |||||
<Content Include="Areas\LogisticsManagement\Views\Accommodation\FormDept.js" /> | <Content Include="Areas\LogisticsManagement\Views\Accommodation\FormDept.js" /> | ||||
<Content Include="Areas\LogisticsManagement\Views\Accommodation\Allocation.js" /> | <Content Include="Areas\LogisticsManagement\Views\Accommodation\Allocation.js" /> | ||||
<Content Include="Areas\LogisticsManagement\Views\Accommodation\DormitoryAdd.js" /> | <Content Include="Areas\LogisticsManagement\Views\Accommodation\DormitoryAdd.js" /> | ||||
<Content Include="Areas\LogisticsManagement\Views\Accommodation\IndexBed.js" /> | |||||
<Content Include="Areas\LogisticsManagement\Views\Accommodation\IndexDistribution.js" /> | <Content Include="Areas\LogisticsManagement\Views\Accommodation\IndexDistribution.js" /> | ||||
<Content Include="Areas\LogisticsManagement\Views\Accommodation\IndexClassify.js" /> | <Content Include="Areas\LogisticsManagement\Views\Accommodation\IndexClassify.js" /> | ||||
<Content Include="Areas\LogisticsManagement\Views\Accommodation\IndexBed.js" /> | <Content Include="Areas\LogisticsManagement\Views\Accommodation\IndexBed.js" /> | ||||
@@ -7584,6 +7586,8 @@ | |||||
<Content Include="Areas\LogisticsManagement\Views\Accommodation\FormDept.cshtml" /> | <Content Include="Areas\LogisticsManagement\Views\Accommodation\FormDept.cshtml" /> | ||||
<Content Include="Areas\LogisticsManagement\Views\Accommodation\FormClass.cshtml" /> | <Content Include="Areas\LogisticsManagement\Views\Accommodation\FormClass.cshtml" /> | ||||
<Content Include="Areas\LogisticsManagement\Views\Accommodation\FormRoom.cshtml" /> | <Content Include="Areas\LogisticsManagement\Views\Accommodation\FormRoom.cshtml" /> | ||||
<Content Include="Areas\LogisticsManagement\Views\Accommodation\IndexBed.cshtml" /> | |||||
<Content Include="Areas\LogisticsManagement\Views\Accommodation\FormBed.cshtml" /> | |||||
<None Include="Properties\PublishProfiles\CustomProfile.pubxml" /> | <None Include="Properties\PublishProfiles\CustomProfile.pubxml" /> | ||||
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" /> | <None Include="Properties\PublishProfiles\FolderProfile.pubxml" /> | ||||
<Content Include="Views\Login\Default-beifen.cshtml" /> | <Content Include="Views\Login\Default-beifen.cshtml" /> | ||||
@@ -584,6 +584,31 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||||
} | } | ||||
} | } | ||||
/// <summary> | |||||
/// 删除实体数据 | |||||
/// <param name="keyValue">主键</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
public void DeleteBed(string keyValue, string ParentID) | |||||
{ | |||||
try | |||||
{ | |||||
accommodationService.DeleteBed(keyValue, ParentID); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | /// <summary> | ||||
/// 保存实体数据(新增、修改) | /// 保存实体数据(新增、修改) | ||||
/// <param name="keyValue">主键</param> | /// <param name="keyValue">主键</param> | ||||
@@ -608,6 +633,32 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||||
} | } | ||||
} | } | ||||
/// <summary> | |||||
/// 保存实体数据(新增、修改) | |||||
/// <param name="keyValue">主键</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
public void SaveBedEntity(string keyValue,string ParentID, Acc_DormitoryBuildEntity entity) | |||||
{ | |||||
try | |||||
{ | |||||
accommodationService.SaveBedEntity(keyValue, ParentID, entity); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | /// <summary> | ||||
/// 分配系 | /// 分配系 | ||||
/// </summary> | /// </summary> | ||||
@@ -71,6 +71,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||||
/// <summary> | /// <summary> | ||||
/// <returns></returns> | /// <returns></returns> | ||||
void DeleteEntity(string keyValue); | void DeleteEntity(string keyValue); | ||||
void DeleteBed(string keyValue, string ParentID); | |||||
string GetBuildType(string parentID); | string GetBuildType(string parentID); | ||||
string GetParentBuildType(string keyValue); | string GetParentBuildType(string keyValue); | ||||
@@ -80,6 +81,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||||
/// <summary> | /// <summary> | ||||
/// <returns></returns> | /// <returns></returns> | ||||
void SaveEntity(string keyValue, Acc_DormitoryBuildEntity entity); | void SaveEntity(string keyValue, Acc_DormitoryBuildEntity entity); | ||||
void SaveBedEntity(string keyValue,string ParentID, Acc_DormitoryBuildEntity entity); | |||||
void SaveDeptClass(string keyValue, Acc_DormitoryBuildEntity entity,int type); | void SaveDeptClass(string keyValue, Acc_DormitoryBuildEntity entity,int type); | ||||
void SaveRoom(string RoomId, List<Acc_DormitoryBuildEntity> list); | void SaveRoom(string RoomId, List<Acc_DormitoryBuildEntity> list); | ||||
@@ -1021,6 +1021,27 @@ a.name as ApartmentName,b.name as UnitName,c.Name as FloorName | |||||
} | } | ||||
} | } | ||||
public void DeleteBed(string keyValue, string ParentID) | |||||
{ | |||||
try | |||||
{ | |||||
this.BaseRepository("CollegeMIS").Delete<Acc_RewardEntity>(t => t.ID == keyValue); | |||||
UpdateCheckInNum(ParentID); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
public void DeleteAll(string parentid) | public void DeleteAll(string parentid) | ||||
{ | { | ||||
var list = this.BaseRepository("CollegeMIS").FindList<Acc_DormitoryBuildEntity>(a => a.ParentID == parentid).ToList(); | var list = this.BaseRepository("CollegeMIS").FindList<Acc_DormitoryBuildEntity>(a => a.ParentID == parentid).ToList(); | ||||
@@ -1579,6 +1600,74 @@ a.name as ApartmentName,b.name as UnitName,c.Name as FloorName | |||||
} | } | ||||
} | } | ||||
/// <summary> | |||||
/// 保存实体数据(新增、修改) | |||||
/// <param name="keyValue">主键</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
public void SaveBedEntity(string keyValue, string ParentID, Acc_DormitoryBuildEntity entity) | |||||
{ | |||||
var db = this.BaseRepository("CollegeMIS"); | |||||
try | |||||
{ | |||||
db.BeginTrans(); | |||||
if (!string.IsNullOrEmpty(keyValue)) | |||||
{ | |||||
entity.Modify(keyValue); | |||||
db.Update(entity); | |||||
} | |||||
else | |||||
{ | |||||
var parentEntity = db.FindEntity<Acc_DormitoryBuildEntity>(ParentID); | |||||
entity.Create(); | |||||
entity.ApartmentId = parentEntity.ApartmentId; | |||||
entity.UnitId = parentEntity.UnitId; | |||||
entity.FloorId = parentEntity.FloorId; | |||||
entity.ParentID = ParentID; | |||||
entity.BuildType = "5"; | |||||
db.Insert(entity); | |||||
} | |||||
db.Commit(); | |||||
UpdateCheckInNum(ParentID); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
private void UpdateCheckInNum(string ParentID) | |||||
{ | |||||
try | |||||
{ | |||||
string sql = $@"update [dbo].[Acc_DormitoryBuild] set RoomType=( | |||||
select count(1) from [dbo].[Acc_DormitoryBuild] where ParentId='{ParentID}' and BuildType='5' | |||||
) | |||||
where ID='{ParentID}' | |||||
"; | |||||
this.BaseRepository("CollegeMIS").ExecuteBySql(sql); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
public void SaveDeptClass(string keyValue, Acc_DormitoryBuildEntity entity, int type) | public void SaveDeptClass(string keyValue, Acc_DormitoryBuildEntity entity, int type) | ||||
{ | { | ||||
try | try | ||||