Ejemplo n.º 1
0
 // 跳转添加页面
 public ActionForward savePage(
     ActionMapping mapping,
     ActionForm form,
     HttpServletRequest request,
     HttpServletResponse response)
     throws AppException {
   Agent agent = new Agent();
   request.setAttribute("companyList", PlatComAccountStore.companyList);
   agent.setThisAction("saveAgent");
   request.setAttribute("agent", agent);
   String forwardPage = "editAgent";
   return mapping.findForward(forwardPage);
 }
Ejemplo n.º 2
0
 // 跳转修改页面
 public ActionForward updatePage(
     ActionMapping mapping,
     ActionForm form,
     HttpServletRequest request,
     HttpServletResponse response)
     throws AppException {
   AgentListForm agentListForm = (AgentListForm) form;
   request.setAttribute("companyList", PlatComAccountStore.companyList);
   long agentId = agentListForm.getSelectedItems()[0];
   if (agentId > 0) {
     Agent agent = agentBiz.getAgentByid(agentId);
     agent.setThisAction("updateAgent");
     agent.setCompanyId(agent.getCompany().getId());
     request.setAttribute("agent", agent);
   } else {
     request.setAttribute("agent", new Agent());
   }
   return mapping.findForward("editAgent");
 }