📄 showoneunderlingempallclientinfoaction.java
字号:
/*
* Generated by MyEclipse Struts
* Template path: templates/java/JavaClass.vtl
*/
package com.oa.crm.underlingManager.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.db.ClientServer;
import com.oa.crm.db.StaffBasicInfoDAOImpl;
import com.oa.crm.form.ClientInfoForm;
import com.oa.db.Staffbasicinfo;
import com.oa.page.PageBean;
/**
* MyEclipse Struts Creation date: 08-27-2007
*
* XDoclet definition:
*
* @struts.action validate="true"
*/
public class ShowOneUnderlingEmpAllClientInfoAction extends Action {
/*
* Generated Methods
*/
/**
* Method execute
*
* @param mapping
* @param form
* @param request
* @param response
* @return ActionForward
*/
private ClientInfoDAOImpl clientInfoDao;
private PageBean pageBean;
private Staffbasicinfo staffBasicInfo;
private StaffBasicInfoDAOImpl staffBasicInfoDao;
public void setClientInfoDao(ClientInfoDAOImpl clientInfoDao) {
this.clientInfoDao = clientInfoDao;
}
public void setPageBean(PageBean pageBean) {
this.pageBean = pageBean;
}
public void setStaffBasicInfo(Staffbasicinfo staffBasicInfo) {
this.staffBasicInfo = staffBasicInfo;
}
public void setStaffBasicInfoDao(StaffBasicInfoDAOImpl staffBasicInfoDao) {
this.staffBasicInfoDao = staffBasicInfoDao;
}
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
// TODO Auto-generated method stub
String username = "";
ClientInfoForm clientInfoForm = (ClientInfoForm) form;
String realname = "";
String empId1 = "";
username = request.getParameter("username");
if (username != null) {
empId1 = username.toLowerCase();
request.getSession().setAttribute("empId1", empId1);
} else {
empId1 = request.getSession().getAttribute("empId1").toString();
}
ArrayList<ClientInfo> clientInfoList = new ArrayList<ClientInfo>();
int total = clientInfoDao.getTotalRecord(empId1);
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.showMenberClientInfo(start - 1, 5, empId1);
} 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.showMenberClientInfo(start - 1, 5, empId1);
} else {
if (total >= (Integer.parseInt(appointPage) - 1) * 5) {
pageBean.setCurrentPage(Integer.parseInt(appointPage));
int start = pageBean.getStart();
clientInfoList = (ArrayList<ClientInfo>) clientInfoDao.showMenberClientInfo(start - 1, 5, empId1);
} 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.showMenberClientInfo(start - 1, 5, empId1);
}
}
request.setAttribute("pageBean", pageBean);
request.setAttribute("clientInfoList", clientInfoList);
return mapping.findForward("showOneUnderlingEmpAllClientInfo");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -