新增宿舍
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Index.js
index 3d4756ee6..97304ee77 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Index.js
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Index.js
@@ -247,7 +247,7 @@ var bootstrap = function ($, learun) {
var keyValue = $('#gridtable').jfGridValue('ID');
if (learun.checkrow(keyValue)) {
if (keyValue.indexOf(',') != -1) {
- learun.alert.warning("只能选择一条记录!");
+ learun.alert.warning("只能选择一条记录进行编辑!");
return false;
}
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 () {
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj
index 30f9f4240..eb5218731 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj
@@ -1300,6 +1300,7 @@
+
@@ -1310,6 +1311,7 @@
+
@@ -7584,6 +7586,8 @@
+
+
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationBLL.cs
index ee125e205..d1569482a 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationBLL.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationBLL.cs
@@ -583,6 +583,31 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement
}
}
+
+ ///
+ /// 删除实体数据
+ /// 主键
+ ///
+ ///
+ 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);
+ }
+ }
+ }
+
///
/// 保存实体数据(新增、修改)
/// 主键
@@ -607,6 +632,32 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement
}
}
+ ///
+ /// 保存实体数据(新增、修改)
+ /// 主键
+ ///
+ ///
+ 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);
+ }
+ }
+ }
+
+
+
///
/// 分配系
///
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationIBLL.cs
index 84cee539c..8fc202a97 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationIBLL.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationIBLL.cs
@@ -71,6 +71,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement
///
///
void DeleteEntity(string keyValue);
+ void DeleteBed(string keyValue, string ParentID);
string GetBuildType(string parentID);
string GetParentBuildType(string keyValue);
@@ -80,6 +81,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement
///
///
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 SaveRoom(string RoomId, List list);
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationService.cs
index 1573f0d4e..0fb58ff46 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationService.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationService.cs
@@ -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(t => t.ID == keyValue);
+ UpdateCheckInNum(ParentID);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
+
public void DeleteAll(string parentid)
{
var list = this.BaseRepository("CollegeMIS").FindList(a => a.ParentID == parentid).ToList();
@@ -1579,6 +1600,74 @@ a.name as ApartmentName,b.name as UnitName,c.Name as FloorName
}
}
+
+ ///
+ /// 保存实体数据(新增、修改)
+ /// 主键
+ ///
+ ///
+ 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(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)
{
try