public int selectCourse(int sid, int cid)
 {
     int startyear = int.Parse(new StudentBusiness().getStuBySid(sid).Startyear.ToString());
     int year = DateTime.Now.Year;
     int month = DateTime.Now.Month;
     int semester = (month >= 1 && month <= 6) ? 2 * (year - startyear) : 2 * (year - startyear) + 1;
     ScModel scModel = new ScModel(sid, cid, semester);
     CourseService courseService = new CourseService();
     //判断是否有先修
     if (!courseService.ifPrecourceYes(sid,cid,semester))
     {
         return 2;
     }
     //判断是否冲突
     else if (courseService.isSectionNotAvailable(sid,cid,semester))
     {
         return 3;
     }
     else
     {
         return courseService.insertSelectedCourse(scModel);
     }
 }