Exemplo n.º 1
0
    public Boolean DeleteCourse(CourseVO inCourse)
    {
        // Add business validations if any
        Boolean courseCode = courseobj.DeleteCourse(inCourse);

        return(courseCode);
    }
Exemplo n.º 2
0
        public void TestCourseDao_AddCourse()
        {
            Course course = new Course();

            course.CourseID          = "UnitTests";
            course.CourseName        = "單元測試";
            course.CourseDescription = "單元測試";
            CourseDao.AddCourse(course);

            Course dbCourse = CourseDao.GetCourseById(course.CourseID);

            Assert.IsNotNull(dbCourse);
            Assert.AreEqual(course.CourseID, dbCourse.CourseID);

            Console.WriteLine("課稱編號 = " + dbCourse.CourseID);
            Console.WriteLine("課程名稱 = " + dbCourse.CourseName);
            Console.WriteLine("課程描述 = " + dbCourse.CourseDescription);

            CourseDao.DeleteCourse(dbCourse);
            dbCourse = CourseDao.GetCourseById(course.CourseID);
            Assert.IsNull(dbCourse);
        }