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

📄 acttopsf02provider.java

📁 Jbuilder2006开发的严格按MVC设计模式组织开发过程
💻 JAVA
字号:
package com.tops.crm.action;

import com.tops.j2eebase.web.TopsBaseDispatchAction;
import org.apache.struts.action.*;
import javax.servlet.http.*;
import com.tops.j2eebase.exception.*;
import com.tops.crm.model.*;
import com.tops.crm.control.*;
import com.tops.j2eebase.model.DataPage;

public class ActTopsF02Provider extends TopsBaseDispatchAction {
    public ActionForward add(ActionMapping mapping, ActionForm form,
                             HttpServletRequest request,
                             HttpServletResponse response) throws
            BugReportBaseException {
        //编写你的代码
        String userName = getLoginUserName(request);
        ActfrmTopsF02Provider obj = new ActfrmTopsF02Provider();
        obj.setZzCreateDate(new java.util.Date());
        obj.setZzCreateUser(userName);
        obj.setMethod("addresult");
        request.setAttribute("actfrmTopsF02Provider", obj);
        return mapping.findForward("actfrmTopsF02Provider.editor");
    }

    public ActionForward init(ActionMapping mapping, ActionForm form,
                              HttpServletRequest request,
                              HttpServletResponse response) throws
            BugReportBaseException {
        //编写你的代码
        EMTopsF02Provider em = EMTopsF02Provider.getInstance();
        request.getSession().removeAttribute("ActfrmTopsF02Provider_condition");
        String currentPage = request.getParameter("page");
        if (currentPage == null) {
            currentPage = String.valueOf(1);
        }
        String pageUrl = request.getContextPath() +
                         "/actTopsF02Provider.do?method=init";
        DataPage result = em.findAllByPage(pageUrl,
                                           Integer.parseInt(currentPage));

        request.setAttribute("objlist", result.getPageData());
        request.setAttribute("pageStr", result.getPageStr());

        return mapping.findForward("actfrmTopsF02Provider.list");
    }

    public ActionForward search(ActionMapping mapping, ActionForm form,
                                HttpServletRequest request,
                                HttpServletResponse response) throws
            BugReportBaseException {
        //编写你的代码
        EMTopsF02Provider em = EMTopsF02Provider.getInstance();
        ActfrmTopsF02Provider searchCondition = null;
        //通过查询按钮递交
        if (request.getMethod().toUpperCase().equals("POST")) {
            searchCondition = (ActfrmTopsF02Provider) form;
            request.getSession().setAttribute(
                    "ActfrmTopsF02Provider_condition",
                    searchCondition);

        } else { //通过分页链接递交
            searchCondition = (ActfrmTopsF02Provider) request.
                              getSession().getAttribute(
                                      "ActfrmTopsF02Provider_condition");
            request.setAttribute(
                    "actfrmTopsF02Provider",
                    searchCondition);
        }

        String currentPage = request.getParameter("page");
        if (currentPage == null) {
            currentPage = String.valueOf(1);
        }
        String pageUrl = request.getContextPath() +
                         "/actTopsF02Provider.do?method=search";
        DataPage result = em.findPageByCondition(searchCondition, pageUrl,
                                                 Integer.parseInt(currentPage));

        request.setAttribute("objlist", result.getPageData());
        request.setAttribute("pageStr", result.getPageStr());

        return mapping.findForward("actfrmTopsF02Provider.list");
    }

    public ActionForward inputhelp(ActionMapping mapping, ActionForm form,
                                   HttpServletRequest request,
                                   HttpServletResponse response) throws
            BugReportBaseException {
        //编写你的代码

        EMTopsF02Provider em = EMTopsF02Provider.getInstance();
        ActfrmTopsF02Provider searchCondition = null;
        //通过查询按钮递交
        if (request.getMethod().toUpperCase().equals("POST")) {
            searchCondition = (ActfrmTopsF02Provider) form;
            if (searchCondition == null) {
                searchCondition = new ActfrmTopsF02Provider();
            }
            searchCondition.setMethod("inputhelp");
            request.setAttribute("actfrmTopsF02Provider", searchCondition);
            request.getSession().setAttribute(
                    "ActfrmTopsF02Provider_InputHelper",
                    searchCondition);

        } else { //通过分页链接递交
            searchCondition = (ActfrmTopsF02Provider) request.
                              getSession().getAttribute(
                                      "ActfrmTopsF02Provider_InputHelper");
            if (searchCondition == null) {
                searchCondition = new ActfrmTopsF02Provider();
            }
            searchCondition.setMethod("inputhelp");
            request.setAttribute("actfrmTopsF02Provider", searchCondition);
        }
        String currentPage = request.getParameter("page");
        if (currentPage == null) {
            currentPage = String.valueOf(1);
        }
        String pageUrl = request.getContextPath() +
                         "/actTopsF02Provider.do?method=inputhelp";
        DataPage result = em.inputhelp(searchCondition, pageUrl,
                                       Integer.parseInt(currentPage));

        request.setAttribute("objlist", result.getPageData());
        request.setAttribute("pageStr", result.getPageStr());

        return mapping.findForward("actfrmTopsF02Provider.inputhelper");
    }


    public ActionForward addresult(ActionMapping mapping, ActionForm form,
                                   HttpServletRequest request,
                                   HttpServletResponse response) throws
            BugReportBaseException {
        //编写你的代码
        ActfrmTopsF02Provider one = (ActfrmTopsF02Provider) form;
        EMTopsF02Provider em = EMTopsF02Provider.getInstance();
        em.add(one);
        request.setAttribute("objlist", em.findAll());
        return mapping.findForward("actfrmTopsF02Provider.list");
    }

    public ActionForward modify(ActionMapping mapping, ActionForm form,
                                HttpServletRequest request,
                                HttpServletResponse response) throws
            BugReportBaseException {
        //编写你的代码
        EMTopsF02Provider em = EMTopsF02Provider.getInstance();
        String id = request.getParameter("id");
        ActfrmTopsF02Provider obj = em.load(id);
        obj.setMethod("modifyresult");
        request.setAttribute("actfrmTopsF02Provider", obj);
        return mapping.findForward("actfrmTopsF02Provider.editor");
    }

    public ActionForward removelinkman(ActionMapping mapping, ActionForm form,
                                HttpServletRequest request,
                                HttpServletResponse response) throws
            BugReportBaseException {
        //编写你的代码
        EMTopsF02Provider em = EMTopsF02Provider.getInstance();
        String linkManUuid = request.getParameter("linkManUuid");
        ActfrmTopsF02Provider obj = em.removelinkman(linkManUuid);
        return init(mapping,form,request,response);
    }


    public ActionForward modifyresult(ActionMapping mapping, ActionForm form,
                                      HttpServletRequest request,
                                      HttpServletResponse response) throws
            BugReportBaseException {
        //编写你的代码
        ActfrmTopsF02Provider one = (ActfrmTopsF02Provider) form;
        EMTopsF02Provider em = EMTopsF02Provider.getInstance();
        em.modify(one);
        request.setAttribute("objlist", em.findAll());
        return mapping.findForward("actfrmTopsF02Provider.list");
    }

    public ActionForward delete(ActionMapping mapping, ActionForm form,
                                HttpServletRequest request,
                                HttpServletResponse response) throws
            BugReportBaseException {
        //编写你的代码
        EMTopsF02Provider em = EMTopsF02Provider.getInstance();
        String[] ids = request.getParameterValues(com.tops.j2eebase.web.taglib.
                                                  TagSelectCheckBox.
                                                  dufaultCheckBoxName);
        request.setAttribute("objlist", em.findAll());
        return mapping.findForward("actfrmTopsF02Provider.list");
    }
}

⌨️ 快捷键说明

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