diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/StudentWork/Controllers/SW_Ask_TypeController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/StudentWork/Controllers/SW_Ask_TypeController.cs
index cdeb3e838..ac14af731 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/StudentWork/Controllers/SW_Ask_TypeController.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/StudentWork/Controllers/SW_Ask_TypeController.cs
@@ -18,6 +18,9 @@ namespace Learun.Application.Web.Areas.StudentWork.Controllers
public class SW_Ask_TypeController : MvcControllerBase
{
private SW_Ask_TypeIBLL sW_Ask_TypeIBLL = new SW_Ask_TypeBLL();
+ private SW_Ask_MainIBLL sW_Ask_MainIBLL = new SW_Ask_MainBLL();
+ private SW_Ask_Batch_TypeIBLL sW_Ask_Batch_TypeIBLL = new SW_Ask_Batch_TypeBLL();
+ private SW_Ask_NotHaveAll_TypeIBLL sW_Ask_NotHaveAll_TypeIBLL = new SW_Ask_NotHaveAll_TypeBLL();
#region 视图功能
@@ -173,6 +176,25 @@ namespace Learun.Application.Web.Areas.StudentWork.Controllers
///
public ActionResult ModifyStatus(string keyValue, int status, string processId)
{
+ if (status == 0)
+ {
+ var mainList = sW_Ask_MainIBLL.GetSW_Ask_MainListByTId(keyValue);
+ if (mainList.Any())
+ {
+ return Fail("该类型在使用中,无法取消!");
+ }
+ var batchList = sW_Ask_Batch_TypeIBLL.GetListByTId(keyValue);
+ if (batchList.Any())
+ {
+ return Fail("该类型在使用中,无法取消!");
+ }
+ var nothaveList = sW_Ask_NotHaveAll_TypeIBLL.GetListByTId(keyValue);
+ if (nothaveList.Any())
+ {
+ return Fail("该类型在使用中,无法取消!");
+ }
+ }
+
sW_Ask_TypeIBLL.ModifyStatus(keyValue, status, processId);
return Success("提交成功!");
}
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/StudentWork/Views/SW_Ask_Type/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/StudentWork/Views/SW_Ask_Type/Index.cshtml
index db17163e0..be1969319 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/StudentWork/Views/SW_Ask_Type/Index.cshtml
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/StudentWork/Views/SW_Ask_Type/Index.cshtml
@@ -40,8 +40,9 @@
删除
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/StudentWork/Views/SW_Ask_Type/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/StudentWork/Views/SW_Ask_Type/Index.js
index 595c88aa2..30fed7040 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/StudentWork/Views/SW_Ask_Type/Index.js
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/StudentWork/Views/SW_Ask_Type/Index.js
@@ -113,6 +113,24 @@ var bootstrap = function ($, learun) {
});
}
});
+ // 取消提交
+ $('#lr_submitcancel').on('click', function () {
+ var keyValue = $('#gridtable').jfGridValue('Id');
+ if (learun.checkrow(keyValue)) {
+ var TStatus = $('#gridtable').jfGridValue('TStatus');
+ if (TStatus !== 1) {
+ learun.alert.warning("当前记录未提交!");
+ return false;
+ }
+ learun.layerConfirm('是否确认取消提交该项!', function (res) {
+ if (res) {
+ learun.postForm(top.$.rootUrl + '/StudentWork/SW_Ask_Type/ModifyStatus', { keyValue: keyValue, status: 0 }, function () {
+ refreshGirdData();
+ });
+ }
+ });
+ }
+ });
// 查看
$('#lr_view').on('click', function () {
var keyValue = $('#gridtable').jfGridValue('Id');
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/XmlConfig/database.config b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/XmlConfig/database.config
index 7755e9ea6..5936f0695 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/XmlConfig/database.config
+++ b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/XmlConfig/database.config
@@ -18,8 +18,8 @@
-->
-
-
-
+
+
+
\ No newline at end of file
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/StudentWork/SW_Ask_Batch_Type/SW_Ask_Batch_TypeBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/StudentWork/SW_Ask_Batch_Type/SW_Ask_Batch_TypeBLL.cs
index ebf4e095f..0d3ee9788 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/StudentWork/SW_Ask_Batch_Type/SW_Ask_Batch_TypeBLL.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/StudentWork/SW_Ask_Batch_Type/SW_Ask_Batch_TypeBLL.cs
@@ -63,6 +63,29 @@ namespace Learun.Application.TwoDevelopment.StudentWork
}
}
}
+ ///
+ /// 获取列表数据
+ ///
+ ///
+ public IEnumerable GetListByTId(string TId)
+ {
+ try
+ {
+ return sW_Ask_Batch_TypeService.GetListByTId(TId);
+ }
+ 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/StudentWork/SW_Ask_Batch_Type/SW_Ask_Batch_TypeIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/StudentWork/SW_Ask_Batch_Type/SW_Ask_Batch_TypeIBLL.cs
index fa8b3e6ed..e43f7f5a5 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/StudentWork/SW_Ask_Batch_Type/SW_Ask_Batch_TypeIBLL.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/StudentWork/SW_Ask_Batch_Type/SW_Ask_Batch_TypeIBLL.cs
@@ -27,6 +27,11 @@ namespace Learun.Application.TwoDevelopment.StudentWork
///
IEnumerable GetListByBId(string BId);
///
+ /// 获取列表数据
+ ///
+ ///
+ IEnumerable GetListByTId(string TId);
+ ///
/// 获取列表分页数据
/// 分页参数
///
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/StudentWork/SW_Ask_Batch_Type/SW_Ask_Batch_TypeService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/StudentWork/SW_Ask_Batch_Type/SW_Ask_Batch_TypeService.cs
index 8143d7a50..dbed27503 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/StudentWork/SW_Ask_Batch_Type/SW_Ask_Batch_TypeService.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/StudentWork/SW_Ask_Batch_Type/SW_Ask_Batch_TypeService.cs
@@ -80,6 +80,29 @@ namespace Learun.Application.TwoDevelopment.StudentWork
}
}
+ ///
+ /// 获取列表数据
+ ///
+ ///
+ public IEnumerable GetListByTId(string TId)
+ {
+ try
+ {
+ return this.BaseRepository().FindList(x => x.TId == TId);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
+
///
/// 获取列表分页数据
/// 分页参数
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/StudentWork/SW_Ask_Main/SW_Ask_MainBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/StudentWork/SW_Ask_Main/SW_Ask_MainBLL.cs
index afac94597..0bb292eb4 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/StudentWork/SW_Ask_Main/SW_Ask_MainBLL.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/StudentWork/SW_Ask_Main/SW_Ask_MainBLL.cs
@@ -163,6 +163,30 @@ namespace Learun.Application.TwoDevelopment.StudentWork
}
}
}
+
+ ///
+ /// 获取SW_Ask_Main表实体数据
+ /// 种类Id
+ ///
+ ///
+ public IEnumerable GetSW_Ask_MainListByTId(string tId)
+ {
+ try
+ {
+ return ask_MainService.GetSW_Ask_MainListByTId(tId);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowBusinessException(ex);
+ }
+ }
+ }
#endregion
#region 提交数据
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/StudentWork/SW_Ask_Main/SW_Ask_MainIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/StudentWork/SW_Ask_Main/SW_Ask_MainIBLL.cs
index 0806f8777..e38088dfb 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/StudentWork/SW_Ask_Main/SW_Ask_MainIBLL.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/StudentWork/SW_Ask_Main/SW_Ask_MainIBLL.cs
@@ -39,6 +39,12 @@ namespace Learun.Application.TwoDevelopment.StudentWork
SW_Ask_MainEntity GetSW_Ask_MainEntityAndQuestionsResult(string keyValue, string smid);
SW_Ask_MainEntity GetSW_Ask_MainEntityAndQuestionsResult(string processId);
+ ///
+ /// 获取SW_Ask_Main表实体数据
+ /// 种类Id
+ ///
+ ///
+ IEnumerable GetSW_Ask_MainListByTId(string tId);
#endregion
#region 提交数据
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/StudentWork/SW_Ask_Main/SW_Ask_MainService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/StudentWork/SW_Ask_Main/SW_Ask_MainService.cs
index 65464959c..1d7160922 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/StudentWork/SW_Ask_Main/SW_Ask_MainService.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/StudentWork/SW_Ask_Main/SW_Ask_MainService.cs
@@ -325,6 +325,29 @@ namespace Learun.Application.TwoDevelopment.StudentWork
}
}
+ ///
+ /// 获取SW_Ask_Main表实体数据
+ /// 种类Id
+ ///
+ ///
+ public IEnumerable GetSW_Ask_MainListByTId(string tId)
+ {
+ try
+ {
+ return BaseRepository().FindList(x => x.TId == tId);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
#endregion
#region 提交数据