小区物业管理信息系统毕业论文 联系客服

发布时间 : 星期五 文章小区物业管理信息系统毕业论文更新完毕开始阅读3c960b94b52acfc789ebc9e3

信息科学与技术学院学士学位论

4.2.2 用户信息修改的实现

系统用的是Frameset布局,总体分为上中下三块,中间一块又分为左右两块。上面一块为Top.jsp,主要是用来显示系统当前用户,系统时间,查看个人信息、实现系统刷新,回退等功能。下面一块则用来显示系统的Logo。功能主要分布在中间一块,中间的左边是用来显示系统功能操作的入口,我用了一颗JS数来把功能进行了一个分层。右边则用来进行功能的操作。用户信息修改如图4-3所示。

图4-3管理员信息修改模块

说明:管理员信息修改,如果是管理员,他可以修改所有的信息,但是不管他修改说明信息,他都要符合该信息的格式,如用户名必须是2-10位字符,密码必须是4-16位字母或数字,邮件要是邮件的格式,电话必须是11位手机号码等,这些我都是通过页面的JS代码进行了控制。

实现代码如下:

public void doGet(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

UserBeanBO ubb=new UserBeanBO(); response.setContentType(\

28

信息科学与技术学院学士学位论

response.setCharacterEncoding(\PrintWriter out = response.getWriter(); //得到当前登录用户名

String loginname=request.getParameter(\request.setAttribute(\//得到登录用户的信息

UserBean ub1=ubb.getUserBean(loginname); UserBean ub=new UserBean(); //得到要修改信息用户的用户ID

String userid1=request.getParameter(\//把String型的userid转为long型 long userid=Long.parseLong(userid1); //得到页面传过来的值

String u=request.getParameter(\String p=request.getParameter(\String email=request.getParameter(\String phone1=request.getParameter(\//string转long

long phone=Long.parseLong(phone1); String adress=request.getParameter(\String privilige1=request.getParameter(\//string转int

int privilige=Integer.valueOf(privilige1); //判断用户信息修改是否成功

if(ubb.ModefyUser(userid, u, p, email, phone, adress, privilige)){

//用户信息修改成功,并且登录用户是管理员

if(ub1.getPrivilige()==1){

29

信息科学与技术学院学士学位论

//跳转到userInfo.jsp页面

request.getRequestDispatcher(\

}else{

//用户信息修改成功,并且登录用户是普通用户,跳转到selfInfo.jsp页面 }

request.getRequestDispatcher(\

}

}else{

//不成功,跳转到modify.jsp页面

request.getRequestDispatcher(\}

/**

* The doPost method of the servlet.

*

* This method is called when a form has its tag value method equals to post. *

* @param request the request send by the client to the server * @param response the response send by the server to the client * @throws ServletException if an error occurred * @throws IOException if an error occurred

*/ public void doPost(HttpServletRequest request, HttpServletResponse

response)

throws ServletException, IOException {

this.doGet(request, response); }

}

30

信息科学与技术学院学士学位论

4.2.3用户注册的实现

住户信息包括户主名称、联系电话、邮件、地址等基本信息,当填写信息完成后,点击页面下方的提交,如果信息格式正确,则系统提示添加成功。通过系统左边的住户资料管理管理可查看用户的基本信息。如图4-4所示。

图4-4新建住户信息模块

实现代码如下:

public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType(\response.setCharacterEncoding(\PrintWriter out = response.getWriter(); UserBean ub=new UserBean();

31