Esempio n. 1
0
        public UserDTO Add(UserDTO user)
        {
            USER    userToAdd, addedUser;
            UserDTO retVal;

            retVal = null;

            if (CheckHelper.IsFilled(user))
            {
                try
                {
                    userToAdd = transformer.TransformFromDTO(-1, user);
                    addedUser = userRepository.Add(userToAdd);

                    if (CheckHelper.IsFilled(addedUser))
                    {
                        addedUser.FACULTY = facultyRepository.GetById(user.FacultyId);
                        retVal            = transformer.TransformToDTO(addedUser);
                    }
                }
                catch (Exception e) {
                }
            }

            return(retVal);
        }
        public List <UserDTO> GetStudents(long facId)
        {
            List <UserDTO>  retVal = null;
            UserTransformer userTransformer;
            List <USER>     students;


            students        = userRepository.GetForFaculty(facId);
            userTransformer = new UserTransformer();

            if (CheckHelper.IsFilled(students))
            {
                retVal = userTransformer.TransformToDTO(students);
            }

            return(retVal);
        }