C# 基础项目——课程管理系统DEMO(三)
一:BLL层
1.BLL层基本构成
CourseManager |
1 namespace CourseManageBLL 2 { 3 public class CourseManager 4 { 5 private CourseService courseService = new CourseService(); 6 7 #region 添加课程 8 public int AddCourse(Course course) 9 { 10 return courseService.AddCourse(course); 11 } 12 #endregion 13 14 #region 查询课程 15 /// <summary> 16 /// 根据多个查询条件动态组合查询 17 /// </summary> 18 /// <param name="categoryId">课程分类编号</param> 19 /// <param name="courseName">课程名称</param> 20 /// <returns></returns> 21 public List<Course> QueryCourse(int categoryId, string courseName) 22 { 23 return courseService.QueryCourse(categoryId, courseName); 24 } 25 #endregion 26 27 #region 修改课程 28 public int ModifyCourse(Course course) 29 { 30 return courseService.ModifyCourse(course); 31 } 32 #endregion 33 34 #region 删除课程 35 public int DeleteCourse(Course course) 36 { 37 return courseService.DeleteCourse(course); 38 } 39 #endregion 40 } 41 } |
TeacherManager |
1 namespace CourseManageBLL 2 { 3 public class TeacherManager 4 { 5 private TeacherService teacherService = new TeacherService(); 6 7 public Teacher TeacherLogin(Teacher teacher) 8 { 9 teacher = teacherService.TeacherLogin(teacher); 10 return teacher; 11 } 12 } 13 } |
CourseCategoryManager |
1 namespace CourseManageBLL 2 { 3 public class CourseCategoryManager 4 { 5 private CourseCategoryService categoryService = new CourseCategoryService(); 6 public List<CourseCategory> GetCourseCategories() 7 { 8 return categoryService.GetCourseCategories(); 9 } 10 } 11 } |
END