Package com.cin.dto

Examples of com.cin.dto.UserDTO


      if( jobDto.getOccupationCode() != 0 ){
        //userEjb.getJob().setgetOccupation(getgetOccupationByCode());
      }
    }
    persist(userEjb);
    return new UserDTO(userEjb);
  }
View Full Code Here


      stmt.execute("select ID, CUSTOMER_SSN, AGENT_SSN, INVITE_DATE from invitation where id="+id);
      ResultSet rs = stmt.getResultSet();
      if( rs.next() ){
        assert rs.getInt(1) == id;
       
        UserDTO customer = new UserDTO();
        customer.setSsn(rs.getInt(2));
        UserDTO agent = new UserDTO();
        agent.setSsn(rs.getInt(3));
        InvitationDTO inv = new InvitationDTO(id, agent, customer, rs.getDate(4));
        return inv;
      } else {
        return null;
      }
View Full Code Here

    Statement stmt = connection.createStatement();
    try{
      stmt.execute("select NAME, ZIP, SSN, AGE, SEX, MARITAL, RACE, TAXSTAT, DETAIL, HOUSEHOLDDETAIL, FATHERORIGIN, MOTHERORIGIN, BIRTHCOUNTRY, CITIZENSHIP from userrecord where ssn="+ssn);
      ResultSet rs = stmt.getResultSet();
      if( rs.next() ){
        UserDTO user = new UserDTO();
        user.setName(rs.getString(1).trim());
        user.setZipCode(rs.getString(2));
        user.setSsn(rs.getInt(3));
        user.setAge(rs.getInt(4));
        user.setSex(rs.getString(5));
        user.setMarital(rs.getString(6));
        user.setRace(rs.getString(7));
        user.setTaxStatus(rs.getString(8));
        user.setDetail(rs.getString(9));
        user.setHouseholdDetail(rs.getString(10));
        user.setFatherOrigin(rs.getString(11));
        user.setMotherOrigin(rs.getString(12));
        user.setBirthCountry(rs.getString(13));
        user.setCitizenship(rs.getString(14));     
        return user;
      } else {
        return null;
      }
    }finally{
View Full Code Here

    int customerSsn = 10;
   
    // create policy
    InsurencePolicyDTO samplePolicy = null;
    InvitationDTO invitation = new InvitationDTO();
    invitation.setAgent(new UserDTO(agentSsn));
    invitation.setCustomer(new UserDTO(customerSsn));
   
    // send invitation
    service.sendInvitation(invitation, samplePolicy);
   
    // make sure the agent was not compensate before
View Full Code Here

  public void addUser(UserDTO user) {
    if( ssnMap.containsKey(user.getSsn()) ){
      throw new IllegalStateException("User already exists in cache.");
    }
   
    UserDTO newUser = new UserDTO(user.getSsn());
    newUser.setZipCode(user.getZipCode());
    newUser.setScore(user.getScore());
     
    ssnMap.put(newUser.getSsn(), newUser);
   
    if( newUser.getZipCode() != null ){
      Set<UserDTO> zipUsers = zipMap.get(newUser.getZipCode());
      if( zipUsers == null ){
        zipUsers = new TreeSet<UserDTO>();
        zipMap.put(newUser.getZipCode(), zipUsers);
      }
   
      zipUsers.add(newUser);
    }
  }
View Full Code Here

  public boolean hasUser(int ssn){
    return ssnMap.containsKey(ssn);
  }
 
  public int getScore(int ssn){
    UserDTO user = ssnMap.get(ssn);
    if( user == null ){
      throw new IllegalStateException("User is not in the cache.");
    } else {
      return user.getScore();
    }
  }
View Full Code Here

      return user.getScore();
    }
  }
 
  public void clear(int ssn){
    UserDTO oldUser = ssnMap.remove(ssn);
   
    if( oldUser != null ){
      Set<UserDTO> zipUsers = zipMap.get(oldUser.getZipCode());
      if( zipUsers != null ){
        zipUsers.remove(oldUser);
      }
    }
  }
View Full Code Here

    tryUpdate();
  }
 
  private void tryUpdate(){
    try {
      UserDTO user = new UserDTO(ssn);
      GenericRequest request = new GenericRequest();
      request.setUser(user);
      user = controller.retrieveUserDetails(request).getUser();
     
      String newDetail = ""+new Random().nextInt();
      user.setDetail(newDetail);
      controller.updateUserRecord_test(user);
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

    }
  }
  private void tryGetScore() {
    try {
      ArrayList<UserDTO> users = new ArrayList<UserDTO>();
      users.add(new UserDTO(ssn));
     
      GenericRequest request = new GenericRequest();
      request.setUserList(users);
      controller.calculateScoreForUsers(request);
    } catch (MissingInformationException e) {
View Full Code Here

  public UserDTO retrieveUserRecord(UserDTO pDTO) throws UserNotFoundException{
    return retrieveUserRecord(pDTO.getSsn());
  }
 
  public UserDTO retrieveUserRecord(int ssn) throws UserNotFoundException{
    UserDTO userFound = userFactory.findUserBySsn(ssn);
    if( userFound == null ){
      throw new UserNotFoundException("User with ssn "+ssn+" was not found.");
    }
    return userFound;
  }
View Full Code Here

TOP

Related Classes of com.cin.dto.UserDTO

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.