package com.action; import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; import java.util.Map; import org.apache.struts2.ServletActionContext; import com.dao.TShipinDAO; import com.model.TShipin; import com.opensymphony.xwork2.ActionSupport; public class shipinAction { private int shipinId; private String shipinName; private String shipinJianjie; private String fujian; private String fujianYuanshiming; private String message; private String path;; private TShipinDAO shipinDAO; public String shipinAdd() { TShipin shipin=new TShipin(); shipin.setShipinName(shipinName); shipin.setFujian(fujian); shipin.setShipinJianjie(shipinJianjie); shipin.setFujianYuanshiming(fujianYuanshiming); shipin.setShijian(new SimpleDateFormat("yyyy-MM-dd").format(new Date())); shipin.setDel("no"); shipinDAO.save(shipin); this.setMessage("²Ù×÷³É¹¦"); this.setPath("shipinMana.action"); return "succeed"; } public String shipinMana() { String sql="from TShipin where del='no'"; List shipinList=shipinDAO.getHibernateTemplate().find(sql); Map request=(Map)ServletActionContext.getContext().get("request"); request.put("shipinList", shipinList); return ActionSupport.SUCCESS; } public String shipinDel() { TShipin shipin=shipinDAO.findById(shipinId); shipin.setDel("yes"); shipinDAO.attachDirty(shipin); this.setMessage("²Ù×÷³É¹¦"); this.setPath("shipinMana.action"); return "succeed"; } public String shipinAll() { String sql="from TShipin where del='no'"; List shipinList=shipinDAO.getHibernateTemplate().find(sql); Map request=(Map)ServletActionContext.getContext().get("request"); request.put("shipinList", shipinList); return ActionSupport.SUCCESS; } public String shipinDetailQian() { TShipin shipin=shipinDAO.findById(shipinId); Map request=(Map)ServletActionContext.getContext().get("request"); request.put("shipin", shipin); return ActionSupport.SUCCESS; } public String getFujian() { return fujian; } public void setFujian(String fujian) { this.fujian = fujian; } public String getFujianYuanshiming() { return fujianYuanshiming; } public void setFujianYuanshiming(String fujianYuanshiming) { this.fujianYuanshiming = fujianYuanshiming; } 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 TShipinDAO getShipinDAO() { return shipinDAO; } public void setShipinDAO(TShipinDAO shipinDAO) { this.shipinDAO = shipinDAO; } public int getShipinId() { return shipinId; } public void setShipinId(int shipinId) { this.shipinId = shipinId; } public String getShipinJianjie() { return shipinJianjie; } public void setShipinJianjie(String shipinJianjie) { this.shipinJianjie = shipinJianjie; } public String getShipinName() { return shipinName; } public void setShipinName(String shipinName) { this.shipinName = shipinName; } }
最近下载更多
wananall LV13
3月13日
qq2901732871 LV9
2023年4月11日
907552380 LV13
2022年5月27日
1151277823 LV1
2022年4月2日
a318888331 LV13
2022年3月30日
wanglinddad LV55
2021年12月17日
iop4875127 LV4
2021年9月24日
1327330592 LV1
2021年6月1日
ericxu1116 LV24
2021年5月26日
fengsoul LV1
2021年5月19日