package com.action; import java.util.List; import java.util.Map; import org.apache.struts2.ServletActionContext; import com.dao.TShouruDAO; import com.model.TShouru; import com.model.TUser; import com.opensymphony.xwork2.ActionSupport; public class shouruAction extends ActionSupport { private Integer id; private String shijian; private Double jine; private String chengyuan; private String leixing; private String beizhu; private Integer userId; private String message; private String path; private TShouruDAO shouruDAO; public String shouruAdd() { Map session= ServletActionContext.getContext().getSession(); TUser user=(TUser)session.get("user"); TShouru shouru=new TShouru(); shouru.setShijian(shijian); shouru.setJine(jine); shouru.setChengyuan(chengyuan); shouru.setLeixing(leixing); shouru.setBeizhu(beizhu); shouru.setUserId(user.getUserId()); shouruDAO.save(shouru); this.setMessage("²Ù×÷³É¹¦"); this.setPath("shouruMana.action"); return "succeed"; } public String shouruMana() { Map session= ServletActionContext.getContext().getSession(); TUser user=(TUser)session.get("user"); String sql ="from TShouru where userId="+user.getUserId(); List shouruList=shouruDAO.getHibernateTemplate().find(sql); Map request=(Map)ServletActionContext.getContext().get("request"); request.put("shouruList", shouruList); return ActionSupport.SUCCESS; } public String shouruDel() { TShouru shouru=shouruDAO.findById(id); shouruDAO.delete(shouru); this.setMessage("²Ù×÷³É¹¦"); this.setPath("shouruMana.action"); return "succeed"; } public String getBeizhu() { return beizhu; } public void setBeizhu(String beizhu) { this.beizhu = beizhu; } public String getChengyuan() { return chengyuan; } public void setChengyuan(String chengyuan) { this.chengyuan = chengyuan; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public Double getJine() { return jine; } public void setJine(Double jine) { this.jine = jine; } public String getLeixing() { return leixing; } public void setLeixing(String leixing) { this.leixing = leixing; } public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } public String getPath() { return path; } public void setPath(String path) { this.path = path; } public String getShijian() { return shijian; } public void setShijian(String shijian) { this.shijian = shijian; } public TShouruDAO getShouruDAO() { return shouruDAO; } public void setShouruDAO(TShouruDAO shouruDAO) { this.shouruDAO = shouruDAO; } public Integer getUserId() { return userId; } public void setUserId(Integer userId) { this.userId = userId; } }

skook7 LV2
2024年5月27日
微信网友_6508798513811456 LV5
2023年6月17日
zzw123zzw LV6
2022年10月28日
zhaoyangwfd LV17
2022年10月11日
srl2881552 LV10
2022年9月6日
地上有草 LV12
2022年5月11日
wanglinddad LV55
2022年3月8日
encoun LV3
2022年1月5日
形水灯 LV4
2021年11月8日
lsc860911 LV11
2021年6月2日

hawkzl LV2
4月2日
微信网友_7391151377240064
2月19日
暂无贡献等级
kiel22 LV2
2024年12月25日
anjuw521 LV1
2024年7月11日
刘昊然 LV1
2024年7月1日
wangbh1234 LV1
2024年6月6日
denliv_hui LV14
2024年5月28日
huott1993 LV1
2024年4月6日
WBelong LV8
2024年3月5日
263648 LV7
2023年12月28日