public void AddCourse(AbhsChinese.Domain.Dto.Request.DtoCourse course) { using (TransactionScope scope = new TransactionScope()) { try { var entity = course.ConvertTo <Yw_Course>(PropertyNamePrefixAction.Add); entity.Ycs_CreateTime = Clock.Now; entity.Ycs_Creator = course.CurrentUser; entity.Ycs_UpdateTime = Clock.Now; entity.Ycs_Editor = course.CurrentUser; entity.Ycs_PublishTime = Clock.MinValue; CourseRepository.InsertCourse(entity); CourseLessonRespository.Insert( entity.Ycs_Id, course.Lessons.ToList(), 1,//序号从1开始添加 course.CurrentUser); UpdateProcess( new DtoCoursePricing { CourseId = entity.Ycs_Id, NextStatus = CourseStatusEnum.未定价 }, course.CurrentUser, CourseActionEnum.添加课程); scope.Complete(); } catch { RollbackTran(); throw; } } }
public IList <DtoLesson> GetLogs(int courseId) { return(CourseLessonRespository.GetLessonsWithProcessInfo(courseId)); }