public string EnrollCourse(Enroll enroll) { if (!aEnrollCourseGateway.IsEnrollExixts(enroll)) { int rowAffect = aEnrollCourseGateway.EnrollCourse(enroll); if (rowAffect > 0) { return("Save Successful"); } else { return("Save Failed"); } } else { return("A student can enroll in a course once only!!!"); } }
public string EnrollCourse(EnrollCourse aEnrollCourse) { if (aEnrollCourseGateway.IsCourseEnrolledByStudent(aEnrollCourse.CourseId, aEnrollCourse.StudentId)) { int rowAfeected = aEnrollCourseGateway.EnrollCourse(aEnrollCourse); if (rowAfeected > 0) { return("Course Enrolled"); } else { return("Course not Enrolled"); } } else { return("Student Already Enrolled in The Course"); } }