⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 manageaction.java

📁 JSP实现的在线网络购物系统JAVA程序源码,
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
            Exception {
        GenericVO gvo = new GoodsMgr().getPayMethodDetail(BaseUtil.toInt(
                request.
                getParameter("paymethod_id")));

        request.setAttribute("bean", gvo);
        return mapping.findForward("toPayMethodModify");
    }

    public ActionForward doPayMethodModify(ActionMapping mapping,
                                           ActionForm form,
                                           HttpServletRequest request,
                                           HttpServletResponse response) throws
            Exception {
        GenericVO gvo = new GenericVO();
        gvo = AppUtil.convertParameters(request, gvo); //将request 中的参数设置到cvo
        new GoodsMgr().modifyPayMethod(gvo);

        return mapping.findForward("doPayMethodModify");
    }

    public ActionForward doPayMethodDelete(ActionMapping mapping,
                                           ActionForm form,
                                           HttpServletRequest request,
                                           HttpServletResponse response) throws
            Exception {
        new GoodsMgr().deletePayMethod(BaseUtil.toInt(request.getParameter(
                "paymethod_id")));

        return mapping.findForward("doPayMethodDelete");
    }

    public ActionForward toPostMethodManage(ActionMapping mapping,
                                            ActionForm form,
                                            HttpServletRequest request,
                                            HttpServletResponse response) throws
            Exception {
        Vector r = new GoodsMgr().getPostMethod();

        request.setAttribute("RESULT", r);
        return mapping.findForward("toPostMethodManage");
    }

    public ActionForward toPostMethodAdd(ActionMapping mapping, ActionForm form,
                                         HttpServletRequest request,
                                         HttpServletResponse response) throws
            Exception {

        return mapping.findForward("toPostMethodAdd");
    }

    public ActionForward doPostMethodAdd(ActionMapping mapping, ActionForm form,
                                         HttpServletRequest request,
                                         HttpServletResponse response) throws
            Exception {
        GenericVO gvo = new GenericVO();
        gvo = AppUtil.convertParameters(request, gvo); //将request 中的参数设置到cvo
        new GoodsMgr().addPostMethod(gvo);

        return mapping.findForward("doPostMethodAdd");
    }

    public ActionForward toPostMethodModify(ActionMapping mapping,
                                            ActionForm form,
                                            HttpServletRequest request,
                                            HttpServletResponse response) throws
            Exception {
        GenericVO gvo = new GoodsMgr().getPostMethodDetail(BaseUtil.toInt(
                request.
                getParameter("postmethod_id")));

        request.setAttribute("bean", gvo);
        return mapping.findForward("toPostMethodModify");
    }

    public ActionForward doPostMethodModify(ActionMapping mapping,
                                            ActionForm form,
                                            HttpServletRequest request,
                                            HttpServletResponse response) throws
            Exception {
        GenericVO gvo = new GenericVO();
        gvo = AppUtil.convertParameters(request, gvo); //将request 中的参数设置到cvo
        new GoodsMgr().modifyPostMethod(gvo);

        return mapping.findForward("doPostMethodModify");
    }

    public ActionForward doPostMethodDelete(ActionMapping mapping,
                                            ActionForm form,
                                            HttpServletRequest request,
                                            HttpServletResponse response) throws
            Exception {
        new GoodsMgr().deletePostMethod(BaseUtil.toInt(request.getParameter(
                "postmethod_id")));

        return mapping.findForward("doPostMethodDelete");
    }

    private void genIndexTop() throws AppException {
        try {
            //生成首页的排行栏
            String content =
                    "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">";
            OutputStreamWriter osw = null;
            String fileName = "";
            File f = new File(getServlet().getServletContext().getRealPath(
                    "/") +
                              "htmlet/indextop.htm");
            if (!f.exists()) {
                f.createNewFile();
            }
            osw = new OutputStreamWriter(new FileOutputStream(f), "UTF-8");
            Vector r = new GoodsMgr().getTopByType(0);
            GenericVO tvo = null;
            File f2;
            for (int i = 0; i < r.size(); i++) {
                tvo = (GenericVO) r.elementAt(i);
                fileName = getServlet().getServletContext().getRealPath("/") +
                           "htmlet/top_" + tvo.getItem("TOP_ID") + ".htm";

                f2 = new File(fileName);
                if (!f2.exists()) {
                    f.createNewFile();
                }
                content += "<div>";
                content += "<table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" border=\"1\" style=\"border-collapse: collapse\" bordercolor=\"#CCCCCC\" height=\"134\">";
                content += "<tr>";
                content +=
                        "<td align=\"center\" height=\"29\" bgcolor=\"#FFFFCC\">" +
                        tvo.getItem("NAME") + "</td>";
                content += "</tr>";
                content += "<tr>";
                content +=
                        "<td height=\"105\" style=\"padding:3px;line-height: 150%\">";
                //读取排行榜文�?
                BufferedReader br = new BufferedReader(new
                        InputStreamReader(new
                                          FileInputStream(fileName),
                                          "UTF-8"));
                String data = null;
                while ((data = br.readLine()) != null) {
                    content = content + data;
                }
                br.close();
                content += "</td>";
                content += "</tr>";
                content += "</table>";
                content += "</div>";
                content += "<div style=\"height:20px;\"></div>";
            }
            osw.write(content, 0, content.length());
            osw.flush();
            osw.close();
        } catch (Exception ex) {
            throw new AppException(ex);
        }
    }

    private void genIndexRecTop() throws AppException {
        try {
            //生成首页的排行栏
            OutputStreamWriter osw = null;
            String fileName = "";
            File f = new File(getServlet().getServletContext().getRealPath(
                    "/") +
                              "htmlet/indexrectop.htm");
            if (!f.exists()) {
                f.createNewFile();
            }
            osw = new OutputStreamWriter(new FileOutputStream(f), "UTF-8");
            String content =
                    "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">";
            Vector r = new GoodsMgr().getTopByType(1);
            GenericVO tvo = null;
            File f2;
            for (int i = 0; i < r.size(); i++) {
                tvo = (GenericVO) r.elementAt(i);
                fileName = getServlet().getServletContext().getRealPath("/") +
                           "htmlet/rectop_" + tvo.getItem("TOP_ID") + ".htm";

                f2 = new File(fileName);
                if (!f2.exists()) {
                    f.createNewFile();
                }
                content += "<div>";
                content += "<table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" border=\"1\" style=\"border-collapse: collapse\" bordercolor=\"#CCCCCC\" height=\"134\">";
                content += "<tr>";
                content +=
                        "<td align=\"center\" height=\"29\" bgcolor=\"#FFFFCC\">" +
                        tvo.getItem("NAME") + "</td>";
                content += "</tr>";
                content += "<tr>";
                content +=
                        "<td height=\"105\" style=\"padding:3px;line-height: 150%\">";
                //读取排行榜文�?
                BufferedReader br = new BufferedReader(new
                        InputStreamReader(new
                                          FileInputStream(fileName),
                                          "UTF-8"));
                String data = null;
                while ((data = br.readLine()) != null) {
                    content = content + data;
                }
                br.close();
                content += "</td>";
                content += "</tr>";
                content += "</table>";
                content += "</div>";
                content += "<div style=\"height:20px;\"></div>";
            }
            osw.write(content, 0, content.length());
            osw.flush();
            osw.close();
        } catch (Exception ex) {
            throw new AppException(ex);
        }
    }

    private void genIndexCate() throws AppException {
        try {
            //生成首页的排行栏
            String content =
                    "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">";
            OutputStreamWriter osw = null;
            File f = new File(getServlet().getServletContext().getRealPath(
                    "/") +
                              "htmlet/indexcate.htm");
            if (!f.exists()) {
                f.createNewFile();
            }
            osw = new OutputStreamWriter(new FileOutputStream(f), "UTF-8");
            Vector r = new GoodsMgr().getTopGoodsType();
            Vector r2 = null;
            GenericVO tvo = null;
            GenericVO tvo2 = null;
            for (int i = 0; i < r.size(); i++) {
                tvo = (GenericVO) r.elementAt(i);
                content += "<div style=\"padding:5px;width:50%;height:120px;float:left;line-height:120%;\">";
                content += "<a href='/main.do?event=toGoodsList1&goodstype_id=" +
                        tvo.getItem("GOODSTYPE_ID") +
                        "'><font color=\"#B80000\"><strong>" +
                        tvo.getItem("TYPENAME") + "</strong></font></a>";
                content += "<hr color = \"#CCCCCC\" size = \"0\" noshade>";
                r2 = new GoodsMgr().getGoodsTypeByPid(BaseUtil.toInt(tvo.
                        getItem("GOODSTYPE_ID")));
                for (int j = 0; j < r2.size() && j < 5; j++) {
                    tvo2 = (GenericVO) r2.elementAt(j);
                    content +=
                            "<a href='/main.do?event=toGoodsList2&goodstype_id2=" +
                            tvo2.getItem("GOODSTYPE_ID") +
                            "'><font color='black'>" + tvo2.getItem("TYPENAME") +
                            "</font></a><br>";
                }
                content += "<a href='/main.do?event=toGoodsList1&goodstype_id=" +
                        tvo.getItem("GOODSTYPE_ID") +
                        "'><font color='black'>...more</font></a>";
                content += "</div >";
            }
            osw.write(content, 0, content.length());
            osw.flush();
            osw.close();
        } catch (Exception ex) {
            throw new AppException(ex);
        }
    }

    private void genIndexGoodsList() throws AppException {
        try {
            //生成首页的排行栏
            String content =
                    "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">";
            OutputStreamWriter osw = null;
            File f = new File(getServlet().getServletContext().getRealPath(
                    "/") +
                              "htmlet/indexgoods.htm");
            if (!f.exists()) {
                f.createNewFile();
            }
            osw = new OutputStreamWriter(new FileOutputStream(f), "UTF-8");
            Vector r = new GoodsMgr().getGoodByItem("index");
            GenericVO tvo = null;
            for (int i = 0; i < r.size(); i++) {
                tvo = (GenericVO) r.elementAt(i);
                content += "<div style=\"height:138px; padding-left:5px;padding-right:5px;padding-top:10px;padding-bottom:10px;float:left;\">";
                content += "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"padding:3px;border:#cccccc 0px solid;\" width=\"260\" height=\"98\">";
                content += "<tr>";
                content += "<td style=\"border-right:#CCCCCC 1px solid;\" align=\"center\" width=\"40%\" rowspan=\"2\" height=\"98\">";
                content +=
                        "<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">";
                content += "<tr>";
                content +=
                        "<td valign=\"middle\" align=\"center\" height=\"18\">";
                content += "<img border=\"0\" src=\"" + tvo.getItem("LOGO1") +
                        "\" alt=\"\"><br>";
                content += "</td>";
                content += "</tr>";
                content += "<tr>";
                content +=
                        "<td align=\"center\" va

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -