Beispiel #1
0
        public UserDTO Get(int UserID)
        {
            UserDTO oUserDTO = null;

            if (UserID > 0)
            {
                User oUser = oUsersRepo.GetUserByID(UserID);
                if (oUser != null)
                {
                    oUserDTO = UserAssembler.ToDTO(oUser);

                    /*
                     * if (oUser.UserAddresses != null && oUser.UserAddresses.Count > 0) {
                     *  oUserDTO.UserAddresses = UserAddressAssembler.ToDTOs(oUser.UserAddresses);
                     * }
                     *
                     * if (oUser.UserEmails != null && oUser.UserEmails.Count > 0) {
                     *  oUserDTO.UserEmails = UserEmailAssembler.ToDTOs(oUser.UserEmails);
                     * }
                     *
                     * if (oUser.UserPhones != null && oUser.UserPhones.Count > 0)
                     * {
                     *  oUserDTO.UserPhones = UserPhoneAssembler.ToDTOs(oUser.UserPhones);
                     * }
                     */
                }
            }

            return(oUserDTO);
        }
Beispiel #2
0
 public UserDTO Create(UserDTO modelDTO)
 {
     if (modelDTO != null)
     {
         User oUser = UserAssembler.ToEntity(modelDTO);
         return(UserAssembler.ToDTO(usersRepo.CreateUser(oUser)));
     }
     return(null);
 }
Beispiel #3
0
        public UserDTO Get(int id)
        {
            UserDTO userDTO = null;

            if (id > 0)
            {
                User oUser = usersRepo.GetUserByID(id);
                if (oUser != null)
                {
                    userDTO = UserAssembler.ToDTO(oUser);
                }
            }
            return(userDTO);
        }