Commit b9d89f22 authored by 黄奎's avatar 黄奎

页面修改

parent c0007e7b
......@@ -13,5 +13,17 @@ namespace Edu.Model.ViewModel.Course
/// </summary>
public string CourseIds { get; set; }
/// <summary>
/// 排序
/// </summary>
public decimal OrderFileds
{
get
{
decimal.TryParse(this.ChapterNo, out decimal Num);
return Num;
}
}
}
}
......@@ -98,6 +98,11 @@ namespace Edu.Module.Course
/// </summary>
private readonly RB_ClassRepository classRepository = new RB_ClassRepository();
/// <summary>
/// 班级基础配置仓储层对象
/// </summary>
private readonly RB_Class_ConfigRepository class_ConfigRepository = new RB_Class_ConfigRepository();
#region 课程管理
/// <summary>
......@@ -480,7 +485,7 @@ namespace Edu.Module.Course
{
List<ChapterTree_ViewModel> resultList = new List<ChapterTree_ViewModel>();
//获取下级节点
var subList = sourceList?.Where(qItem => qItem.ParentId == parentId).OrderBy(qitem => qitem.SortNum).ToList();
var subList = sourceList?.Where(qItem => qItem.ParentId == parentId).OrderBy(qitem =>qitem.OrderFileds).ToList();
//如果存在下级节点
if (subList != null && subList.Count > 0)
{
......@@ -519,6 +524,10 @@ namespace Edu.Module.Course
public bool SetChapterModule(RB_Course_Chapter_ViewModel model)
{
bool flag;
if (model.StudyMinutes > 0)
{
model.StudyHours = model.StudyMinutes / class_ConfigRepository.GetBasicMinutesRepository(model.Group_Id);
}
if (model.ChapterId > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
......@@ -532,7 +541,6 @@ namespace Edu.Module.Course
{nameof(RB_Course_Chapter_ViewModel.Objectives) ,model.Objectives},
{nameof(RB_Course_Chapter_ViewModel.Requirement) ,model.Requirement},
{nameof(RB_Course_Chapter_ViewModel.CourseRate) ,model.CourseRate},
{nameof(RB_Course_Chapter_ViewModel.CurrentHours) ,model.CurrentHours},
};
flag = chapterRepository.Update(fileds, new WhereHelper(nameof(RB_Course_Chapter_ViewModel.ChapterId), model.ChapterId));
}
......@@ -607,6 +615,11 @@ namespace Edu.Module.Course
return flag;
}
/// <summary>
/// 设置章节名称
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool SetChapterNameModule(RB_Course_Chapter_ViewModel model)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
......
......@@ -436,8 +436,9 @@ namespace Edu.WebApi.Controllers.Course
Objectives=base.ParmJObj.GetStringValue("Objectives"),
Requirement=base.ParmJObj.GetStringValue("Requirement"),
CourseRate=(CourseRateEnum)base.ParmJObj.GetInt("CourseRate"),
CurrentHours=base.ParmJObj.GetInt("CurrentHours"),
//CurrentHours=base.ParmJObj.GetInt("CurrentHours"),
};
extModel.Status = DateStateEnum.Normal;
extModel.CreateTime = DateTime.Now;
extModel.CreateBy = base.UserInfo.Id;
......@@ -486,7 +487,6 @@ namespace Edu.WebApi.Controllers.Course
public ApiResult GetCourseRateEnumList()
{
var list = Common.Plugin.EnumHelper.EnumToList(typeof(CourseRateEnum));
return ApiResult.Success(data: list);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment