BLL/CourseBLL.cs

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data ;
using Model;
using DAL;

namespace BLL
{
  public   class CourseBLL
  {

      #region//获取课程
      public DataTable GetCourse()
      {
          CourseDAL cdal = new CourseDAL();
          return cdal.GetCourse();
      }
      #endregion

      #region//添加课程
      public bool CourseAdd(Course course)
      {
          if (course.CurNo == "")
          {
              throw new System.Exception("课程编号不能为空!");
          }
          if (course.CurName == "")
          {
              throw new System.Exception("课程名称不能为空!");
          }
          if (course.CurCredit == 0)
          {
              throw new System.Exception("课程学分不能为0!");
          }
          if (course.CurPeriod == 0)
          {
              throw new System.Exception("课程学时不能为0!");
          }
          if (course.CurType == "")
          {
              throw new System.Exception("课程类型不能为空!");
          }
          CourseDAL curDal = new CourseDAL();
          bool curModel = curDal.CourseCheck(course.CurNo);
          if (curModel == true)
          {
              throw new System.Exception("该课程编号已经存在,添加失败!");
          }
          else
          {
              return (curDal.CourseAdd(course));
          }
      }
      #endregion
      #region/删除课程
      public bool CourseDel(string curno)
      {
          
后面还有 35 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。