lostaction.java
来自「crm系统 有源码 及相关文档sql2005 数据库 客户反馈模块」· Java 代码 · 共 156 行
JAVA
156 行
package org.jb.y272.team0.web.action;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.jb.common.web.action.BaseAction;
import org.jb.y272.team0.biz.LostBiz;
import org.jb.y272.team0.entity.CstLost;
import org.jb.y272.team0.web.form.LostForm;
/**
* 客户流失 Action Bean
* @author hailong.liu
*/
public class LostAction extends BaseAction {
/**
* 转到 查询页面
*/
public ActionForward toList(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception{
LostForm myForm = (LostForm)form;
this.lostBiz.search(myForm.getItem(), myForm.getPageResult());
return mapping.findForward("list");
}
public ActionForward toConfirm(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception{
LostForm myForm = (LostForm)form;
String id = request.getParameter("id");
CstLost item = this.lostBiz.get(Long.parseLong(id));
myForm.setItem(item);
return mapping.findForward("confirm");
}
public ActionForward doConfirm(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception{
LostForm myForm = (LostForm)form;
this.lostBiz.confirm(myForm.getItem());
response.sendRedirect("lost.do?o=toList");
return null;
}
public ActionForward toRelay(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception{
LostForm myForm = (LostForm)form;
String id = request.getParameter("id");
CstLost item = this.lostBiz.get(Long.parseLong(id));
myForm.setItem(item);
return mapping.findForward("delay");
}
public ActionForward doRelay(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception{
LostForm myForm = (LostForm)form;
this.lostBiz.relay(myForm.getItem());
response.sendRedirect("lost.do?o=toList");
return null;
}
/**
* 转到 新建页面
*/
public ActionForward toAdd(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception{
LostForm myForm = (LostForm)form;
myForm.setItem(new CstLost());
return mapping.findForward("add");
}
/**
* 执行 新建操作
*/
public ActionForward doAdd(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception{
LostForm myForm = (LostForm)form;
this.lostBiz.add(myForm.getItem());
response.sendRedirect("lost.do?o=toList");
return null;
}
/**
* 转到 编辑页面
*/
public ActionForward toEdit(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception{
LostForm myForm = (LostForm)form;
String id = request.getParameter("id");
CstLost item = this.lostBiz.get(Long.parseLong(id));
myForm.setItem(item);
return mapping.findForward("edit");
}
/**
* 执行 编辑操作
*/
public ActionForward doEdit(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception{
LostForm myForm = (LostForm)form;
this.lostBiz.update(myForm.getItem());
response.sendRedirect("lost.do?o=toList");
return null;
}
/**
* 执行 删除操作
*/
public ActionForward doDel(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception{
String id = request.getParameter("id");
this.lostBiz.del(Long.parseLong(id));
response.sendRedirect("lost.do?o=toList");
return null;
}
/**
* 转到 明细页面
*/
public ActionForward doDetail(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception{
LostForm myForm = (LostForm)form;
String id = request.getParameter("id");
CstLost item = this.lostBiz.get(Long.parseLong(id));
myForm.setItem(item);
return mapping.findForward("detail");
}
/* 注入Biz方法 */
private LostBiz lostBiz = null;
public void setLostBiz(LostBiz lostBiz){
this.lostBiz = lostBiz;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?