diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TeachPlanController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TeachPlanController.cs index 04ce04ac1..fc8e258a8 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TeachPlanController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TeachPlanController.cs @@ -26,7 +26,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [HttpGet] public ActionResult Index() { - return View(); + return View(); } /// /// 表单页 @@ -35,7 +35,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [HttpGet] public ActionResult Form() { - return View(); + return View(); } #endregion @@ -82,8 +82,9 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [AjaxOnly] public ActionResult GetFormData(string keyValue) { - var TeachPlanData = teachPlanIBLL.GetTeachPlanEntity( keyValue ); - var jsonData = new { + var TeachPlanData = teachPlanIBLL.GetTeachPlanEntity(keyValue); + var jsonData = new + { TeachPlan = TeachPlanData, }; return Success(jsonData); @@ -114,8 +115,24 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [AjaxOnly] public ActionResult SaveForm(string keyValue, string strEntity) { - UserInfo userInfo = LoginUserInfo.Get(); TeachPlanEntity entity = strEntity.ToObject(); - teachPlanIBLL.SaveEntity(userInfo,keyValue,entity); + UserInfo userInfo = LoginUserInfo.Get(); + TeachPlanEntity entity = strEntity.ToObject(); + var planList = teachPlanIBLL.GetPlan(entity.PlanNo); + if (string.IsNullOrEmpty(keyValue)) + { + if (planList != null) + { + return Fail("计划号已存在!"); + } + } + else + { + if (planList != null && planList.ID != keyValue) + { + return Fail("计划号已存在!"); + } + } + teachPlanIBLL.SaveEntity(userInfo, keyValue, entity); return Success("保存成功!"); } #endregion diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnroll/EnrollForm.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnroll/EnrollForm.js index b5a2cf01f..ed1919e96 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnroll/EnrollForm.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnroll/EnrollForm.js @@ -39,21 +39,21 @@ var bootstrap = function ($, learun) { value: "ccode", text: "cname", maxHeight: 200, - select: function (item) { - if (item) { - var code = $("#City").lrselectGet(); - //县区 - $('#County').lrselectRefresh({ - allowSearch: true, - //type: 'multiple', - url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=DIC_AREA', - param: { strWhere: "1=1 and charindex(aparent,('" + code + "'))>0 " }, - value: "acode", - text: "aname", - maxHeight: 200, - }); - } - } + //select: function (item) { + // if (item) { + // var code = $("#City").lrselectGet(); + // //县区 + // $('#County').lrselectRefresh({ + // allowSearch: true, + // //type: 'multiple', + // url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=DIC_AREA', + // param: { strWhere: "1=1 and charindex(aparent,('" + code + "'))>0 " }, + // value: "acode", + // text: "aname", + // maxHeight: 200, + // }); + // } + //} }); //县区 $('#County').lrselect({ diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachPlan/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachPlan/Form.cshtml index 7e8d99bb2..fc1545681 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachPlan/Form.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachPlan/Form.cshtml @@ -4,8 +4,8 @@ }
-
计划号
- +
计划号*
+
版本号
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachPlan/TeachPlanBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachPlan/TeachPlanBLL.cs index 21d34a299..cef658067 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachPlan/TeachPlanBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachPlan/TeachPlanBLL.cs @@ -91,6 +91,29 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + /// + /// 获取TeachPlan表实体数据 + /// 主键 + /// + /// + public TeachPlanEntity GetPlan(string PlanNo) + { + try + { + return teachPlanService.GetPlan(PlanNo); + } + 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/EducationalAdministration/TeachPlan/TeachPlanIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachPlan/TeachPlanIBLL.cs index 396ff7b33..7bee1b77a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachPlan/TeachPlanIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachPlan/TeachPlanIBLL.cs @@ -34,6 +34,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// /// TeachPlanEntity GetTeachPlanEntity(string keyValue); + TeachPlanEntity GetPlan(string PlanNo); #endregion #region 提交数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachPlan/TeachPlanService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachPlan/TeachPlanService.cs index 61c5de8b5..21e217030 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachPlan/TeachPlanService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachPlan/TeachPlanService.cs @@ -57,12 +57,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } if (!queryParam["DeptNo"].IsEmpty()) { - dp.Add("DeptNo",queryParam["DeptNo"].ToString(), DbType.String); + dp.Add("DeptNo", queryParam["DeptNo"].ToString(), DbType.String); strSql.Append(" AND t.DeptNo = @DeptNo "); } if (!queryParam["MajorNo"].IsEmpty()) { - dp.Add("MajorNo",queryParam["MajorNo"].ToString(), DbType.String); + dp.Add("MajorNo", queryParam["MajorNo"].ToString(), DbType.String); strSql.Append(" AND t.MajorNo = @MajorNo "); } if (!queryParam["Grade"].IsEmpty()) @@ -70,7 +70,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration dp.Add("Grade", "%" + queryParam["Grade"].ToString() + "%", DbType.String); strSql.Append(" AND t.Grade Like @Grade "); } - return this.BaseRepository().FindList(strSql.ToString(),dp, pagination); + return this.BaseRepository().FindList(strSql.ToString(), dp, pagination); } catch (Exception ex) { @@ -122,12 +122,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } if (!queryParam["DeptNo"].IsEmpty()) { - dp.Add("DeptNo",queryParam["DeptNo"].ToString(), DbType.String); + dp.Add("DeptNo", queryParam["DeptNo"].ToString(), DbType.String); strSql.Append(" AND t.DeptNo = @DeptNo "); } if (!queryParam["MajorNo"].IsEmpty()) { - dp.Add("MajorNo",queryParam["MajorNo"].ToString(), DbType.String); + dp.Add("MajorNo", queryParam["MajorNo"].ToString(), DbType.String); strSql.Append(" AND t.MajorNo = @MajorNo "); } if (!queryParam["Grade"].IsEmpty()) @@ -135,7 +135,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration dp.Add("Grade", "%" + queryParam["Grade"].ToString() + "%", DbType.String); strSql.Append(" AND t.Grade Like @Grade "); } - return this.BaseRepository().FindList(strSql.ToString(),dp); + return this.BaseRepository().FindList(strSql.ToString(), dp); } catch (Exception ex) { @@ -173,7 +173,29 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } - + /// + /// 获取TeachPlan表实体数据 + /// 主键 + /// + /// + public TeachPlanEntity GetPlan(string PlanNo) + { + try + { + return this.BaseRepository().FindEntity(x => x.PlanNo == PlanNo); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } #endregion #region 提交数据 @@ -187,7 +209,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { try { - this.BaseRepository().Delete(t=>t.ID == keyValue); + this.BaseRepository().Delete(t => t.ID == keyValue); } catch (Exception ex) { @@ -207,13 +229,13 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 主键 /// /// - public void SaveEntity( UserInfo userInfo, string keyValue, TeachPlanEntity entity) + public void SaveEntity(UserInfo userInfo, string keyValue, TeachPlanEntity entity) { try { if (!string.IsNullOrEmpty(keyValue)) { - entity.Modify(keyValue,userInfo); + entity.Modify(keyValue, userInfo); this.BaseRepository().Update(entity); } else