From 1be455a641c093aad3adae8bff12a4189005eb96 Mon Sep 17 00:00:00 2001 From: ndbs Date: Fri, 29 Apr 2022 18:21:54 +0800 Subject: [PATCH] =?UTF-8?q?=E9=97=AE=E5=8D=B7=E7=AE=A1=E7=90=86=E5=88=86?= =?UTF-8?q?=E7=B1=BB=E5=88=A0=E9=99=A4=E6=8F=90=E7=A4=BA=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E5=AD=90=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Ask/Controllers/Ask_TypeController.cs | 14 +++++++++---- .../Ask/Ask_Type/Ask_TypeBLL.cs | 19 ++++++++++++++++++ .../Ask/Ask_Type/Ask_TypeIBLL.cs | 2 ++ .../Ask/Ask_Type/Ask_TypeService.cs | 20 +++++++++++++++++++ 4 files changed, 51 insertions(+), 4 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Controllers/Ask_TypeController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Controllers/Ask_TypeController.cs index 1e91e20ac..bd4aa936a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Controllers/Ask_TypeController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Controllers/Ask_TypeController.cs @@ -27,7 +27,7 @@ namespace Learun.Application.Web.Areas.Ask.Controllers [HttpGet] public ActionResult Index() { - return View(); + return View(); } /// /// 表单页 @@ -85,8 +85,9 @@ namespace Learun.Application.Web.Areas.Ask.Controllers [AjaxOnly] public ActionResult GetFormData(string keyValue) { - var Ask_TypeData = ask_TypeIBLL.GetAsk_TypeEntity( keyValue ); - var jsonData = new { + var Ask_TypeData = ask_TypeIBLL.GetAsk_TypeEntity(keyValue); + var jsonData = new + { Ask_Type = Ask_TypeData, }; return Success(jsonData); @@ -104,6 +105,11 @@ namespace Learun.Application.Web.Areas.Ask.Controllers [AjaxOnly] public ActionResult DeleteForm(string keyValue) { + var SonList = ask_TypeIBLL.GetAsk_TypeEntity(keyValue); + if (SonList != null) + { + return Fail("删除失败,请先删除子项!"); + } ask_TypeIBLL.DeleteEntity(keyValue); return Success("删除成功!"); } @@ -118,7 +124,7 @@ namespace Learun.Application.Web.Areas.Ask.Controllers public ActionResult SaveForm(string keyValue, string strEntity) { Ask_TypeEntity entity = strEntity.ToObject(); - ask_TypeIBLL.SaveEntity(keyValue,entity); + ask_TypeIBLL.SaveEntity(keyValue, entity); return Success("保存成功!"); } #endregion diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Ask/Ask_Type/Ask_TypeBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Ask/Ask_Type/Ask_TypeBLL.cs index d2e8c2a64..e8b6b4088 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Ask/Ask_Type/Ask_TypeBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Ask/Ask_Type/Ask_TypeBLL.cs @@ -65,6 +65,25 @@ namespace Learun.Application.TwoDevelopment.Ask } } } + public Ask_TypeEntity GetSonEntity(string keyValue) + { + try + { + return ask_TypeService.GetSonEntity(keyValue); + } + 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/Ask/Ask_Type/Ask_TypeIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Ask/Ask_Type/Ask_TypeIBLL.cs index eadb529ec..5d625090b 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Ask/Ask_Type/Ask_TypeIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Ask/Ask_Type/Ask_TypeIBLL.cs @@ -30,6 +30,8 @@ namespace Learun.Application.TwoDevelopment.Ask /// /// Ask_TypeEntity GetAsk_TypeEntity(string keyValue); + Ask_TypeEntity GetSonEntity(string keyValue); + #endregion #region 提交数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Ask/Ask_Type/Ask_TypeService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Ask/Ask_Type/Ask_TypeService.cs index 4a0ebfc25..3ecd9a15c 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Ask/Ask_Type/Ask_TypeService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Ask/Ask_Type/Ask_TypeService.cs @@ -81,6 +81,26 @@ namespace Learun.Application.TwoDevelopment.Ask } } } + + public Ask_TypeEntity GetSonEntity(string keyValue) + { + try + { + return this.BaseRepository().FindEntity(x=>x.ATPId== keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + public IEnumerable GetList(string queryJson) { try