@@ -242,7 +242,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||||
}; | }; | ||||
return Success(jsonData); | return Success(jsonData); | ||||
} | } | ||||
/// <summary> | /// <summary> | ||||
/// 获取当前学年学期 | /// 获取当前学年学期 | ||||
/// <summary> | /// <summary> | ||||
@@ -275,6 +275,15 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||||
openLessonPlanOfElectiveIBLL.DeleteEntity(keyValue); | openLessonPlanOfElectiveIBLL.DeleteEntity(keyValue); | ||||
return Success("删除成功!"); | return Success("删除成功!"); | ||||
} | } | ||||
[HttpPost] | |||||
[AjaxOnly] | |||||
public ActionResult DeleteElective(string keyValue) | |||||
{ | |||||
openLessonPlanOfElectiveIBLL.DeleteElective(keyValue); | |||||
return Success("删除成功!"); | |||||
} | |||||
/// <summary> | /// <summary> | ||||
/// 保存实体数据(新增、修改) | /// 保存实体数据(新增、修改) | ||||
/// <param name="keyValue">主键</param> | /// <param name="keyValue">主键</param> | ||||
@@ -450,7 +459,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||||
/// <summary> | /// <summary> | ||||
/// <returns></returns> | /// <returns></returns> | ||||
[HttpPost] | [HttpPost] | ||||
public ActionResult SaveStuNumMax(string keyValue,int StuNumMax) | |||||
public ActionResult SaveStuNumMax(string keyValue, int StuNumMax) | |||||
{ | { | ||||
openLessonPlanOfElectiveIBLL.SaveStuNumMax(keyValue, StuNumMax); | openLessonPlanOfElectiveIBLL.SaveStuNumMax(keyValue, StuNumMax); | ||||
@@ -253,8 +253,23 @@ var bootstrap = function ($, learun) { | |||||
var keyValue = $('#gridtable').jfGridValue('Id'); | var keyValue = $('#gridtable').jfGridValue('Id'); | ||||
if (learun.checkrow(keyValue)) { | if (learun.checkrow(keyValue)) { | ||||
var rowdata = $('#gridtable').jfGridGet('rowdata'); | var rowdata = $('#gridtable').jfGridGet('rowdata'); | ||||
console.log(rowdata); | |||||
try { | |||||
rowdata.forEach(function (item, index, row) { | |||||
if (!!item.StuNumMax || !!item.StuNumOfApply || !!item.StuNum) { | |||||
throw learun.alert.warning("人数上限、已报人数、通过人数大于0的不能删除!"); | |||||
} | |||||
if (!!item.ElectiveMajorList && item.ElectiveMajorList.length > 0) { | |||||
throw learun.alert.warning("已选专业的数据不允许删除!"); | |||||
} | |||||
}); | |||||
console.log(keyValue); | |||||
return; | |||||
learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/DeleteElective', { keyValue: keyValue }, | |||||
function () { | |||||
refreshGirdData(); | |||||
}); | |||||
} catch (e) { | |||||
} | |||||
} | } | ||||
}); | }); | ||||
}, | }, | ||||
@@ -160,6 +160,7 @@ var bootstrap = function ($, learun) { | |||||
} else { | } else { | ||||
param.Month = date.getMonth() + 1; | param.Month = date.getMonth() + 1; | ||||
} | } | ||||
//param.SqlParameter = " and ((classno is null or len(classno)=0) and (departmentid is not null or len(departmentid)>0)) "; | |||||
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | ||||
} | } | ||||
}; | }; | ||||
@@ -186,6 +186,25 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
} | } | ||||
} | } | ||||
public void DeleteElective(string keyValue) | |||||
{ | |||||
try | |||||
{ | |||||
openLessonPlanOfElectiveService.DeleteElective(keyValue); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | /// <summary> | ||||
/// 保存实体数据(新增、修改) | /// 保存实体数据(新增、修改) | ||||
/// <param name="keyValue">主键</param> | /// <param name="keyValue">主键</param> | ||||
@@ -63,6 +63,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
/// <summary> | /// <summary> | ||||
/// <returns></returns> | /// <returns></returns> | ||||
void DeleteEntity(string keyValue); | void DeleteEntity(string keyValue); | ||||
void DeleteElective(string keyValue); | |||||
/// <summary> | /// <summary> | ||||
/// 保存实体数据(新增、修改) | /// 保存实体数据(新增、修改) | ||||
/// <param name="keyValue">主键</param> | /// <param name="keyValue">主键</param> | ||||
@@ -401,6 +401,47 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
} | } | ||||
} | } | ||||
/// <summary> | |||||
/// 删除选修课课程 | |||||
/// </summary> | |||||
/// <param name="keyValue"></param> | |||||
public void DeleteElective(string keyValue) | |||||
{ | |||||
try | |||||
{ | |||||
/* | |||||
* ElectiveMajor | |||||
[dbo].[OpenLessonPlanOfElective] | |||||
[dbo].[OpenLessonPlanOfElectiveChange] | |||||
[dbo].[OpenLessonPlanOfElectiveDel] | |||||
[dbo].[ArrangeLessonTermOfElective] 课号 老师 上课时间 节次 上课教室 学年学期 | |||||
*/ | |||||
if (keyValue.Contains(",")) | |||||
{ | |||||
keyValue = string.Join("','", keyValue.Split(',')); | |||||
} | |||||
var list = this.BaseRepository("CollegeMIS").FindList<OpenLessonPlanOfElectiveEntity>($"select * from OpenLessonPlanOfElective where Id in ('{keyValue}')"); | |||||
foreach (var entity in list) | |||||
{ | |||||
} | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | /// <summary> | ||||
/// 保存实体数据(新增、修改) | /// 保存实体数据(新增、修改) | ||||
/// <param name="keyValue">主键</param> | /// <param name="keyValue">主键</param> | ||||
@@ -47,6 +47,12 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop | |||||
{ | { | ||||
strSql.Append($" AND departmentid='{queryParam["Departmentid"].ToString()}'"); | strSql.Append($" AND departmentid='{queryParam["Departmentid"].ToString()}'"); | ||||
} | } | ||||
if (!queryParam["SqlParameter"].IsEmpty()) | |||||
{ | |||||
strSql.Append(queryParam["SqlParameter"].ToString()); | |||||
} | |||||
return this.BaseRepository().FindList<LoginStatisticsEntity>(strSql.ToString(), dp, paginationobj); | return this.BaseRepository().FindList<LoginStatisticsEntity>(strSql.ToString(), dp, paginationobj); | ||||
} | } | ||||
catch (Exception ex) | catch (Exception ex) | ||||