/*
* Generated by MyEclipse Struts
* Template path: templates/java/JavaClass.vtl
*/
package web.struts.action;
import java.io.UnsupportedEncodingException;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.DispatchAction;
import web.struts.form.CustForm;
import com.biz.CustactivitiesBiz;
import com.biz.Custactivities_editBiz;
import com.biz.CustactivitiesaddBiz;
import com.biz.CustactivitiessaveBiz;
import com.biz.CustdeletebaseBiz;
import com.biz.CusteditBiz;
import com.biz.CustinitBiz;
import com.biz.CustlinkmanBiz;
import com.biz.CustlinkmanaddBiz;
import com.biz.CustlinkmaneditBiz;
import com.biz.CustlostBiz;
import com.biz.CustlostconfirmBiz;
import com.biz.CustlostrelayBiz;
import com.biz.CustorderlistBiz;
import com.biz.CustordershowBiz;
import com.biz.CustsaveBiz;
import com.biz.CustsearchBiz;
import com.biz.RightBiz;
import com.entity.CstActivity;
import com.entity.CstCustomer;
import com.entity.CstLinkman;
import com.entity.CstLost;
import com.entity.Orders;
import com.entity.OrdersLine;
/**
* MyEclipse Struts Creation date: 03-01-2009
*
* XDoclet definition:
*
* @struts.action parameter="operate" validate="true"
*/
public class CustAction extends DispatchAction {
/*
* Generated Methods
*/
/**
* Method execute
*
* @param mapping
* @param form
* @param request
* @param response
* @return ActionForward
*/
/**
* @author 赵翰文;
*/
private CustinitBiz custinitbiz = null;
private RightBiz rightBiz = null;
/**
* init()方法查询客户表,初始化客户信息管理页面数据;
*
* @author 赵翰文;
*
*/
public ActionForward init(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
try {
// TODO Auto-generated method stub
CustForm custForm = (CustForm) form;
String hql = "select custInfo From CstCustomer as custInfo where 1 = 1 AND custInfo.custStatus = '2'";
rightBiz.getRigthList(custForm, hql);
// List listinit = custinitbiz.CustInit();
List listCustLeavel = custinitbiz.CustLeavel();
List listCustRegion = custinitbiz.CustRegion();
// request.setAttribute("initList", listinit);
request.setAttribute("CustLeavel", listCustLeavel);
request.setAttribute("CustRegion", listCustRegion);
return mapping.findForward("initok");
} catch (Exception zhaohanwen) {
zhaohanwen.printStackTrace();
return null;
}
}
/**
* search()方法实现客户信息管理页面的高级查询显示功能;
*
* @author 赵翰文;
*
*/
private CustsearchBiz custsearchbiz = null;
public ActionForward search(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
try {
CustForm custform = (CustForm) form;
CstCustomer custInfo = custform.getCustInfo();
List listinit = custsearchbiz.CustSearch(custInfo);
String hql = custsearchbiz.CustSearchHql(custInfo);
rightBiz.getRigthList(custform, hql);
List listCustLeavel = custinitbiz.CustLeavel();
List listCustRegion = custinitbiz.CustRegion();
// request.setAttribute("initList", listinit);
request.setAttribute("CustLeavel", listCustLeavel);
request.setAttribute("CustRegion", listCustRegion);
return mapping.findForward("searchok");
} catch (Exception zhaohanwen) {
zhaohanwen.printStackTrace();
return null;
}
}
/**
* custedit()方法实现客户信息管理页面的编辑功能;
*
* @author 赵翰文;
*
*/
private CusteditBiz custeditbiz = null;
public ActionForward custedit(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
try {
String custID = request.getParameter("custID");
CstCustomer custInfo = custeditbiz.custedit(custID);
request.setAttribute("ManagerName", custinitbiz.usrName());
request.setAttribute("CustLeavel", custinitbiz.CustLeavel());
request.setAttribute("CustRegion", custinitbiz.CustRegion());
request.setAttribute("custInfo_Edit", custInfo);
return mapping.findForward("custEditok");
} catch (Exception zhaohanwen) {
zhaohanwen.printStackTrace();
return null;
}
}
/**
* custsave()方法实现客户信息管理页面的编辑之后保存功能;
*
* @author 赵翰文;
*
*/
@SuppressWarnings("unused")
private CustsaveBiz custsavebiz = null;
public ActionForward custsave(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
try {
@SuppressWarnings("unused")
CustForm custsaveform = (CustForm) form;
@SuppressWarnings("unused")
CstCustomer custInfo = custsaveform.getCustInfo();
custsavebiz.custsave(custInfo); // 进入保存方法;
return mapping.findForward("custsaveok");
} catch (Exception zhaohanwen) {
zhaohanwen.printStackTrace();
return null;
}
}
/**
* custlinkman()方法查询联系人表,初始化客户信息联系人页面数据;
*
* @author 赵翰文;
*
*/
private CustlinkmanBiz custlinkmanbiz = null;
public ActionForward custlinkman(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
try {
request.setCharacterEncoding("UTF-8"); // 设置编码;
response.setCharacterEncoding("UTF-8"); // 设置编码;
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
@SuppressWarnings("unused")
String cuID = request.getParameter("cusID");
@SuppressWarnings("unused")
String cuName = request.getParameter("cusName");
List custlinkmanList = custlinkmanbiz.custlinkman(cuID);
request.setAttribute("cuID", cuID);
request.setAttribute("cuName", cuName);
request.setAttribute("linkmanList", custlinkmanList);
return mapping.findForward("custlinkmanlistok");
} catch (Exception zhaohanwen) {
zhaohanwen.printStackTrace();
return null;
}
}
/**
* initLinkman_add()()方法实现新建联系人页面数据初始化功能;
*
* @author 赵翰文;
*
*/
public ActionForward initLinkman_add(ActionMapping mapping,
ActionForm form, HttpServletRequest request,
HttpServletResponse response) {
try {
String cusNo = request.getParameter("cusNo");
String cusName = request.getParameter("cusName");
request.setAttribute("cusNo", cusNo);
request.setAttribute("cusName", cusName);
return mapping.findForward("initLinkman_add_ok");
} catch (Exception zhaohanwen) {
zhaohanwen.printStackTrace();
return null;
}
}
/**
* custlinkmanadd()方法实现新建联系人功能;
*
* @author 赵翰文;
*
*/
private CustlinkmanaddBiz custlinkmanaddbiz = null;
public ActionForward custlinkmanadd(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
try {
CustForm linkmanaddForm = (CustForm) form;
CstLinkman linkmanInfo = linkmanaddForm.getLinkmanInfo();
String custID = request.getParameter("custID");
custlinkmanaddbiz.custlinkmanadd(linkmanInfo);
return mapping.findForward("linkmanaddok");
} catch (Exception zhaohanwen) {
zhaohanwen.printStackTrace();
return null;
}
}
/**
* custlinkmanedit()方法实现编辑联系人页面数据加载功能;
*
* @author 赵翰文;
*
*/
private CustlinkmaneditBiz custlinkmaneditbiz = null;
public ActionForward custlinkmanedit(ActionMapping mapping,
ActionForm form, HttpServletRequest request,
HttpServletResponse response) {
try {
String linkmanID = request.getParameter("linkmanID");
CstLinkman linkmanInfo = custlinkmaneditbiz
.custlinkmanedit(linkmanID);
request.setAttribute("linkmanInfo",