/*
* 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");
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
房屋租赁管理系统学习代码
共104个文件
jar:31个
java:14个
class:14个
需积分: 13 20 下载量 26 浏览量
2018-11-16
17:19:24
上传
评论 12
收藏 9.18MB RAR 举报
温馨提示
本次租房管理系统的编写采用JSP来实现,用Java语言编写类。开放工具使用MyEclipse6.0、用到Structs+Hibernate。 该系统具有以下功能: 1 注册用户,用户登录。 2 发布租房信息。 3 管理租房信息。(添加、删除、修改、查询房源信息) 4 注销并退出系统。 界面要求: 使用网页实现,要符合日常软件使用规范来设计界面的布局。
资源推荐
资源详情
资源评论
收起资源包目录
房屋租赁管理系统学习代码 (104个子文件)
HireinfoAction.class 6KB
UserDao.class 4KB
HireinfoForm.class 4KB
Hireinfo.class 4KB
BaseDAO.class 3KB
UserAction.class 2KB
HibernateSessionFactory.class 2KB
Address.class 2KB
DateDiff.class 2KB
UserForm.class 2KB
Users.class 2KB
CharacterEncodingFilter.class 1KB
Salary.class 918B
IBaseDao.class 394B
.classpath 3KB
btn.css 3KB
mycss.css 1KB
text.css 295B
layout_24.gif 945B
househire_backup 1.08MB
hibernate3.jar 1.87MB
jgroups-2.2.8.jar 1.53MB
xerces-2.6.2.jar 972KB
jboss-jmx.jar 578KB
jboss-common.jar 573KB
c3p0-0.9.0.jar 477KB
proxool-0.8.3.jar 459KB
antlr-2.7.6rc1.jar 427KB
jboss-cache.jar 364KB
log4j-1.2.11.jar 343KB
dom4j-1.6.1.jar 303KB
msbase.jar 280KB
cglib-2.1.3.jar 276KB
jaxen-1.1-beta-7.jar 223KB
jboss-system.jar 218KB
commons-collections-2.1.1.jar 170KB
concurrent-1.3.2.jar 166KB
xml-apis.jar 121KB
oscache-2.1.jar 112KB
jaas.jar 101KB
mssqlserver.jar 66KB
msutil.jar 58KB
ehcache-1.1.jar 46KB
commons-logging-1.0.4.jar 37KB
swarmcache-1.0rc2.jar 30KB
asm.jar 26KB
jacc-1_0-fr.jar 24KB
connector.jar 18KB
asm-attrs.jar 17KB
jta.jar 8KB
jdbc2_0-stdext.jar 7KB
HireinfoAction.java 6KB
UserDao.java 5KB
HibernateSessionFactory.java 3KB
Hireinfo.java 3KB
HireinfoForm.java 3KB
DateDiff.java 3KB
UserAction.java 2KB
BaseDAO.java 2KB
CharacterEncodingFilter.java 1KB
UserForm.java 1KB
Address.java 1KB
Users.java 1KB
Salary.java 534B
IBaseDao.java 349B
middle1.jpg 36KB
bottom.jpg 14KB
middle4.jpg 9KB
middle2.jpg 9KB
error.jpg 2KB
update.jsp 13KB
index.jsp 6KB
post.jsp 6KB
user.jsp 6KB
detail.jsp 5KB
postconfirm.jsp 4KB
list.jsp 4KB
my.jsp 3KB
regist.jsp 3KB
login.jsp 2KB
.struts-config.mex 3KB
MANIFEST.MF 39B
.myhibernatedata 485B
.mymetadata 300B
.mystrutsdata 255B
top1.png 284KB
org.eclipse.core.resources.prefs 159B
.project 1KB
ApplicationResources.properties 85B
ApplicationResources.properties 85B
struts-html.tld 72KB
struts-nested.tld 70KB
struts-logic.tld 14KB
struts-bean.tld 9KB
struts-tiles.tld 8KB
validator-rules.xml 13KB
Hireinfo.hbm.xml 2KB
Hireinfo.hbm.xml 2KB
struts-config.xml 2KB
web.xml 1KB
共 104 条
- 1
- 2
资源评论
qq_35902208
- 粉丝: 0
- 资源: 12
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 这是用MATLAB编写的sar合成孔径雷达反投影算法的一个实例.zip
- 这些matlab代码通过使用中心有限差分法求解相场方程来模拟晶粒生长.zip
- 针对工程师的SDR的MATLAB实现教材.zip
- 针对MATLAB的AIR Tools II工具箱附带出版物AIR Tools II代数迭代重建方法改进实现Hansen.zip
- Matlab实现RIME-BP霜冰优化BP神经网络多特征分类预测的详细项目实例(含完整的程序,GUI设计和代码详解)
- 针对电子战的发射器探测和地理定位的MATLAB代码.zip
- 阵列信号处理中到达方向DOA估计的MATLAB函数集.zip
- 执行一些从matlab代码到fortran的简单转换.zip
- 执行神经科学数据的信息理论分析的MATLAB工具箱.zip
- 主动学习工具箱的MATLAB.zip
- 准定量子点通道的MATLAB实现.zip
- 指纹识别在运行时使用从移动设备捕获的图像,使用Android和OpenCV构建,也构建在MATLAB中.zip
- 姿态和航向参考系统用MATLAB尽量简单.zip
- Matlab基于BiGRU双向门控循环单元的锂电池寿命预测的详细项目实例(含完整的程序,GUI设计和代码详解)
- 自动编码变分贝叶斯的MATLAB实现.zip
- 自然语言处理工具MATLAB.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功