Просмотр исходного кода

选修课课程 新增功能

新疆影视学院高职
zhangli 2 лет назад
Родитель
Сommit
46974c5bb6
9 измененных файлов: 268 добавлений и 1 удалений
  1. +30
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/OpenLessonPlanOfElectiveController.cs
  2. +31
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/FormElective.cshtml
  3. +110
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/FormElective.js
  4. +1
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/MergeIndex.cshtml
  5. +16
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/MergeIndex.js
  6. +2
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj
  7. +19
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/OpenLessonPlanOfElective/OpenLessonPlanOfElectiveBLL.cs
  8. +1
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/OpenLessonPlanOfElective/OpenLessonPlanOfElectiveIBLL.cs
  9. +58
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/OpenLessonPlanOfElective/OpenLessonPlanOfElectiveService.cs

+ 30
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/OpenLessonPlanOfElectiveController.cs Просмотреть файл

@@ -81,6 +81,12 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
{
return View();
}

[HttpGet]
public ActionResult FormElective()
{
return View();
}
#endregion

#region 获取数据
@@ -191,6 +197,30 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
openLessonPlanOfElectiveIBLL.SaveEntity(keyValue, entity);
return Success("保存成功!");
}


[HttpPost]
[ValidateAntiForgeryToken]
[AjaxOnly]
public ActionResult AddForm(string keyValue, string strEntity)
{
var loginUserInfo = LoginUserInfo.Get();

OpenLessonPlanOfElectiveEntity entity = strEntity.ToObject<OpenLessonPlanOfElectiveEntity>();
entity.ModifyTime = DateTime.Now;
entity.ModifyUserId = loginUserInfo.userId;
entity.ModifyUserName = loginUserInfo.realName;

entity.LessonSection = "57,58";
entity.LessonTime = "18:00-18:45,18:45-19:30";
entity.F_SchoolId = loginUserInfo.companyId;
entity.LessonSortNo = "2";
entity.MakeDate = DateTime.Now;
entity.CheckMark = "1";
openLessonPlanOfElectiveIBLL.AddForm(keyValue, entity);
return Success("保存成功!");
}

/// <summary>
/// 保存实体数据(新增、修改)
/// <param name="keyValue">主键</param>


+ 31
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/FormElective.cshtml Просмотреть файл

@@ -0,0 +1,31 @@
@{
ViewBag.Title = "选修课课程信息";
Layout = "~/Views/Shared/_Form.cshtml";
}
<div class="lr-form-wrap">
<div class="col-xs-12 lr-form-item" data-table="OpenLessonPlanOfElective">
<div class="lr-form-item-title">学年<font face="宋体">*</font> </div>
<div id="AcademicYearNo" isvalid="yes" checkexpession="NotNull" ></div>
</div>
<div class="col-xs-12 lr-form-item" data-table="OpenLessonPlanOfElective">
<div class="lr-form-item-title">学期<font face="宋体">*</font> </div>
<div id="Semester" isvalid="yes" checkexpession="NotNull"></div>
</div>
<div class="col-xs-12 lr-form-item" data-table="OpenLessonPlanOfElective">
<div class="lr-form-item-title">课程<font face="宋体">*</font></div>
<div id="LessonNo" isvalid="yes" checkexpession="NotNull"></div>
</div>
@*<div class="col-xs-12 lr-form-item" data-table="OpenLessonPlanOfElective">
<div class="lr-form-item-title">学分 </div>
<input id="StudyScore" type="text" class="form-control" />
</div>*@
<div class="col-xs-12 lr-form-item" data-table="OpenLessonPlanOfElective">
<div class="lr-form-item-title">教师<font face="宋体">*</font></div>
<div id="EmpNo" isvalid="yes" checkexpession="NotNull"></div>
</div>
<div class="col-xs-12 lr-form-item" data-table="OpenLessonPlanOfElective">
<div class="lr-form-item-title">教室<font face="宋体">*</font></div>
<div id="ClassRoomNo" isvalid="yes" checkexpession="NotNull"></div>
</div>
</div>
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/FormElective.js")

+ 110
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/FormElective.js Просмотреть файл

@@ -0,0 +1,110 @@
/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
* Copyright (c) 2013-2018 北京泉江科技有限公司
* 创建人:超级管理员
* 日 期:2019-05-14 10:02
* 描 述:选修课课程信息
*/
var acceptClick;
var keyValue = request('keyValue');
var bootstrap = function ($, learun) {
"use strict";
var page = {
init: function () {
$('.lr-form-wrap').lrscroll();
page.bind();
page.initData();
},
bind: function () {
$('#AcademicYearNo').lrselect({
placeholder: "学年",
allowSearch: false,
url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetAcademicYearNo',
value: 'value',
text: 'text'
});
//学期
$('#Semester').lrselect({
placeholder: "学期",
allowSearch: false,
url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetSemester',
value: 'value',
text: 'text'
});
//$('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' });
$('#LessonNo').lrselect({
placeholder: "课程",
allowSearch: true,
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo&strWhere=' + 'lessonsortno=2',
value: 'lessonno',
text: 'lessonname'
});
$('#EmpNo').lrDataSourceSelect({ code: 'EmpInfo', value: 'empno', text: 'empname' });
$('#ClassRoomNo').lrDataSourceSelect({ code: 'ClassRoomInfo', value: 'classroomno', text: 'classroomname' });

},
initData: function () {
if (!!keyValue) {
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/GetFormData?keyValue=' + keyValue, function (data) {
for (var id in data) {
if (!!data[id].length && data[id].length > 0) {
$('#' + id).jfGridSet('refreshdata', data[id]);
}
else {
$('[data-table="' + id + '"]').lrSetFormData(data[id]);
}

//课程名称
learun.clientdata.getAsync('custmerData', {
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo',
key: $('#LessonNo').val(),
keyId: 'lessonno',
callback: function (_data) {
$('#LessonName').val(_data['lessonname']);
}
});
//教师姓名
learun.clientdata.getAsync('custmerData', {
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo',
key: $('#EmpNo').val(),
keyId: 'empno',
callback: function (_data) {
$('#EmpName').val(_data['empname']);
}
});
//教室名称
learun.clientdata.getAsync('custmerData', {
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'ClassRoomInfo',
key: $('#ClassRoomNo').val(),
keyId: 'classroomno',
callback: function (_data) {
$('#ClassRoomName').val(_data['classroomname']);
}
});
}
});

}
}
};
// 保存数据
acceptClick = function (callBack) {
if (!$('body').lrValidform()) {
return false;
}
var strEntity = $('body').lrGetFormData();
strEntity.LessonName = $('#LessonNo').lrselectGetText();
strEntity.EmpName = $('#EmpNo').lrselectGetText();
strEntity.ClassRoomName = $('#ClassRoomNo').lrselectGetText();
var postData = {
strEntity: JSON.stringify(strEntity)
};

$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/AddForm?keyValue=' + keyValue, postData, function (res) {
// 保存成功后才回调
if (!!callBack) {
callBack();
}
});
};
page.init();
}

+ 1
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/MergeIndex.cshtml Просмотреть файл

@@ -35,6 +35,7 @@
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a>
</div>
<div class=" btn-group btn-group-sm" learun-authorize="yes">
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i>&nbsp;新增</a>
<a id="lr_editMajor" class="btn btn-default"><i class="fa fa-plus"></i>&nbsp;管理选课专业</a>
<a id="lr_edit" class="btn btn-default"><i class="fa fa-group"></i>&nbsp;设置人数</a>
<a id="lr_modify" class="btn btn-default"><i class="fa fa-pencil-square-o"></i>&nbsp;异动</a>


+ 16
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/MergeIndex.js Просмотреть файл

@@ -48,6 +48,21 @@ var bootstrap = function ($, learun) {
}

});
//新增
$('#lr_add').on('click', function () {
learun.layerForm({
id: 'formadd',
title: '新增',
url: top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/FormElective',
width: 700,
height: 500,
callBack: function (id) {
return top[id].acceptClick(refreshGirdData);
}
});
});

//设置人数
$('#lr_edit').on('click', function () {
var keyValue = $('#gridtable').jfGridValue('Id');
@@ -226,7 +241,7 @@ var bootstrap = function ($, learun) {
{ label: "已报人数(预)", name: "StuNumOfApplyPre", width: 80, align: "left" },
{ label: "通过人数(预)", name: "StuNumPre", width: 80, align: "left" },
{
label: "是否已选专业", name: "IsElectiveMajor", width: 100, align: "left", formatter: function (cellvalue,row) {
label: "是否已选专业", name: "IsElectiveMajor", width: 100, align: "left", formatter: function (cellvalue, row) {
if (!!row.ElectiveMajorList && row.ElectiveMajorList.length > 0) {
return "<span class=\"label label-success\">是</span>";
} else {


+ 2
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj Просмотреть файл

@@ -1031,6 +1031,7 @@
<Content Include="Areas\EducationalAdministration\Views\LessonInfo\IndexNoMajor.js" />
<Content Include="Areas\EducationalAdministration\Views\LoginUserBind\Form.js" />
<Content Include="Areas\EducationalAdministration\Views\LoginUserBind\BindAccountIndex.js" />
<Content Include="Areas\EducationalAdministration\Views\OpenLessonPlanOfElective\FormElective.js" />
<Content Include="Areas\EducationalAdministration\Views\PracticeBase\Form.js" />
<Content Include="Areas\EducationalAdministration\Views\PracticeBase\Index.js" />
<Content Include="Areas\EducationalAdministration\Views\R_EnterBuilding\ClassReport.js" />
@@ -7835,6 +7836,7 @@
<Content Include="Areas\EducationalAdministration\Views\Sys_PsychologicalCounse\FormViewReceive.cshtml" />
<Content Include="Areas\EducationalAdministration\Views\Sys_PsychologicalCounse\FormViewReceiveData.cshtml" />
<Content Include="Areas\EducationalAdministration\Views\ClassPlan\IndexSchool.cshtml" />
<Content Include="Areas\EducationalAdministration\Views\OpenLessonPlanOfElective\FormElective.cshtml" />
<None Include="Properties\PublishProfiles\CustomProfile.pubxml" />
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" />
<Content Include="Views\Login\Default-beifen.cshtml" />


+ 19
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/OpenLessonPlanOfElective/OpenLessonPlanOfElectiveBLL.cs Просмотреть файл

@@ -141,6 +141,25 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}

public void AddForm(string keyValue, OpenLessonPlanOfElectiveEntity entity)
{
try
{
openLessonPlanOfElectiveService.AddForm(keyValue, entity);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}
#endregion

#region 扩展数据


+ 1
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/OpenLessonPlanOfElective/OpenLessonPlanOfElectiveIBLL.cs Просмотреть файл

@@ -50,6 +50,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// <summary>
/// <returns></returns>
void SaveEntity(string keyValue, OpenLessonPlanOfElectiveEntity entity);
void AddForm(string keyValue, OpenLessonPlanOfElectiveEntity entity);
#endregion

#region 扩展数据


+ 58
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/OpenLessonPlanOfElective/OpenLessonPlanOfElectiveService.cs Просмотреть файл

@@ -261,6 +261,64 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}
}
/// <summary>
/// 添加选修课程、合班记录
/// </summary>
/// <param name="keyValue"></param>
/// <param name="entity"></param>
public void AddForm(string keyValue, OpenLessonPlanOfElectiveEntity entity)
{
var db = this.BaseRepository("CollegeMIS");
try
{
db.BeginTrans();
var lesson = db.FindEntity<LessonInfoEntity>(x => x.CheckMark == true && x.LessonNo == entity.LessonNo);
entity.StudyScore = lesson.StudyScore;
entity.Create();
db.Insert(entity);
//添加选修合班记录
ElectiveMergeEntity emEntity = new ElectiveMergeEntity();
emEntity.Create();
emEntity.AcademicYearNo = entity.AcademicYearNo;
emEntity.Semester = entity.Semester;
emEntity.LessonId = lesson.LessonId;
emEntity.LessonNo = entity.LessonNo;
emEntity.LessonName = entity.LessonName;
emEntity.F_SchoolId = LoginUserInfo.Get().companyId;
db.Insert(emEntity);

var lessonSection = entity.LessonSection.Split(',');
for (int i = 0; i < lessonSection.Length; i++)
{
//合班明细
ElectiveMergeItemEntity emItemEntity = new ElectiveMergeItemEntity();
emItemEntity.Create();
emItemEntity.EmId = emEntity.EMId;
emItemEntity.OLPOEId = entity.Id;
emItemEntity.LessonSection = lessonSection[i];
emItemEntity.LessonTime = entity.LessonTime.Split(',')[i];
emItemEntity.EmpNo = entity.EmpNo;
emItemEntity.EmpName = entity.EmpName;
emItemEntity.ClassRoomNo = entity.ClassRoomNo;
emItemEntity.ClassRoomName = entity.ClassRoomName;
db.Insert(emItemEntity);
}
db.Commit();
}
catch (Exception ex)
{
db.Rollback();
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}

#endregion



Загрузка…
Отмена
Сохранить