Examples of TbPost


Examples of com.postmodule.bean.TbPost

        if("add".equals(method)){
        String postName=request.getParameter("postName");
        String postMemo=request.getParameter("postMemo");
        String createTime=request.getParameter("createTime");

            if(new TbPostDAO().add(new TbPost(postName,postMemo,createTime))){
            request.getSession().setAttribute("result", "添加成功");
            }else{           
            request.getSession().setAttribute("result", "添加失败");
            }
             request.getSession(true).setAttribute("tbPostList",new TbPostDAO().getTbPostAll());
            response.sendRedirect("PostModule/TbPostList.jsp");
        }
        if("del".equals(method)){
            if(UtilDAO.delin("Tb_Post", "PostId", request.getParameter("delIds"))){           
            request.getSession().setAttribute("result", "删除成功");
            }else{           
            request.getSession().setAttribute("result", "删除失败");
            }
             request.getSession(true).setAttribute("tbPostList",new TbPostDAO().getTbPostAll());
            response.sendRedirect("PostModule/TbPostList.jsp");
        }
        if("edit".equals(method)){
        int postId=Integer.parseInt(request.getParameter("postId"));
        String postName=request.getParameter("postName");
        String postMemo=request.getParameter("postMemo");
        String createTime=request.getParameter("createTime");

            if(new TbPostDAO().add(new TbPost(postId,postName,postMemo,createTime))){
            request.getSession().setAttribute("result", "修改成功");
            }else{           
            request.getSession().setAttribute("result", "修改失败");
            }
             request.getSession(true).setAttribute("tbPostList",new TbPostDAO().getTbPostAll());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.