Exemple #1
0
 public UserVO(UserPO po) {
   id = po.getID();
   password = po.getPassword();
   authority = po.getAuthority();
   name = po.getName();
   sex = po.getSex();
   job = po.getJob();
   hallId = po.getHallId();
 }
Exemple #2
0
 public UserVO findUser(String known, String info) {
   UserPO po = dataFactory.getUserdataService().find(known, info);
   if (po == null) return null;
   String hallName = apartmentbl.getName(po.getHallId());
   return new UserVO(
       po.getID(),
       po.getPassword(),
       po.getAuthority(),
       po.getName(),
       po.getSex(),
       po.getJob(),
       hallName);
 }
 public void driver(UserDataService userData) {
   UserPO user1 = new UserPO("100000001", UserType.DELIVERY, "Feifei", 1, "0011001", "abc123");
   UserPO user2 = new UserPO("000000001", UserType.ADMINISTRATOR, "Shiny", 5, "", "admin");
   if (userData.add(user1).equals(ResultMessage.SUCCEED)) {
     System.out.println("add succeed");
   }
   if (userData.add(user2).equals(ResultMessage.SUCCEED)) {
     System.out.println("add succeed");
   }
   if (userData.add(user1).equals(ResultMessage.EXITED)) {
     System.out.println("add failed,car exited");
   }
   UserPO get = userData.find("100000001");
   if (get != null)
     System.out.println("find:name=" + get.getUserName() + ",password="******"100000002");
   if (get == null) System.out.println("find failed,not found");
   user1.setUserId("100000002");
   if (userData.modify(user1).equals(ResultMessage.SUCCEED)) System.out.println("modify succeed");
   if (userData.delete("100000002").equals(ResultMessage.SUCCEED))
     System.out.println("delete succeed");
   if (userData.delete("100000002").equals(ResultMessage.NOTFOUND))
     System.out.println("delete failed,not found");
 }