/*
* Generated by MyEclipse Struts
* Template path: templates/java/JavaClass.vtl
*/
package com.cstp.struts.action;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.List;
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.apache.struts.actions.DispatchAction;
import com.cstp.bean.Address;
import com.cstp.bean.DateDiff;
import com.cstp.bean.Salary;
import com.cstp.dao.UserDao;
import com.cstp.struts.form.HireinfoForm;
import com.cstp.table.Hireinfo;
import com.cstp.table.Users;
/**
* XDoclet definition:
* @struts.action path="/hireinfo" name="hireinfoForm" parameter="status" scope="request" validate="true"
*/
public class HireinfoAction extends DispatchAction {
UserDao dao = new UserDao();
public ActionForward searchHireinfo(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
HireinfoForm hireinfoForm = (HireinfoForm) form;
Hireinfo hireinfo = new Hireinfo();
hireinfo.setCounty(hireinfoForm.getCounty());
hireinfo.setStreet(hireinfoForm.getStreet());
hireinfo.setRoomCount(hireinfoForm.getRoomCount());
hireinfo.setHallCount(hireinfoForm.getHallCount());
hireinfo.setType(hireinfoForm.getType());
hireinfo.setCreateTime(hireinfoForm.getCreateTime());
Salary sal = new Salary();
sal.setMinsalary(hireinfoForm.getMinsalary());
sal.setMaxsalary(hireinfoForm.getMaxsalary());
DateDiff datediff = new DateDiff();
hireinfo.setCreateTime(datediff.getPostTime(hireinfoForm.getCreateTime()));
List hireinfolist = dao.searchHireinfo(hireinfo, sal);
request.setAttribute("hireinfolist", hireinfolist);
return mapping.findForward("list");
}
public ActionForward myHireinfo(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
Users user = (Users)request.getSession().getAttribute("user");
List mylist = dao.findMyHireinfo(user);
request.setAttribute("mylist", mylist);
return mapping.findForward("my");
}
public ActionForward deleteHireinfo(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
int id = Integer.parseInt(request.getParameter("id"));
Hireinfo hireinfo = (Hireinfo)dao.findById(id, Hireinfo.class);
dao.delete(hireinfo);
return mapping.findForward("hireinfo");
}
public ActionForward findHireinfoById(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
int id = Integer.parseInt(request.getParameter("id"));
int flag = Integer.parseInt(request.getParameter("flag"));
Hireinfo hireinfo = (Hireinfo)dao.findById(id, Hireinfo.class);
request.setAttribute("hireinfo", hireinfo);
Address address = new Address();
String county = address.getCounty(hireinfo.getCounty());
String street = address.getStreet(hireinfo.getCounty(), hireinfo.getStreet());
address.setCounty(county);
address.setStreet(street);
address.setI(hireinfo.getCounty());
address.setJ(hireinfo.getStreet());
request.setAttribute("address", address);
if(flag == 0){
return mapping.findForward("detail");
}
return mapping.findForward("update");
}
public ActionForward updateHireinfoById(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
int id = Integer.parseInt(request.getParameter("id"));
HireinfoForm hireinfoForm = (HireinfoForm) form;
Hireinfo hireinfo = (Hireinfo)dao.findById(id, Hireinfo.class);
hireinfo.setTitle(hireinfoForm.getTitle());
hireinfo.setTelephone(hireinfoForm.getTelephone());
hireinfo.setLinkman(hireinfoForm.getLinkman());
hireinfo.setType(hireinfoForm.getType());
hireinfo.setRoomCount(hireinfoForm.getRoomCount());
hireinfo.setHallCount(hireinfoForm.getRoomCount());
hireinfo.setSalary(hireinfoForm.getSalary());
hireinfo.setCounty(hireinfoForm.getCounty());
hireinfo.setStreet(hireinfoForm.getStreet());
hireinfo.setHouseInfo(hireinfoForm.getHouseInfo());
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String createTime = sdf.format(Calendar.getInstance().getTime());
hireinfo.setCreateTime(createTime);
dao.update(hireinfo);
return mapping.findForward("hireinfo");
}
public ActionForward saveHireinfo(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
HireinfoForm hireinfoForm = (HireinfoForm) form;
Users user = (Users)request.getSession().getAttribute("user");
Hireinfo hireinfo = new Hireinfo();
hireinfo.setUsers(user);
hireinfo.setTitle(hireinfoForm.getTitle());
hireinfo.setTelephone(hireinfoForm.getTelephone());
hireinfo.setLinkman(hireinfoForm.getLinkman());
hireinfo.setType(hireinfoForm.getType());
hireinfo.setRoomCount(hireinfoForm.getRoomCount());
hireinfo.setHallCount(hireinfoForm.getRoomCount());
hireinfo.setSalary(hireinfoForm.getSalary());
hireinfo.setCounty(hireinfoForm.getCounty());
hireinfo.setStreet(hireinfoForm.getStreet());
hireinfo.setHouseInfo(hireinfoForm.getHouseInfo());
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String createTime = sdf.format(Calendar.getInstance().getTime());
hireinfo.setCreateTime(createTime);
request.getSession().setAttribute("hireinfo", hireinfo);
Address address = new Address();
address.setCounty(address.getCounty(hireinfoForm.getCounty()));
address.setStreet(address.getStreet(hireinfoForm.getCounty(), hireinfoForm.getStreet()));
request.setAttribute("address", address);
// dao.save(hireinfo);
return mapping.findForward("postconfirm");
}
public ActionForward confirm(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
Hireinfo hireinfo = (Hireinfo)request.getSession().getAttribute("hireinfo");
dao.save(hireinfo);
request.getSession().removeAttribute("hireinfo");
return mapping.findForward("hireinfo");
}
}
weixin_38746387
- 粉丝: 332
- 资源: 1307
最新资源
- 多微网优化模型matlab 采用粒子群算法分析两个微网的优化调度,得到蓄电池,发电机以及微网间功率传输,程序有参考资料
- 潮流计算程序matlab 牛拉法 采用matlab对9节点进行潮流计算,采用牛拉法,程序运行可靠
- 微网优化调度matlab 采用matlab+yalmip编制含分布式和储能的微网优化模型,程序采用15分钟为采集节点,利用cplex求解,程序考虑发电机的启停约束,程序运行可靠
- PMSM永磁同步电机仿真三电平SVPWM矢量控制matlab PMSM双环矢量控制传统三电平
- 路径规划人工势场法以及改进人工势场法matlab代码,包含了
- MobaXterm 是一款功能强大且实用的终端仿真器软件.docx
- 三菱FX3U底层源码,PLSR源码 总体功能和指令可能支持在RUN中下载程序,支持注释的写入和读取,支持脉冲输出与定位指令(包括PLSY PWM PLSR PLSV DRVI DRVA 等指令
- Oracle Database Gateways for Win32-11gR2
- python071基于RSA加密算法软件的研究设计
- 成熟量产低压无刷伺服驱动 方案 全套软硬件资料 源码 原理图 需要的直接拿 基于28035平台
- 欧姆龙PLC ST语言6轴伺服RS232C通讯板CP1W-C IF0 真实项目程序,ST语言写的FB块 PLC用是两台CP1H-X40DT-D配置4块RS232C通讯板CP1W-CIF01 触摸屏是N
- 欧姆龙CP1H与力士乐VFC-x610变频器通讯程序功能:原创程序,可直接用于现场程序 欧姆龙CP1H的CIF11通讯板,实现对力士乐VFC-x610变频器 设定频率,控制正反转,读取实际频率,读取
- 级联型电力电子变压器,高压直流MMC控制系统,级联数可选,调 制方式有移相载波,nlm及混合调制,拥有冒泡排序,递归排序等方法,可控制三相不平衡与环流
- 西门子PLC双轴定位算法电池焊接控制程序-S7-1200 +威纶通触摸屏 S7-1200PLC做的电池焊接程序,电池包里面有n*m行列个电池 程序设计灵活SCL语言+梯形图,采用了位置试教与定位路径规
- 变压器副边突然短路simulink仿真
- MATLAB代码:基于模型预测控制的楼宇负荷需求响应研究 关键词:楼宇负荷 空调 模型预测控制 需求响应 仿真平台:MATLAB+CVX平台 主要内容:代码主要做的是一个建筑楼宇的需求响应问题,首
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
- 1
- 2
前往页