📄 showoneempallclientinfodescaction.java
字号:
/*
* Generated by MyEclipse Struts
* Template path: templates/java/JavaClass.vtl
*/
package com.oa.crm.myClientManager.action;
import java.util.ArrayList;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
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.oa.crm.db.ClientInfo;
import com.oa.crm.db.ClientInfoDAOImpl;
import com.oa.crm.form.ClientInfoForm;
import com.oa.page.PageBean;
/**
* MyEclipse Struts Creation date: 08-28-2007
*
* XDoclet definition:
*
* @struts.action validate="true"
*/
public class ShowOneEmpAllClientInfoDescAction extends Action {
/*
* Generated Methods
*/
/**
* Method execute
*
* @param mapping
* @param form
* @param request
* @param response
* @return ActionForward
*/
private ClientInfoDAOImpl clientInfoDao;
private PageBean pageBean;
public void setPageBean(PageBean pageBean) {
this.pageBean = pageBean;
}
public void setClientInfoDao(ClientInfoDAOImpl clientInfoDao) {
this.clientInfoDao = clientInfoDao;
}
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
// TODO Auto-generated method stub
ClientInfoForm clientInfoForm = (ClientInfoForm) form;
String empId = request.getSession().getAttribute("empId").toString();
String sortFiled = null;
if(request.getParameter("sortId") != null){
sortFiled = request.getParameter("sortId").toString();
request.getSession().setAttribute("sortFiled",sortFiled);
}else{
sortFiled = request.getSession().getAttribute("sortFiled").toString();
}
ArrayList<ClientInfo> clientInfoList = new ArrayList<ClientInfo>();
int total = clientInfoDao.getTotalRecord(empId);
pageBean.setPageSize(5);
pageBean.setTotalRecoder(total);
String appointPage = clientInfoForm.getAppointPage();
if (appointPage == null || appointPage.equals("")) {
String currentPage = request.getParameter("currentPage");
if (currentPage == null) {
pageBean.setCurrentPage(1);
} else {
pageBean.setCurrentPage(Integer.valueOf(currentPage));
}
int start = pageBean.getStart();
saveToken(request);
clientInfoList = (ArrayList<ClientInfo>) clientInfoDao.showMenberSortDescClientInfo(start - 1, 5, empId, sortFiled);
} else if ((Integer.parseInt(appointPage) <= 0)) {
String currentPage = request.getParameter("currentPage");
if (currentPage == null) {
pageBean.setCurrentPage(1);
} else {
pageBean.setCurrentPage(Integer.valueOf(currentPage));
}
int start = pageBean.getStart();
saveToken(request);
clientInfoList = (ArrayList<ClientInfo>) clientInfoDao.showMenberSortDescClientInfo(start - 1, 5, empId, sortFiled);
} else {
if (total >= (Integer.parseInt(appointPage) - 1) * 5) {
pageBean.setCurrentPage(Integer.parseInt(appointPage));
int start = pageBean.getStart();
clientInfoList = (ArrayList<ClientInfo>) clientInfoDao.showMenberSortDescClientInfo(start - 1, 5, empId, sortFiled);
} else {
String currentPage = null;
if (total % pageBean.getPageSize() == 0) {
currentPage = "" + total / pageBean.getPageSize();
} else {
currentPage = "" + (total / pageBean.getPageSize() + 1);
}
if (currentPage == null) {
pageBean.setCurrentPage(1);
} else {
pageBean.setCurrentPage(Integer.valueOf(currentPage));
}
int start = pageBean.getStart();
saveToken(request);
clientInfoList = (ArrayList<ClientInfo>) clientInfoDao.showMenberSortDescClientInfo(start - 1, 5, empId, sortFiled);
}
}
request.setAttribute("pageBean", pageBean);
request.setAttribute("clientInfoList", clientInfoList);
return mapping.findForward("showOneEmpAllClientInfoDesc");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -