Beispiel #1
0
 @Override
 public void createUser(User user, String tokenCode) {
   dao.create(user);
   Token token = new Token();
   token.setUserid(user.getUserid());
   token.setTokencode(tokenCode);
   Calendar cal = Calendar.getInstance(); // ȡ��ǰ���ڡ�
   Date currentDate = cal.getTime();
   cal.add(Calendar.DAY_OF_MONTH, +30); // ȡ��ǰ���ڵĺ�30��.
   token.setCreatedatetime(currentDate);
   token.setExpiredatetime(cal.getTime());
   tokendao.createTokenCode(token);
 }
Beispiel #2
0
 @Override
 public int createShopUser(User user) {
   // TODO Auto-generated method stub
   dao.create(user);
   Area a = a_dao.GetByName("鼓楼区", "南京");
   if (a == null) {
     a = a_dao.findAll().get(0);
   }
   Shop shop = new Shop();
   shop.setArea(a);
   shop.setShopname("shop of " + user.getUsername());
   shop.setUser(user);
   shop_dao.create(shop);
   return user.getUserid();
 }
Beispiel #3
0
 @Override
 public User findUserByUserid(int id) {
   // TODO Auto-generated method stub
   return dao.findUserByUserid(id);
 }
Beispiel #4
0
 @Override
 public int GetUserIDByName(String username, String password) {
   // TODO Auto-generated method stub
   return dao.GetUserIDByName(username, password);
 }
Beispiel #5
0
 @Override
 public User findOneByPass(String username, String pass) {
   // TODO Auto-generated method stub
   return dao.findOneByPass(username, pass);
 }
Beispiel #6
0
 @Override
 public boolean checkByName(String username) {
   // TODO Auto-generated method stub
   return dao.checkByName(username);
 }
Beispiel #7
0
 @Override
 public List<User> findUserByPage(int page, int pageSize) {
   // TODO Auto-generated method stub
   return dao.findUserByPage(page, pageSize);
 }