/*
* 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");
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
完整版 房屋租赁管理系统(完整源码+数据库文件).rar
共104个文件
jar:31个
java:14个
class:14个
5星 · 超过95%的资源 需积分: 46 89 下载量 100 浏览量
2019-12-24
15:01:58
上传
评论 26
收藏 9.19MB RAR 举报
温馨提示
亲测好用,挺不错的资源,大家快来下载吧!挺有用的!需要的话可以来下载哦! 本次租房管理系统的编写采用JSP来实现,用Java语言编写类。开放工具使用MyEclipse6.0、用到Structs+Hibernate、数据库采用SQL2005。
资源推荐
资源详情
资源评论
收起资源包目录
完整版 房屋租赁管理系统(完整源码+数据库文件).rar (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
weixin_38746387
- 粉丝: 332
- 资源: 1308
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页