Ejemplo n.º 1
0
        public static bool DeleteStudentBL(int studentID)
        {
            bool delstudent = false;

            try
            {
                if (studentID > 0)
                {
                    StudentDALCl dal = new StudentDALCl();
                    delstudent = dal.DeleteStudentDAL(studentID);
                }
                else
                {
                    throw new StudentExceptionCl("Invalid Student ID");
                }
            }
            catch (StudentExceptionCl)
            {
                throw;
            }
            catch (Exception ex)
            {
                throw ex;
            }



            return(delstudent);
        }
Ejemplo n.º 2
0
        public static bool UpdateStudentBL(StudentEntityCl entobj)
        {
            bool studentUpdated = false;

            try
            {
                StudentDALCl dal = new StudentDALCl();
                studentUpdated = dal.UpdateStudentDAL(entobj);
                //if (ValidateGuest(updateGuest))
                //{
                //    GuestDAL guestDAL = new GuestDAL();
                //    guestUpdated = guestDAL.UpdateGuestDAL(updateGuest);
                //}
            }
            catch (StudentExceptionCl)
            {
                throw;
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(studentUpdated);
        }
Ejemplo n.º 3
0
        public static int getNextIdBAL()
        {
            int studentid = 0;

            StudentDALCl dal = new StudentDALCl();

            studentid = dal.getNextIdDAL();

            return(studentid);
        }
Ejemplo n.º 4
0
        public static List <StudentEntityCl> GetAllStudentsBL()
        {
            List <StudentEntityCl> studentList = null;

            try
            {
                StudentDALCl dal = new StudentDALCl();
                studentList = dal.GetAllStudentsDAL();
            }


            catch (StudentExceptionCl ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(studentList);
        }
Ejemplo n.º 5
0
        public static StudentEntityCl SearchStudentBL(int studentID)
        {
            StudentEntityCl entobj = null;

            try
            {
                StudentDALCl dal = new StudentDALCl();
                entobj = dal.SearchStudentDAL(studentID);
            }
            catch (StudentExceptionCl ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }



            return(entobj);
        }
Ejemplo n.º 6
0
        public static bool AddStudentBL(StudentEntityCl entobj)
        {
            bool studentAdded = false;

            try
            {
                if (Validation(entobj))
                {
                    StudentDALCl dal = new StudentDALCl();
                    studentAdded = dal.AddStudentDAL(entobj);
                }
            }
            catch (StudentExceptionCl ex)
            {
                MessageBox.Show(ex.ToString());
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(studentAdded);
        }