Commit ab0c7ff2 authored by 黄奎's avatar 黄奎

新增课程,章节处理类

parent 2e5d4d2b
......@@ -109,5 +109,67 @@ namespace Edu.Module.Course
bool flag = courseRepository.Update(fileds, new WhereHelper(nameof(RB_Course_ViewModel.CourseId), CourseId));
return flag;
}
/// <summary>
/// 新增修改课程通知
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool SetNoticeModule(RB_Course_Notice_ViewModel model)
{
bool flag;
if (model.NoticeId > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Course_Notice_ViewModel.Title),model.Title }
};
flag = noticeRepository.Update(fileds, new WhereHelper(nameof(RB_Course_Notice_ViewModel.NoticeId), model.NoticeId));
}
else
{
var newId = noticeRepository.Insert(model);
model.NoticeId = newId;
flag = newId > 0;
}
return flag;
}
/// <summary>
/// 获取课程通知实体
/// </summary>
/// <param name="NoticeId"></param>
/// <returns></returns>
public RB_Course_Notice_ViewModel GetNoticeModule(object NoticeId)
{
return noticeRepository.GetEntity<RB_Course_Notice_ViewModel>(NoticeId);
}
/// <summary>
/// 根据通知编号删除通知
/// </summary>
/// <param name="NoticeId"></param>
/// <returns></returns>
public bool RemoveNoticeModule(object NoticeId)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Course_Notice_ViewModel.Status), (int)DateStateEnum.Delete}
};
bool flag = noticeRepository.Update(fileds, new WhereHelper(nameof(RB_Course_Notice_ViewModel.NoticeId), NoticeId));
return flag;
}
/// <summary>
/// 新增通知阅读
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool AddNoticeRevice(RB_Course_NoticeRevice_ViewModel model)
{
var newId = noticeReviceRepository.Insert(model);
model.ReviceId = newId;
return newId > 0;
}
}
}
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