Business Logic Layer

In this session we will develop business logic layer .We need to create a class ,where we can define all the methods for insert, update , delete and retrieve operation . Here is the code for class .


 public class StudentHandler
    {
         StudentDBAccess studentDb = null;

        public StudentHandler()
        {
            studentDb = new StudentDBAccess();
        }

         public List<Student> GetStudentList()
        {
            return studentDb.GetStudentList();
        }

          public bool UpdateStudent(Student student)
        {
            return studentDb.UpdateStudent(student);
        }

 
        public Student GetStudentDetails(int studentId)
        {
            return studentDb.GetStudentsDetails(studentId);
        }

        /
        public bool DeleteStudent(int studentId)
        {
            return studentDb.DeleteStudent(studentId);
        }

     
        public bool AddNewStudent(Student student)
        {
            return studentDb.AddNewStudent(student);
        }
    }
}

2 comments: