// Enroll successfull code here public string EnrollCourse(Enroll enrull) { if (enrollGateway.allreadyEnrolled(enrull)) { int rowAffect = enrollGateway.UpdateEnrolledCourse(enrull); if (rowAffect > 0) { return("Enrolled Course Updated Successful"); } else { return("Operation Failed"); } } else { int rowAffact = enrollGateway.EnrollCourse(enrull); if (rowAffact > 0) { return("Course Enrolledment Successful"); } else { return("Operation Failed"); } } }
public string EnrollCourse(StudentEnroll enroll) { if (!enrollGateway.IsEnrollExixts(enroll)) { int rowAffect = enrollGateway.EnrollCourse(enroll); if (rowAffect > 0) { return("Save Successful"); } else { return("Save Failed"); } } else { return("A student can enroll in a course once only!!!"); } }