public int AddStudentBL(StudentDTO sd) { Student s = new Student(); // s.studentId = sd.studentId; s.studentFirstName = sd.studentFirstName; s.studentLastName = sd.studentLastName; s.studentAddress = sd.studentAddress; s.studentCity = sd.studentCity; s.studentParentEmail = sd.studentParentEmail; s.studentParentName = sd.studentParentName; s.studentParentPel = sd.studentParentPel; s.studentPel = sd.studentPel; s.studentTz = sd.studentTz; StudentDAL student = new StudentDAL(); int result = student.AddStudentDAL(s); return(result); }
public bool AddStudentBL(Student student) { StudentDAL studentOperations = new StudentDAL(); bool isAdded = false; try { isAdded = studentOperations.AddStudentDAL(student); if (isAdded == false) { throw new StudentException("Student Details not Added"); } } catch (StudentException e) { throw e; } return(isAdded); }