Explorar el Código

Merge branch '西昌分支' of 123.57.209.16:bjquanjiang/DigitalScholl into 西昌分支

新疆影视学院高职
liangkun hace 3 años
padre
commit
e4d40ed3ae
Se han modificado 18 ficheros con 580 adiciones y 323 borrados
  1. +27
    -39
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ClassPlanController.cs
  2. +140
    -46
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ClassPlanTeachController.cs
  3. +44
    -8
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlan/Index.js
  4. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/Index.cshtml
  5. +20
    -13
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/Index.js
  6. +8
    -23
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/TeachForm.js
  7. +11
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/TeachFormQZ.cshtml
  8. +32
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/TeachFormQZ.js
  9. +5
    -3
      Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj
  10. +44
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassPlan/ClassPlanBLL.cs
  11. +10
    -1
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassPlan/ClassPlanIBLL.cs
  12. +89
    -32
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassPlan/ClassPlanService.cs
  13. +19
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonList/StuSelectLessonListBLL.cs
  14. +3
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonList/StuSelectLessonListIBLL.cs
  15. +32
    -25
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonList/StuSelectLessonListService.cs
  16. +25
    -39
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassBLL.cs
  17. +18
    -7
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassIBLL.cs
  18. +52
    -86
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassService.cs

+ 27
- 39
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ClassPlanController.cs Ver fichero

@@ -111,15 +111,12 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
[AjaxOnly]
public ActionResult SaveForm(string keyValue, string strEntity)
{
if (!string.IsNullOrEmpty(keyValue))
{
classPlanIBLL.DelRelation(keyValue);
}
OpenLessonPlanEntity entity = strEntity.ToObject<OpenLessonPlanEntity>();
if (!string.IsNullOrEmpty(keyValue))
{
entity.AmendDate = DateTime.Now;
}
entity.State = 0;
entity.IsAllowEdit = true;
entity.MakeDate = DateTime.Now;
var model = classPlanIBLL.GetRepetitions(entity.F_SchoolId, entity.AcademicYearNo, entity.Semester, entity.DeptNo, entity.MajorNo, entity.Grade, entity.LessonNo);
@@ -146,49 +143,40 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
[AjaxOnly]
public ActionResult CourseArranging(string keyValue)
{
var data = classPlanIBLL.GetClassPlanEntity(keyValue);
data.State = 1;
var entity = classPlanIBLL.GetListById(keyValue);

List<TeachClassEntity> TeachList = new List<TeachClassEntity>();
TeachClassEntity TeachEntity = new TeachClassEntity();

List<string> stringList = classInfoIBLL.GetAllClass().
Where(x => x.DeptNo == data.DeptNo && x.MajorNo == data.MajorNo && x.Grade == data.Grade)
.OrderBy(x => x.ClassNo).Select(x => x.ClassNo).ToList();
if (stringList.Count > 0)
for (int i = 0; i < entity.Count; i++)
{
var teachInfo = teachClassIBLL.GetAllClass().Where(s =>
s.DeptNo == data.DeptNo && s.MajorNo == data.MajorNo && s.Grade == data.Grade && s.Semester == data.Semester
&& s.LessonNo == data.LessonNo && s.AcademicYearNo == data.AcademicYearNo).OrderBy(s => s.ID).ToList();

if (teachInfo.Count > 0)
var lessonList = classInfoIBLL.GetAllClass().
Where(x => x.DeptNo == entity[i].DeptNo && x.MajorNo == entity[i].MajorNo && x.Grade == entity[i].Grade)
.OrderBy(x => x.ClassNo).Select(x => x.ClassNo).ToList();
if (lessonList.Count > 0)
{
return Fail("排课失败!已存在此课程信息");
for (int j = 0; j < lessonList.Count; j++)
{
TeachClassEntity TeachEntity = new TeachClassEntity();
TeachEntity.TeachClassNo = lessonList[j];
TeachEntity.AcademicYearNo = entity[i].AcademicYearNo;
TeachEntity.DeptNo = entity[i].DeptNo;
TeachEntity.MajorNo = entity[i].MajorNo;
TeachEntity.Grade = entity[i].Grade;
TeachEntity.Semester = entity[i].Semester;
TeachEntity.LessonNo = entity[i].LessonNo;
TeachEntity.StuNum = entity[i].StuNum;
TeachEntity.LessonSortNo = entity[i].LessonSortNo;
TeachEntity.F_SchoolId = entity[i].F_SchoolId;
TeachList.Add(TeachEntity);
}
}
for (int i = 0; i < stringList.Count; i++)
else
{
TeachEntity.TeachClassNo = stringList[i];
TeachEntity.AcademicYearNo = data.AcademicYearNo;
TeachEntity.DeptNo = data.DeptNo;
TeachEntity.MajorNo = data.MajorNo;
TeachEntity.Grade = data.Grade;
TeachEntity.Semester = data.Semester;
TeachEntity.LessonNo = data.LessonNo;
TeachEntity.StuNum = data.StuNum;
TeachEntity.EmpNo = data.TeachNo;
TeachEntity.LessonSortNo = data.LessonSortNo;
TeachEntity.F_SchoolId = data.F_SchoolId;
TeachList.Add(TeachEntity);
return Fail("排课失败!暂无排课班级");
}
teachClassIBLL.SaveEntityList(TeachList);
classPlanIBLL.SaveEntity(keyValue, data);

return Success("排课成功");
}
else
{
return Fail("排课失败!暂无排课班级");
}
teachClassIBLL.SaveEntityList(TeachList);
classPlanIBLL.SaveEntityList(keyValue, entity);
return Success("排课成功");
}

#endregion


+ 140
- 46
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ClassPlanTeachController.cs Ver fichero

@@ -6,6 +6,7 @@ using System.Collections.Generic;
using System;
using System.Linq;
using DocumentFormat.OpenXml.Office.CustomUI;
using List = DocumentFormat.OpenXml.Office2010.ExcelAc.List;

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

/// <summary>
/// 主页面
/// <summary>
/// <returns></returns>
[HttpGet]
public ActionResult TeachFormQZ()
{
return View();
}
#endregion

#region 获取数据
@@ -128,60 +139,143 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
[HttpPost]
[AjaxOnly]

public ActionResult SetTeach(string keyValue, string Teach)
public ActionResult SetTeach(string keyValue, string EmpNo)
{
var entity = teachClassIBLL.GetTeachClassEntity(keyValue);
entity.EmpNo = Teach;
teachClassIBLL.SaveEntity(keyValue, entity);
var entityList = teachClassIBLL.GetTeachListById(keyValue);
List<StuSelectLessonListEntity> TeachList = new List<StuSelectLessonListEntity>();
for (int i = 0; i < entityList.Count; i++)
{
var stuDataList = stuInfoBasicIBLL.GetAllList().Where(s => s.DeptNo == entityList[i].DeptNo
&& s.MajorNo == entityList[i].MajorNo && s.F_SchoolId == entityList[i].F_SchoolId
&& s.ClassNo == entityList[i].TeachClassNo
).ToList();
if (stuDataList.Count > 0)
{
for (int j = 0; j < stuDataList.Count; j++)
{
StuSelectLessonListEntity TeachEntity = new StuSelectLessonListEntity();
TeachEntity.StuNo = stuDataList[j].StuNo;
TeachEntity.DeptNo = entityList[i].DeptNo;
TeachEntity.MajorNo = entityList[i].MajorNo;
TeachEntity.ClassNo = stuDataList[j].ClassNo;
TeachEntity.MajorDetailNo = entityList[i].MajorDetailNo;
TeachEntity.MajorDetailName = entityList[i].MajorDetailName;
TeachEntity.StuName = stuDataList[j].StuName;
TeachEntity.AcademicYearNo = entityList[i].AcademicYearNo;
TeachEntity.Semester = entityList[i].Semester;
TeachEntity.OpenLessonDeptNo = entityList[i].DeptNo;
TeachEntity.OpenLessonMajorNo = entityList[i].MajorNo;
TeachEntity.LessonNo = entityList[i].LessonNo;
TeachEntity.PartCode = entityList[i].PartCode;
TeachEntity.OrdinaryScoreScale = 0;
TeachEntity.TermInScoreScale = 0;
TeachEntity.TermEndScoreScale = 0;
TeachEntity.OtherScoreScale = 0;
TeachEntity.TeachClassNo = entityList[i].TeachClassNo;
TeachEntity.LessonSortNo = entityList[i].LessonSortNo;
TeachEntity.StuSortNo = entityList[i].LessonSortNo;
TeachEntity.Grade = entityList[i].Grade;
TeachEntity.StudyScore = 2;
TeachEntity.TotalStudyHour = 2;
TeachEntity.IsInEffect = "1";
TeachEntity.IsPitchOn = "1";
TeachEntity.IsPitchOn = "1";
TeachEntity.F_SchoolId = entityList[i].F_SchoolId;
TeachEntity.CheckMark = "1";
TeachEntity.InsertTime = DateTime.Now;
TeachList.Add(TeachEntity);
}
}
else
{
return Fail("设置失败,未发现相关学生!");
}
}
StuSelectLesson.SaveEntityList(TeachList);

teachClassIBLL.UpEmpNo(keyValue, EmpNo); //更改当前教师

var stuDataList = stuInfoBasicIBLL.GetAllList().Where(s =>
s.DeptNo == entity.DeptNo && s.MajorNo == entity.MajorNo && s.F_SchoolId == entity.F_SchoolId && entity.TeachClassNo.Contains(s.ClassNo))
.ToList();
if (stuDataList.Count < 0)
return Success("设置成功!");

}
public ActionResult QzSetTeach(string keyValue, string EmpNo)
{
var entityList = teachClassIBLL.GetTeachListById(keyValue);
string Nid = "";
if (entityList.Count > 0)
{
List<StuSelectLessonListEntity> TeachList = new List<StuSelectLessonListEntity>();
StuSelectLessonListEntity TeachEntity = new StuSelectLessonListEntity();
for (int i = 0; i < stuDataList.Count; i++)
for (int i = 0; i < entityList.Count; i++)
{
TeachEntity.NoticeBookNo = stuDataList[i].NoticeNo;
TeachEntity.StuNo = stuDataList[i].StuNo;
TeachEntity.DeptNo = stuDataList[i].DeptNo;
TeachEntity.MajorNo = stuDataList[i].MajorNo;
TeachEntity.ClassNo = stuDataList[i].ClassNo;
TeachEntity.MajorDetailNo = stuDataList[i].MajorDetailNo;
TeachEntity.MajorDetailName = stuDataList[i].MajorDetailName;
TeachEntity.StuName = stuDataList[i].StuName;
TeachEntity.GenderNo = stuDataList[i].GenderNo.ToString();
TeachEntity.AcademicYearNo = entity.AcademicYearNo;
TeachEntity.Semester = entity.Semester;
TeachEntity.OpenLessonDeptNo = entity.DeptNo;
TeachEntity.OpenLessonMajorNo = entity.MajorNo;
TeachEntity.LessonNo = entity.LessonNo;
TeachEntity.PartCode = entity.PartCode;
TeachEntity.OrdinaryScoreScale = 0;
TeachEntity.TermInScoreScale = 0;
TeachEntity.TermEndScoreScale = 0;
TeachEntity.OtherScoreScale = 0;
TeachEntity.TeachClassNo = entity.TeachClassNo;
TeachEntity.LessonSortNo = entity.LessonSortNo;
TeachEntity.StuSortNo = entity.LessonSortNo;
TeachEntity.Grade = entity.Grade;
TeachEntity.StudyScore = 2;
TeachEntity.TotalStudyHour = 2;
TeachEntity.IsInEffect = "1";
TeachEntity.IsPitchOn = "1";
TeachEntity.IsPitchOn = "1";
TeachEntity.F_SchoolId = entity.F_SchoolId;
TeachEntity.InsertTime = DateTime.Now;
TeachList.Add(TeachEntity);
List<string> ssList = StuSelectLesson.GetAllList().Where(
y => y.DeptNo == entityList[i].DeptNo
&& y.MajorNo == entityList[i].MajorNo
&& y.F_SchoolId == entityList[i].F_SchoolId
&& y.ClassNo == entityList[i].TeachClassNo
&& y.LessonNo == entityList[i].LessonNo
&& y.CheckMark == "1"
).Select(x => x.SelectId.ToString()).ToList();
Nid += string.Join(",", ssList) + ",";
}
StuSelectLesson.SaveEntityList(TeachList);
return Success("设置成功!");
}
else

Nid = Nid.TrimEnd(',');
StuSelectLesson.DeleteEntity(Nid);

List<StuSelectLessonListEntity> TeachList = new List<StuSelectLessonListEntity>();
for (int i = 0; i < entityList.Count; i++)
{
return Fail("设置失败!");
var stuDataList = stuInfoBasicIBLL.GetAllList().Where(s => s.DeptNo == entityList[i].DeptNo
&& s.MajorNo == entityList[i].MajorNo && s.F_SchoolId == entityList[i].F_SchoolId
&& s.ClassNo == entityList[i].TeachClassNo
).ToList();
if (stuDataList.Count > 0)
{
for (int j = 0; j < stuDataList.Count; j++)
{
StuSelectLessonListEntity TeachEntity = new StuSelectLessonListEntity();
TeachEntity.StuNo = stuDataList[j].StuNo;
TeachEntity.DeptNo = entityList[i].DeptNo;
TeachEntity.MajorNo = entityList[i].MajorNo;
TeachEntity.ClassNo = stuDataList[j].ClassNo;
TeachEntity.MajorDetailNo = entityList[i].MajorDetailNo;
TeachEntity.MajorDetailName = entityList[i].MajorDetailName;
TeachEntity.StuName = stuDataList[j].StuName;
TeachEntity.GenderNo = stuDataList[j].GenderNo == true ? "0" : "1";
TeachEntity.AcademicYearNo = entityList[i].AcademicYearNo;
TeachEntity.Semester = entityList[i].Semester;
TeachEntity.OpenLessonDeptNo = entityList[i].DeptNo;
TeachEntity.OpenLessonMajorNo = entityList[i].MajorNo;
TeachEntity.LessonNo = entityList[i].LessonNo;
TeachEntity.PartCode = entityList[i].PartCode;
TeachEntity.OrdinaryScoreScale = 0;
TeachEntity.TermInScoreScale = 0;
TeachEntity.TermEndScoreScale = 0;
TeachEntity.OtherScoreScale = 0;
TeachEntity.TeachClassNo = entityList[i].TeachClassNo;
TeachEntity.LessonSortNo = entityList[i].LessonSortNo;
TeachEntity.StuSortNo = entityList[i].LessonSortNo;
TeachEntity.Grade = entityList[i].Grade;
TeachEntity.StudyScore = 2;
TeachEntity.TotalStudyHour = 2;
TeachEntity.IsInEffect = "1";
TeachEntity.IsPitchOn = "1";
TeachEntity.IsPitchOn = "1";
TeachEntity.F_SchoolId = entityList[i].F_SchoolId;
TeachEntity.InsertTime = DateTime.Now;
TeachList.Add(TeachEntity);
}
}
else
{
return Fail("设置失败,未发现相关学生!");
}
}

StuSelectLesson.SaveEntityList(TeachList);

teachClassIBLL.UpEmpNo(keyValue, EmpNo); //更改当前教师

return Success("设置成功!");
}
#endregion
}


+ 44
- 8
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlan/Index.js Ver fichero

@@ -65,6 +65,10 @@ var bootstrap = function ($, learun) {
$('#lr_edit').on('click', function () {
var keyValue = $('#gridtable').jfGridValue('ID');
if (learun.checkrow(keyValue)) {
if (keyValue.indexOf(',') != -1) {
learun.alert.warning("只能选择一条记录进行编辑!");
return;
}
var state = $('#gridtable').jfGridValue('State');
if (state == 0) {
learun.layerForm({
@@ -98,9 +102,15 @@ var bootstrap = function ($, learun) {
// 删除
$('#lr_delete').on('click', function () {
var keyValue = $('#gridtable').jfGridValue('ID');
var state = $('#gridtable').jfGridValue('State');
if (learun.checkrow(keyValue)) {
if (state == 0) {
var state = $('#gridtable').jfGridValue('State').split(',');
var allEmpty = true;
for (var i = 0; i < state.length; i++) {
if (state[i] != 0) {
allEmpty = false;
}
}
if (allEmpty) {
learun.layerConfirm('是否确认删除该项!',
function (res) {
if (res) {
@@ -127,13 +137,28 @@ var bootstrap = function ($, learun) {
$('#lr_courses').on('click', function () {
var keyValue = $('#gridtable').jfGridValue('ID');
if (learun.checkrow(keyValue)) {
learun.layerConfirm('确定要进行排课么!', function (res) {
if (res) {
learun.postForm(top.$.rootUrl + '/EducationalAdministration/ClassPlan/CourseArranging', { keyValue: keyValue }, function () {
refreshGirdData();
});
var state = $('#gridtable').jfGridValue('State').split(',');
var allEmpty = true;
for (var i = 0; i < state.length; i++) {
if (state[i] != 0) {
allEmpty = false;
}
});
}
if (allEmpty) {
learun.layerConfirm('确定要进行排课么!',
function (res) {
if (res) {
learun.postForm(
top.$.rootUrl + '/EducationalAdministration/ClassPlan/CourseArranging',
{ keyValue: keyValue },
function () {
refreshGirdData();
});
}
});
} else {
learun.alert.warning("不嫩选择已排课的课程计划");
}
}
});
},
@@ -228,6 +253,16 @@ var bootstrap = function ($, learun) {
{ label: "年级", name: "Grade", width: 50, align: "left" },
{ label: "课程编码", name: "LessonNo", width: 200, align: "left" },
{ label: "课程名称", name: "LessonName", width: 200, align: "left" },
{
label: "状态", name: "State", width: 100, align: "left",
formatter: function (cellvalue, row) {
if (cellvalue == 0) {
return '<span class=\"label label-warning\">未排课</span>';
} if (cellvalue == 1) {
return '<span class=\"label label-success\">已排课</span>';
}
}
},
{ label: "拟开教学班数", name: "TeachClassNum", width: 100, align: "left" },
{ label: "人数", name: "StuNum", width: 80, align: "left" },
{ label: "周课时", name: "WeekLessonHour", width: 80, align: "left" },
@@ -253,6 +288,7 @@ var bootstrap = function ($, learun) {
],
mainId: 'ID',
sidx: 'MakeDate desc',
isMultiselect: true,
isPage: true
});
page.search();


+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/Index.cshtml Ver fichero

@@ -57,7 +57,7 @@
</div>
<div class=" btn-group btn-group-sm" learun-authorize="yes">
<a id="lr_teach" class="btn btn-default"><i class="fa fa-plus"></i>&nbsp;设置教师</a>
<a id="lr_qzteach" class="btn btn-default"><i class="fa fa-pencil-square-o"></i>&nbsp;生成成绩</a>
<a id="lr_qzteach" class="btn btn-default"><i class="fa fa-pencil-square-o"></i>&nbsp;强制设置教师</a>
</div>
</div>
</div>


+ 20
- 13
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/Index.js Ver fichero

@@ -7,6 +7,7 @@
var refreshGirdData;
var bootstrap = function ($, learun) {
"use strict";
var cddeptname = '';
var page = {
init: function () {
page.inittree();
@@ -63,9 +64,15 @@ var bootstrap = function ($, learun) {
// 设置教师
$('#lr_teach').on('click', function () {
var keyValue = $('#gridtable').jfGridValue('ID');
var empno = $('#gridtable').jfGridValue('EmpNo');
if (learun.checkrow(keyValue)) {
if (empno) {
var empno = $('#gridtable').jfGridValue('EmpNo').split(',');
var allEmpty = true;
for (var i = 0; i < empno.length; i++) {
if (empno[i] != '') {
allEmpty = false;
}
}
if (allEmpty) {
learun.layerForm({
id: 'form',
title: '设置教师',
@@ -77,28 +84,27 @@ var bootstrap = function ($, learun) {
}
});
} else {
learun.alert.warning("所选班级已设置教师不能重复设置!!!");
learun.alert.warning("所选班级已设置教师,不可重复设置!!!");
}
}

});
// 强制设置教师
$('#lr_qzteach').on('click', function () {
var keyValue = $('#gridtable').jfGridValue('ID');
var loginInfo = learun.clientdata.get(['userinfo']);
if (learun.checkrow(keyValue)) {
learun.layerForm({
id: 'form',
title: '设置教师',
url: top.$.rootUrl + '/EducationalAdministration/ClassPlanTeach/SelectForm?objectId=' + keyValue + '&companyId=' + loginInfo.F_CompanyId + '&departmentId=' + loginInfo.F_DepartmentId + '&category=1',
width: 800,
height: 520,
title: '强制设置教师',
url: top.$.rootUrl +
'/EducationalAdministration/ClassPlanTeach/TeachFormQZ?keyValue=' +
keyValue,
width: 400,
height: 300,
callBack: function (id) {
return top[id].acceptClick();
}
});
}

});
},
inittree: function () {
@@ -211,11 +217,11 @@ var bootstrap = function ($, learun) {
label: "教师", name: "EmpNo", width: 80, align: "left",
formatterAsync: function (callback, value, row, op, $cell) {
learun.clientdata.getAsync('custmerData', {
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo',
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'teacheruserdata',
key: value,
keyId: 'empno',
keyId: 'f_encode',
callback: function (_data) {
callback(_data['empname']);
callback(_data['f_realname']);
}
});
}
@@ -233,6 +239,7 @@ var bootstrap = function ($, learun) {
},
search: function (param) {
param = param || {};
param.DeptNo = cddeptname;
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
}
};


+ 8
- 23
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/TeachForm.js Ver fichero

@@ -12,36 +12,21 @@ var bootstrap = function ($, learun) {
init: function () {
$('.lr-form-wrap').lrscroll();
page.bind();
//page.initData();
},
bind: function () {
$('#EmpNo').lrDataSourceSelect({ code: 'EmpInfo', value: 'empno', text: 'empname' });
//$('#EmpNo').lrDataSourceSelect({ code: 'teacheruserdata', value: 'f_encode', text: 'realname' });
}
//initData: function () {
// if (!!keyValue) {
// $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/ClassPlan/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]);
// }
// }
// });
// }
//}
};
// 保存数据
acceptClick = function (callBack) {
console.log(keyValue, 111);
//$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/ClassPlanTeach/SetTeach?keyValue=' + keyValue, function (res) {
// // 保存成功后才回调
// if (!!callBack) {
// callBack();
// }
//});
if (!$('body').lrValidform()) {
return false;
}
var postData = $('#form').lrGetFormData();
var EmpNo = postData.EmpNo;
console.log(EmpNo);
learun.postForm(top.$.rootUrl + '/EducationalAdministration/ClassPlanTeach/SetTeach', { keyValue: keyValue, EmpNo: EmpNo}, function () {
});
};
page.init();
}

+ 11
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/TeachFormQZ.cshtml Ver fichero

@@ -0,0 +1,11 @@
@{
ViewBag.Title = "开课计划";
Layout = "~/Views/Shared/_Form.cshtml";
}
<div class="lr-form-wrap" id="form">
<div class="col-xs-12 lr-form-item" data-table="ClassPlanTeach">
<div class="lr-form-item-title">教师<font face="宋体">*</font></div>
<div id="EmpNo" isvalid="yes" checkexpession="NotNull"></div>
</div>
</div>
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/ClassPlanTeach/TeachFormQZ.js")

+ 32
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/TeachFormQZ.js Ver fichero

@@ -0,0 +1,32 @@
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
* 创建人:超级管理员
* 日 期:2021-11-29 11:43
* 描 述:开课计划
*/
var acceptClick;
var keyValue = request('keyValue');
var bootstrap = function ($, learun) {
"use strict";
var page = {
init: function () {
$('.lr-form-wrap').lrscroll();
page.bind();
},
bind: function () {
$('#EmpNo').lrDataSourceSelect({ code: 'EmpInfo', value: 'empno', text: 'empname' });
}
};
// 保存数据
acceptClick = function (callBack) {
if (!$('body').lrValidform()) {
return false;
}
var postData = $('#form').lrGetFormData();
var EmpNo = postData.EmpNo;
console.log(EmpNo);
learun.postForm(top.$.rootUrl + '/EducationalAdministration/ClassPlanTeach/QZSetTeach', { keyValue: keyValue, EmpNo: EmpNo}, function () {
});
};
page.init();
}

+ 5
- 3
Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj Ver fichero

@@ -947,6 +947,7 @@
<Content Include="Areas\EducationalAdministration\Views\CertificateResult\Form.js" />
<Content Include="Areas\EducationalAdministration\Views\CertificateResult\Index.js" />
<Content Include="Areas\EducationalAdministration\Views\ClassInfo\FormType.js" />
<Content Include="Areas\EducationalAdministration\Views\ClassPlanTeach\TeachFormQZ.js" />
<Content Include="Areas\EducationalAdministration\Views\ClassPlanTeach\TeachForm.js" />
<Content Include="Areas\EducationalAdministration\Views\ClassPlan\Form.js" />
<Content Include="Areas\EducationalAdministration\Views\ClassPlan\Index.js" />
@@ -7467,6 +7468,7 @@
<Content Include="Areas\EducationalAdministration\Views\ClassPlanTeach\TeachForm.cshtml" />
<Content Include="Areas\EducationalAdministration\Views\ArrangeExamTermNew\SyncByConditionForm.cshtml" />
<Content Include="Areas\EducationalAdministration\Views\ArrangeExamTermNew\IndexItem.cshtml" />
<Content Include="Areas\EducationalAdministration\Views\ClassPlanTeach\TeachFormQZ.cshtml" />
<None Include="Properties\PublishProfiles\CustomProfile.pubxml" />
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" />
<Content Include="Views\Login\Default-beifen.cshtml" />
@@ -7591,10 +7593,10 @@
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
<WebProjectProperties>
<UseIIS>False</UseIIS>
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>20472</DevelopmentServerPort>
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>20472</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>http://localhost:20873/</IISUrl>
<IISUrl>http://localhost:20873/</IISUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer>
<CustomServerUrl>


+ 44
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassPlan/ClassPlanBLL.cs Ver fichero

@@ -177,6 +177,50 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}


/// <summary>
/// 保存实体数据(新增、修改)
/// <param name="keyValue">主键</param>
/// <summary>
/// <returns></returns>
public List<OpenLessonPlanEntity> GetListById(string keyValue)
{
try
{
return classPlanService.GetListById(keyValue);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

public void SaveEntityList(string keyValue, List<OpenLessonPlanEntity> entity)
{
try
{
classPlanService.SaveEntityList(keyValue, entity);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

#endregion
}
}

+ 10
- 1
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassPlan/ClassPlanIBLL.cs Ver fichero

@@ -58,13 +58,22 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// <param name="Grade">年级</param>
/// <param name="Lesson">课程</param>
/// <returns></returns>
OpenLessonPlanEntity GetRepetitions( string School, string Year, string Semester, string Dept, string Major, string Grade, string Lesson);
OpenLessonPlanEntity GetRepetitions(string School, string Year, string Semester, string Dept, string Major, string Grade, string Lesson);

/// <summary>
/// 编辑时删除关联数据
/// </summary>
/// <param name="keyValue"></param>
void DelRelation(string keyValue);

/// <summary>
/// 获取TeachClass表实体数据
/// <param name="keyValue">主键</param>
/// <summary>
/// <returns></returns>
List<OpenLessonPlanEntity> GetListById(string keyValue);

void SaveEntityList(string keyValue, List<OpenLessonPlanEntity> entity);
#endregion
}
}

+ 89
- 32
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassPlan/ClassPlanService.cs Ver fichero

@@ -125,47 +125,49 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
var db = this.BaseRepository("CollegeMIS").BeginTrans();
try
{
var keyvalue = Convert.ToInt32(keyValue);
var OpList = this.BaseRepository("CollegeMIS").FindEntity<OpenLessonPlanEntity>(t => t.ID == keyvalue);
if (OpList != null)
var keyvalue = keyValue.Split(',');
foreach (var items in keyvalue)
{
var TeachList = this.BaseRepository("CollegeMIS").FindList<TeachClassEntity>(
x => x.DeptNo == OpList.DeptNo &&
x.MajorNo == OpList.MajorNo &&
x.Grade == OpList.Grade &&
x.Semester == OpList.Semester &&
x.LessonNo == OpList.LessonNo &&
x.AcademicYearNo == OpList.AcademicYearNo
).ToList();
List<string> StrTeach = null;
if (TeachList.Count > 0)
var OpList = this.BaseRepository("CollegeMIS").FindEntity<OpenLessonPlanEntity>(t => t.ID.ToString() == items);
if (OpList != null)
{
StrTeach = TeachList.Select(x => x.TeachClassNo).ToList();
if (StrTeach.Count() > 0)
var TeachList = this.BaseRepository("CollegeMIS").FindList<TeachClassEntity>(
x => x.DeptNo == OpList.DeptNo &&
x.MajorNo == OpList.MajorNo &&
x.Grade == OpList.Grade &&
x.Semester == OpList.Semester &&
x.LessonNo == OpList.LessonNo &&
x.AcademicYearNo == OpList.AcademicYearNo
).ToList();
List<string> StrTeach = null;
if (TeachList.Count > 0)
{
var LessonList = this.BaseRepository("CollegeMIS").FindList<StuSelectLessonListEntity>(
y => y.DeptNo == OpList.DeptNo &&
y.MajorNo == OpList.MajorNo &&
y.Grade == OpList.Grade &&
y.Semester == OpList.Semester &&
y.LessonNo == OpList.LessonNo &&
y.AcademicYearNo == OpList.AcademicYearNo &&
StrTeach.Contains(y.ClassNo)
);
foreach (var item in LessonList)
StrTeach = TeachList.Select(x => x.TeachClassNo).ToList();
if (StrTeach.Count() > 0)
{
db.Delete<StuSelectLessonListEntity>(m => m.SelectId == Convert.ToInt32(item.SelectId));
}
var LessonList = this.BaseRepository("CollegeMIS").FindList<StuSelectLessonListEntity>(
y => y.DeptNo == OpList.DeptNo &&
y.MajorNo == OpList.MajorNo &&
y.Grade == OpList.Grade &&
y.Semester == OpList.Semester &&
y.LessonNo == OpList.LessonNo &&
y.AcademicYearNo == OpList.AcademicYearNo &&
StrTeach.Contains(y.ClassNo)
);
foreach (var item in LessonList)
{
db.Delete<StuSelectLessonListEntity>(m => m.SelectId == Convert.ToInt32(item.SelectId));
}

foreach (var item in TeachList)
{
db.Delete<TeachClassEntity>(m => m.ID == item.ID);
foreach (var item in TeachList)
{
db.Delete<TeachClassEntity>(m => m.ID == item.ID);
}
}
}
}
db.Delete<OpenLessonPlanEntity>(m => m.ID.ToString() == items);
}
//this.BaseRepository("CollegeMIS").Delete<OpenLessonPlanEntity>(t => t.ID == keyvalue);
db.Delete<OpenLessonPlanEntity>(m => m.ID == keyvalue);
db.Commit();
}
catch (Exception ex)
@@ -315,6 +317,61 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}

/// <summary>
/// 获取OpenLessonPlan表实体数据
/// <param name="keyValue">主键</param>
/// <summary>
/// <returns></returns>
public List<OpenLessonPlanEntity> GetListById(string keyValue)
{
try
{
var id = keyValue.Split(',');
return this.BaseRepository("CollegeMIS")
.FindList<OpenLessonPlanEntity>(x => id.Contains(x.ID.ToString())).ToList();
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}


public void SaveEntityList(string keyValue, List<OpenLessonPlanEntity> entity)
{
var db = this.BaseRepository("CollegeMIS").BeginTrans();
try
{
var keyvalue = keyValue.Split(',');
foreach (var item in keyvalue)
{
var entityList = this.BaseRepository("CollegeMIS").FindEntity<OpenLessonPlanEntity>(x => x.ID.ToString() == item);
entityList.State = 1;
db.Update(entityList);
}
db.Commit();
}
catch (Exception ex)
{
db.Rollback();
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}

#endregion

}


+ 19
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonList/StuSelectLessonListBLL.cs Ver fichero

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

public IEnumerable<StuSelectLessonListEntity> GetAllList()
{
try
{
return stuSelectLessonListService.GetAllList();
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

#endregion
}
}

+ 3
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonList/StuSelectLessonListIBLL.cs Ver fichero

@@ -44,6 +44,9 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// <param name="entity">实体</param>
void SaveEntity(string keyValue, StuSelectLessonListEntity entity);
void SaveEntityList(List<StuSelectLessonListEntity> entity);

IEnumerable<StuSelectLessonListEntity> GetAllList();

#endregion

}


+ 32
- 25
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonList/StuSelectLessonListService.cs Ver fichero

@@ -32,7 +32,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
var strSql = new StringBuilder();
strSql.Append("SELECT ");
strSql.Append(@" * ");
strSql.Append(" FROM Dispatch t ");
strSql.Append(" FROM StuSelectLessonList t ");
strSql.Append(" WHERE 1=1 ");
var queryParam = queryJson.ToJObject();
// 虚拟参数
@@ -42,27 +42,6 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
dp.Add("keyword", "%" + queryParam["keyword"].ToString() + "%", DbType.String);
strSql.Append(" AND t.DisFrom like @keyword ");
}
string beginDate = queryParam["StartTime"].ToString();
string endDate = queryParam["EndTime"].ToString();
if (!string.IsNullOrEmpty(beginDate) && !string.IsNullOrEmpty(endDate))
{
#region 获取日期(年 月 日)
string bYaer = beginDate.Substring(0, 4);
string bMonth = beginDate.Substring(5, 2);
string bdate = beginDate.Substring(8, 2);
string eYaer = endDate.Substring(0, 4);
string eMonth = endDate.Substring(5, 2);
#endregion
string edate = endDate.Substring(8, 2);
strSql.Append(@" and (t.DisYear BETWEEN '" + bYaer + "' and '" + eYaer + "') " +
"and (t.DisMonth BETWEEN '" + bMonth + "' and '" + eMonth + "') " +
" and (t.DisDay BETWEEN '" + bdate + "' and '" + edate + "') ");

}
if (!queryParam["userId"].IsEmpty())
{
strSql.Append(" AND t.Id Not in(select DisId from DispatchAudit where AuditUser ='" + queryParam["userId"].ToString() + "') ");
}
return this.BaseRepository("CollegeMIS").FindList<StuSelectLessonListEntity>(strSql.ToString(), dp, pagination);
}
catch (Exception ex)
@@ -112,13 +91,22 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// <param name="keyValue">主键</param>
public void DeleteEntity(string keyValue)
{
var db = this.BaseRepository("CollegeMIS").BeginTrans();
try
{
var keyvalue = Convert.ToInt32(keyValue);
this.BaseRepository("CollegeMIS").Delete<StuSelectLessonListEntity>(t => t.SelectId == keyvalue);
//this.BaseRepository("CollegeMIS").Delete<StuInfoBasicEntity>(t => t.StuId == keyValue);

//多个删除
var keyValueArr = keyValue.Split(',');
foreach (var item in keyValueArr)
{
db.Delete<StuSelectLessonListEntity>(t => t.SelectId.ToString() == item);
}
db.Commit();
}
catch (Exception ex)
{
db.Rollback();
if (ex is ExceptionEx)
{
throw;
@@ -199,7 +187,6 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
stuLessonList.TermInScoreScale = item.TermInScoreScale;
stuLessonList.TermEndScoreScale = item.TermEndScoreScale;
stuLessonList.OtherScoreScale = item.OtherScoreScale;
stuLessonList.TeachClassNo = item.TeachClassNo;
stuLessonList.LessonSortNo = item.LessonSortNo;
stuLessonList.StuSortNo = item.StuSortNo;
stuLessonList.Grade = item.Grade;
@@ -213,6 +200,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
stuLessonList.IsPitchOn = item.IsPitchOn;
stuLessonList.CheckMark = item.CheckMark;
stuLessonList.InsertTime = item.InsertTime;
stuLessonList.CheckMark = "1";
db.Insert(stuLessonList);
}
db.Commit();
@@ -230,6 +218,25 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}
}

public IEnumerable<StuSelectLessonListEntity> GetAllList()
{
try
{
return this.BaseRepository("CollegeMIS").FindList<StuSelectLessonListEntity>(m => m.CheckMark == "1");
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}
#endregion
}
}

+ 25
- 39
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassBLL.cs Ver fichero

@@ -93,29 +93,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
#endregion

#region 提交数据
public void Lock(string keyValue)
{
try
{
teachClassEntity.Lock(keyValue);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}
public void UnLock(string keyValue)
public void DeleteEntity(string keyValue)
{
try
{
teachClassEntity.UnLock(keyValue);
teachClassEntity.DeleteEntity(keyValue);
}
catch (Exception ex)
{
@@ -129,16 +111,17 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}
}

/// <summary>
/// 删除实体数据
/// 保存实体数据(新增、修改)
/// <param name="keyValue">主键</param>
/// <summary>
/// <returns></returns>
public void DeleteEntity(string keyValue)
public void SaveEntity(string keyValue, TeachClassEntity entity)
{
try
{
teachClassEntity.DeleteEntity(keyValue);
teachClassEntity.SaveEntity(keyValue, entity);
}
catch (Exception ex)
{
@@ -153,16 +136,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}

/// <summary>
/// 保存实体数据(新增、修改)
/// <param name="keyValue">主键</param>
/// <summary>
/// <returns></returns>
public void SaveEntity(string keyValue, TeachClassEntity entity)
public void SaveEntityList(List<TeachClassEntity> entity)
{
try
{
teachClassEntity.SaveEntity(keyValue, entity);
teachClassEntity.SaveEntityList(entity);
}
catch (Exception ex)
{
@@ -176,12 +154,19 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}
}
#endregion

public void SaveEntityList(List<TeachClassEntity> entity)
#region 扩展数据
/// <summary>
/// 保存实体数据(新增、修改)
/// <param name="keyValue">主键</param>
/// <summary>
/// <returns></returns>
public List<TeachClassEntity> GetTeachListById(string keyValue)
{
try
{
teachClassEntity.SaveEntityList(entity);
return teachClassEntity.GetTeachListById(keyValue);
}
catch (Exception ex)
{
@@ -195,11 +180,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}
}
#endregion

#region 扩展数据
/// <summary>
///
/// 查询条件
/// </summary>
/// <returns></returns>
public IEnumerable<TeachClassEntity> GetAllClass()
@@ -221,12 +203,16 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}


public void SetTeach(string keyValue)
/// <summary>
/// 保存实体数据(新增、修改)
/// <param name="keyValue">主键</param>
/// <summary>
/// <returns></returns>
public void UpEmpNo(string keyValue, string EmpNo)
{
try
{
teachClassEntity.SetTeach(keyValue);
teachClassEntity.UpEmpNo(keyValue, EmpNo);
}
catch (Exception ex)
{


+ 18
- 7
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassIBLL.cs Ver fichero

@@ -30,8 +30,6 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
#endregion

#region 提交数据
void Lock(string keyValue);
void UnLock(string keyValue);
/// <summary>
/// 删除实体数据
/// <param name="keyValue">主键</param>
@@ -52,14 +50,27 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
#region 扩展数据

/// <summary>
/// 设置教师
/// 获取ClassTeach表实体数据
/// <param name="keyValue">主键</param>
/// <summary>
/// <returns></returns>
List<TeachClassEntity> GetTeachListById(string keyValue);
/// <summary>
/// 保存数据
/// </summary>
/// <param name="keyValue"></param>
void SetTeach(string keyValue);

/// <param name="entity"></param>
void SaveEntityList(List<TeachClassEntity> entity);

/// <summary>
/// 去重
/// </summary>
/// <returns></returns>
IEnumerable<TeachClassEntity> GetAllClass();
/// <summary>
/// 保存/修改教师
/// </summary>
/// <param name="keyvalue"></param>
/// <param name="EmpNo"></param>
void UpEmpNo(string keyvalue, string EmpNo);
#endregion
}
}

+ 52
- 86
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassService.cs Ver fichero

@@ -115,7 +115,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
{
try
{
return this.BaseRepository("CollegeMIS").FindEntity<TeachClassEntity>(keyValue);
int ID = Convert.ToInt32(keyValue);
return this.BaseRepository("CollegeMIS").FindEntity<TeachClassEntity>(ID);
}
catch (Exception ex)
{
@@ -132,65 +133,6 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
#endregion

#region 提交数据
public void Lock(string keyValue)
{
var db = this.BaseRepository("CollegeMIS").BeginTrans();
try
{
//单个启用
//this.BaseRepository("CollegeMIS").ExecuteBySql("update ClassInfo set CheckMark=1 where ClassId='" + keyValue + "'");

//多个启用
var keyValueArr = keyValue.Split(',');
foreach (var item in keyValueArr)
{
db.ExecuteBySql("update ClassInfo set CheckMark=1 where ClassId='" + item + "'");
}
db.Commit();
}
catch (Exception ex)
{
db.Rollback();
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}

public void UnLock(string keyValue)
{
var db = this.BaseRepository("CollegeMIS").BeginTrans();
try
{
//单个停用
//this.BaseRepository("CollegeMIS").ExecuteBySql("update ClassInfo set CheckMark=0 where ClassId='" + keyValue + "'");

//多个停用
var keyValueArr = keyValue.Split(',');
foreach (var item in keyValueArr)
{
db.ExecuteBySql("update ClassInfo set CheckMark=0 where ClassId='" + item + "'");
}
db.Commit();
}
catch (Exception ex)
{
db.Rollback();
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}
/// <summary>
/// 删除实体数据
/// <param name="keyValue">主键</param>
@@ -201,14 +143,16 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
var db = this.BaseRepository("CollegeMIS").BeginTrans();
try
{
//单个删除
//this.BaseRepository("CollegeMIS").Delete<TeachClassEntity>(t => t.ClassId == keyValue);

//多个删除
//修改
var keyValueArr = keyValue.Split(',');
foreach (var item in keyValueArr)
{
db.Delete<TeachClassEntity>(t => t.ID == Convert.ToInt32(item));
var entity = this.BaseRepository("CollegeMIS").FindEntity<TeachClassEntity>(x => x.ID == Convert.ToInt32(item));
if (entity != null)
{
entity.EmpNo = "";
db.Update(entity);
}
}
db.Commit();
}
@@ -283,32 +227,22 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}
}
#endregion
public void SetTeach(string keyValue)

/// <summary>
/// 获取ClassInfo表实体数据
/// <param name="keyValue">主键</param>
/// <summary>
/// <returns></returns>
public List<TeachClassEntity> GetTeachListById(string keyValue)
{
var db = this.BaseRepository("CollegeMIS").BeginTrans();
try
{
//foreach (var item in List)
//{
// TeachClassEntity Teach = new TeachClassEntity();
// Teach.TeachClassNo = item.TeachClassNo;
// Teach.AcademicYearNo = item.AcademicYearNo;
// Teach.DeptNo = item.DeptNo;
// Teach.MajorNo = item.MajorNo;
// Teach.Grade = item.Grade;
// Teach.Semester = item.Semester;
// Teach.LessonNo = item.LessonNo;
// Teach.StuNum = item.StuNum;
// Teach.LessonSortNo = item.LessonSortNo;
// Teach.F_SchoolId = item.F_SchoolId;
// db.Insert(Teach);
//}
db.Commit();
var id = keyValue.Split(',');
return this.BaseRepository("CollegeMIS")
.FindList<TeachClassEntity>(x => id.Contains(x.ID.ToString())).ToList();
}
catch (Exception ex)
{
db.Rollback();
if (ex is ExceptionEx)
{
throw;
@@ -319,7 +253,6 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}
}

/// <summary>
/// 保存数据
/// </summary>
@@ -360,6 +293,39 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}
}
/// <summary>
/// 保存或修改教师
/// </summary>
/// <param name="keyValue"></param>
/// <param name="EmpNo"></param>
public void UpEmpNo(string keyValue, string EmpNo)
{
var db = this.BaseRepository("CollegeMIS").BeginTrans();
try
{
var keyarray = keyValue.Split(',');
foreach (var item in keyarray)
{
var entityList = this.GetTeachClassEntity(item);
entityList.EmpNo = EmpNo;
db.Update(entityList);

}
db.Commit();
}
catch (Exception ex)
{
db.Rollback();
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}
#endregion
}
}

Cargando…
Cancelar
Guardar