/*
 * Generated by MyEclipse Struts
 * Template path: templates/java/JavaClass.vtl
 */
package com.yuntong.action;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.yuntong.service.Y_IAreaFreightInfoService;

/** 
 * MyEclipse Struts
 * Creation date: 04-22-2007
 * 查找运时运费信息
 * XDoclet definition:
 * @struts.action validate="true"
 */
public class Y_selectYSYFAction extends Action {
	private Y_IAreaFreightInfoService areaFreightInfoService;
	public Y_IAreaFreightInfoService getAreaFreightInfoService() {
		return areaFreightInfoService;
	}
	public void setAreaFreightInfoService(
			Y_IAreaFreightInfoService areaFreightInfoService) {
		this.areaFreightInfoService = areaFreightInfoService;
	}
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		HttpSession session=request.getSession();
		String strStrat=request.getParameter("strat");
		String strEnd=request.getParameter("end");
		int strat=Integer.parseInt(strStrat);
		int end=Integer.parseInt(strEnd);
		//得到总页数
		int pageNum=areaFreightInfoService.getPageNum(12, strat, end);
		//得到第一页信息
		List clist=areaFreightInfoService.findSplitRegister(12, 1, strat, end);
//		保存当前页信息
		session.setAttribute("Y_ysyfinfo", clist);
		//保存分页信息
		//当前页
		session.setAttribute("Y_ysyfc", 1);
		//总页数
		session.setAttribute("Y_ysyfs", pageNum);
		//查询条件
		session.setAttribute("Y_ysyf1", strat);
		session.setAttribute("Y_ysyf2", end);
		
		return mapping.findForward("go");
	}
}