📄 userservicebean.java~29~
字号:
package xian.bin.serivce;import java.util.*;import xian.bin.user.*;import xian.bin.admin.*;import app.*;public class UserServiceBean implements SerivceUser { Test test; public UserServiceBean()throws Exception { test=new Test(); } //--------------------后台用户-------------------------------- //添加一个后台用户 public void addAdmin(String admin,String pwd,String popedom) throws Exception { test.managerHome.create().addAdmin(admin,pwd,popedom); } //删除一个后台用户信息 public void delAdmin(String admin) throws Exception { test.managerHome.create().delManager(admin); } //获得所有后台用户信息 public Collection getAllAdmin() throws Exception { try{ return test.managerHome.create().getAllManager(); } catch(Exception e){ e.printStackTrace(); } return null; } //修改后台用户信息 public void updataAdmin(String admin,String pwd,String popedom) throws Exception { test.managerHome.create().updateManager(admin,pwd,popedom); } //---------------------前台用户--------------------------------------- //获得前台所有用户信息 public Collection getAllUser() throws Exception { System.out.println("在服务接口中查找所有用户信息!!!"); try{ User user=test.userHome.create(); Iterator its=user.getAllUserInfo().iterator(); while(its.hasNext()){ UserDTO dto=(UserDTO)its.next(); System.out.println("name="+dto.getUsername()); System.out.println("pwd="+dto.getPassword()); } return user.getAllUserInfo(); } catch(Exception e){ e.printStackTrace(); } return null; } //获得前台普通/会员用户信息----根据用户类型 public Collection getCommonUser(int userType) throws Exception { return test.userHome.create().getCommonUser(userType); } //删除一个前台用户信息 public void delUser(String userName) throws Exception { test.userHome.create().delUserInfo(userName); } //根据用户名进行模糊查找 public Collection getUser(String userName) throws Exception { //return test.userHome.create().getUserInfo(userName); return null; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -